How divyansh1508/free-auto-gpt works
Project Type & Purpose
• This is an open-source Python tool/library for running “autonomous AI agents” (AutoGPT, BabyAGI, CAMEL, custom agents) without paid APIs.
• It provides:
• Free LLM wrappers (ChatGPT, HuggingChat, BingChat, BardChat) under FreeLLM/ and hfAgent/
• Embedding support via HuggingFaceEmbedding
• Agent implementations (AutoGPT.py, BABYAGI.py, Camel.py, TransformersAgent.py, MetaPrompt.py)
• Example/custom agent folder (OtherAgent/) with reusable tools
• Colab notebook entrypoints and VS Code devcontainer
File Structure & Architectural Patterns
• Top-level “scripts” (AUTOGPT.py, BABYAGI.py, Camel.py, TransformersAgent.py, MetaPrompt.py) launch specific agent workflows.
• Python packages:
• FreeLLM/ & hfAgent/ → LLM wrappers implementing a common LLM interface for LangChain
• Embedding/ → embedding provider implementation
• BabyAgi/ → modules for task creation, prioritization, execution
• OtherAgent/ → custom agent templates & tools
• Config layer: .env (tokens, cookies), cookiesBing.json
• Dev/CI: .devcontainer/ and .github/ for reproducible containerized dev environment
• Architectural style: modular, plugin-based LangChain agents + tool pattern
Key README Insights
• The system reverse-engineers public web-endpoints of ChatGPT, HuggingChat, Bing, Bard to wrap them as LLMs
• Uses LangChain’s agent/tool abstraction to glue LLMs + tools (e.g. WikipediaAPIWrapper, PythonREPL, DuckDuckGoSearchTool)
• Provides zero-shot, BabyAGI, AutoGPT, CAMEL patterns as standalone scripts
a. Main Components
1. User Interface layer
• CLI entrypoint scripts (e.g. AUTOGPT.py)
• Jupyter/Colab notebooks under PlugAndPlayStart/
2. Agent Engine
• Core agent orchestrator (LangChain initialize_agent wrapper)
• BabyAgi modules (task_creation.py, task_prioritization.py, task_execution.py)
3. LLM Abstraction layer
• FreeLLM.* (ChatGPTAPI.py, BingChatAPI.py, BardChatAPI.py, HuggingChatAPI.py)
• hfAgent.FreeLLM/ (alternate wrappers)
4. Embeddings service
• Embedding/HuggingFaceEmbedding.py
5. Tooling modules
• Wikipedia, PythonREPL, DuckDuckGoSearch under OtherAgent/Tool or direct LangChain tools
6. Configuration & Secrets
• .env (environment variables), cookiesBing.json
7. Dev & Deployment
• .devcontainer Dockerfile + compose
• requirements.txt for Python deps
b. Relationships & Data Flow
• User → CLI/Notebook → Agent Engine
• Agent Engine ⇄ LLM Abstraction (HTTP/browser automation to ChatGPT/Bing/Bard/HuggingChat)
• Agent Engine → Embedding Service for similarity-based tasks
• Agent Engine → Tool Modules → External APIs (Wiki, Search) or Python REPL
• LLM responses & tool outputs feed back into Agent Engine, then back to User
c. Architectural Patterns
• Plugin pattern: interchangeable LLM backends & tools
• Agent/Tool pattern from LangChain
• Modular layering: UI, Orchestrator, LLM, Tools, Config
d. Technologies & Frameworks
• Python 3, LangChain
• Browser automation or reverse-engineered endpoints (EdgeGPT, pyChatGPT, hugging-chat-api, Bard)
• Docker/Dev Containers for local development
• Jupyter/Colab for notebooks