{"data":{"slug":"forethought-technologies-autochain","name":"AutoChain","tagline":"Build lightweight, extensible, and testable LLM Agents","github_url":"https://github.com/Forethought-Technologies/AutoChain","owner":"Forethought-Technologies","repo":"AutoChain","owner_avatar_url":"https://avatars.githubusercontent.com/u/32120602?v=4","primary_language":"Python","stars":1878,"forks":103,"topics":[],"archived":false,"github_pushed_at":"2025-12-16T20:53:26+00:00","maintenance_label":"Slowing","stars_delta_30d":-1,"url":"https://www.graphcanon.com/tools/forethought-technologies-autochain","markdown_url":"https://www.graphcanon.com/tools/forethought-technologies-autochain.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/forethought-technologies-autochain","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=forethought-technologies-autochain","description":"AutoChain: Build lightweight, extensible, and testable LLM Agents","homepage_url":"https://autochain.forethought.ai","license":"MIT","open_issues":24,"watchers":11,"ai_summary":"AutoChain is a framework for developing lightweight, extensible, and easily testable large language model agents.","readme_excerpt":"# AutoChain\n\nLarge language models (LLMs) have shown huge success in different text generation tasks and\nenable developers to build generative agents based on objectives expressed in natural language.\n\nHowever, most generative agents require heavy customization for specific purposes, and\nsupporting different use cases can sometimes be overwhelming using existing tools\nand frameworks. As a result, it is still very challenging to build a custom generative agent.\n\nIn addition, evaluating such generative agents, which is usually done by manually trying different\nscenarios, is a very manual, repetitive, and expensive task.\n\nAutoChain takes inspiration from LangChain and AutoGPT and aims to solve\nboth problems by providing a lightweight and extensible framework\nfor developers to build their own agents using LLMs with custom tools and\n[automatically evaluating](#workflow-evaluation) different user scenarios with simulated\nconversations. Experienced user of LangChain would find AutoChain is easy to navigate since\nthey share similar but simpler concepts.\n\nThe goal is to enable rapid iteration on generative agents, both by simplifying agent customization\nand evaluation.\n\nIf you have any questions, please feel free to reach out to Yi Lu <yi.lu@forethought.ai>\n\n## Features\n\n- 🚀 lightweight and extensible generative agent pipeline.\n- 🔗 agent that can use different custom tools and\n  support OpenAI [function calling](https://platform.openai.com/docs/guides/gpt/function-calling)\n- 💾 simple memory tracking for conversation history and tools' outputs\n- 🤖 automated agent multi-turn conversation evaluation with simulated conversations\n\n## Setup\n\nQuick install\n\n```shell\npip install autochain\n```\n\nOr install from source after cloning this repository\n\n```shell\ncd autochain\npyenv virtualenv 3.10.11 venv\npyenv local venv\n\npip install .\n```\n\nSet `PYTHONPATH` and `OPENAI_API_KEY`\n\n```shell\nexport OPENAI_API_KEY=\nexport PYTHONPATH=`pwd`\n```\n\nRun your first conversation with agent interactively\n\n```shell\npython autochain/workflows_evaluation/conversational_agent_eval/generate_ads_test.py -i\n```\n\n## How does AutoChain simplify building agents?\n\nAutoChain aims to provide a lightweight framework and simplifies the agent building process in a\nfew\nways, as compared to existing frameworks\n\n1. Easy prompt update  \n   Engineering and iterating over prompts is a crucial part of building generative\n   agent. AutoChain makes it very easy to update prompts and visualize prompt\n   outputs. Run with `-v` flag to output verbose prompt and outputs in console.\n2. Up to 2 layers of abstraction  \n   As part of enabling rapid iteration, AutoChain chooses to remove most of the\n   abstraction layers from alternative frameworks\n3. Automated multi-turn evaluation  \n   Evaluation is the most painful and undefined part of building generative agents. Updating the\n   agent to better perform in one scenario often causes regression in other use cases. AutoChain\n   provides a testing framework to automatically evaluate agent's ability under different\n   user scenarios.\n\n## Example usage\n\nIf you have experience with LangChain, you already know 80% of the AutoChain interfaces.\n\nAutoChain aims to make building custom generative agents as straightforward as possible, with as\nlittle abstractions as possible.\n\nThe most basic example uses the default chain and `ConversationalAgent`:\n\n```python\nfrom autochain.chain.chain import Chain\nfrom autochain.memory.buffer_memory import BufferMemory\nfrom autochain.models.chat_openai import ChatOpenAI\nfrom autochain.agent.conversational_agent.conversational_agent import ConversationalAgent\n\nllm = ChatOpenAI(temperature=0)\nmemory = BufferMemory()\nagent = ConversationalAgent.from_llm_and_tools(llm=llm)\nchain = Chain(agent=agent, memory=memory)\n\nprint(chain.run(\"Write me a poem about AI\")['message'])\n```\n\nJust like in LangChain, you can add a list of tools to the agent\n\n```python\ntools = [\n    Tool(\n        name=\"Get weather\",\n        func=lambda *args,","github_created_at":"2023-05-19T17:49:27+00:00","created_at":"2026-07-11T10:54:40.126225+00:00","updated_at":"2026-08-15T18:01:23.422607+00:00","categories":[{"slug":"ai-agents","name":"AI Agents","url":"https://www.graphcanon.com/categories/ai-agents","markdown_url":"https://www.graphcanon.com/categories/ai-agents.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/ai-agents"}],"tags":[{"slug":"agents","name":"agents"},{"slug":"llm","name":"llm"},{"slug":"python","name":"python"}],"trust":{"provenance":{"is_fork":false,"github_id":642942708,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-08-15T18:01:22.574Z","maintenance":{"label":"Slowing","score":36,"methodology":"github_public_v1","releases_90d":0,"days_since_push":241,"last_release_at":null,"stars_delta_30d":-1,"open_issues_delta_30d":0},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T10:54:41.273Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-08-15T18:01:23.054Z"},"languages":{"value":["python"],"source":"github.language+pyproject.toml","observed_at":"2026-08-15T18:01:23.054Z"},"license_spdx":{"value":"MIT","source":"github.license","observed_at":"2026-08-15T18:01:23.054Z"}},"decision_facts":{"hosting":null,"pricing":null,"requirements":null,"constraints":null,"when_to_use":["Use AutoChain when you need to build lightweight LLM agents that can be easily extended according to your specific needs.","Choose it if your project requires a high degree of modularity, allowing for easy integration with other components or systems.","If your development team prefers Python and the MIT license aligns with your open-source requirements."],"when_not_to_use":["Avoid AutoChain when your project demands heavy customization beyond what its framework allows due to its lightweight nature.","Do not use it if you require a more comprehensive solution out of the box, as AutoChain may necessitate additional development efforts for full functionality.","If the community around AutoChain is too small or inactive, it might not be the best choice for long-term support and updates."],"source":"enrich:decision_facts","observed_at":"2026-07-12T16:40:43.948Z"},"constraint_facets":null,"decision_summary":[{"label":"Adopt for","value":"AutoChain is a framework for developing lightweight, extensible, and easily testable large language model agents."}]}}