# BabyAGI — Task-Driven Autonomous Agent Framework > Lightweight autonomous agent that creates, prioritizes, and executes tasks using LLMs in a continuous loop. ## Install Save as a script file and run: # BabyAGI — Task-Driven Autonomous Agent Framework ## Quick Use ```bash git clone https://github.com/yoheinakajima/babyagi && cd babyagi pip install -r requirements.txt cp .env.example .env # set OPENAI_API_KEY and OBJECTIVE python babyagi.py ``` ## Introduction BabyAGI is a minimalist autonomous agent that runs a continuous loop of task creation, prioritization, and execution. It was one of the earliest demonstrations of LLM-powered autonomous agents, showing how a simple loop of three LLM calls can produce goal-directed behavior from a single objective. ## What BabyAGI Does - Takes a high-level objective and breaks it into actionable tasks - Executes tasks one at a time using LLM calls and optional tool integrations - Generates new tasks based on execution results and the remaining task list - Re-prioritizes the task queue after each cycle to stay on track - Stores task results in a vector database for context retrieval in future steps ## Architecture Overview BabyAGI runs three core functions in a loop: an execution agent that completes the current task, a task creation agent that generates new tasks from results, and a prioritization agent that reorders the queue. It uses Pinecone or Chroma as a vector store to maintain memory of completed work. The entire system fits in a single Python file. ## Self-Hosting & Configuration - Clone the repository and install the minimal Python dependencies - Set OPENAI_API_KEY and your OBJECTIVE in the .env file - Configure the vector store backend (Pinecone, Chroma, or Weaviate) - Adjust the INITIAL_TASK to set the starting point for the agent loop - Set a TABLE_NAME to namespace results in the vector store ## Key Features - Minimal codebase that fits in a single file for easy understanding - Continuous task loop with creation, execution, and prioritization - Vector store memory for context-aware task execution - Configurable objectives and initial tasks - Foundational pattern that influenced many later agent frameworks ## Comparison with Similar Tools - **AutoGPT** — more complex with file system and web access; BabyAGI is deliberately minimal - **MetaGPT** — role-based software development agents; BabyAGI is a general task runner - **CrewAI** — multi-agent teams with role assignment; BabyAGI uses a single agent loop - **LangChain Agents** — tool-using agents with chains; BabyAGI focuses on the task planning loop - **SuperAGI** — production agent platform with GUI; BabyAGI is a lightweight reference implementation ## FAQ **Q: Is BabyAGI still maintained?** A: The original repository is archived as a reference. The concept lives on in frameworks it inspired. **Q: Can it use models other than OpenAI?** A: Yes. Any OpenAI-compatible API endpoint works, including local model servers. **Q: Does it run indefinitely?** A: It loops until the task queue is empty or you stop it manually. **Q: What vector databases are supported?** A: Pinecone, Chroma, and Weaviate, with Chroma as the default local option. ## Sources - https://github.com/yoheinakajima/babyagi - https://yoheinakajima.com/birth-of-babyagi/ --- Source: https://tokrepo.com/en/workflows/f3ff673a-3e8b-11f1-9bc6-00163e2b0d79 Author: Script Depot