使用说明
AgentFlow
A ChatGPT-style chat app where every prompt gets its own crew of agents. An orchestrator reads your message, designs the smallest crew that can handle it, runs it with CrewAI, and the UI shows which agents were created alongside the answer.
One FastAPI process, one SQLite file. No Docker, no other infrastructure.
Quick start
Requires Python 3.10+ and a local Ollama (or any API key LiteLLM supports).
# LLM — local and free
curl -fsSL https://ollama.com/install.sh | sh
ollama pull qwen2.5:7b
# app
cp .env.example .env
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app
Open http://localhost:8000 and type. API docs are at /docs.
On CPU, a reply takes a minute or two — every reply is at least two LLM calls (plan, then answer). For fast replies, point .env at a hosted provider, e.g. LLM_MODEL=groq/llama-3.3-70b-versatile with GROQ_API_KEY set. Nothing else changes.
How it works
One LLM call plans the crew: agents (role, goal, backstory) and their tasks, returned as JSON. The app builds them as CrewAI agents, runs the tasks in sequence, and the last task's output is the answer. Simple questions get one agent; a request like "research X, then write Y" gets a researcher and a writer. If the plan comes back as unusable JSON, a single fallback generalist answers instead, so the user always gets a reply.
Follow-ups work because the last MEMORY_WINDOW messages are passed to the planner and to the first task. Conversations and messages live in a SQLite file, with the crew plan stored next to each answer.
Configuration
| Variable | Default | Purpose |
|---|---|---|
LLM_MODEL |
ollama/qwen2.5:7b |
Any LiteLLM model string |
OLLAMA_BASE_URL |
http://localhost:11434 |
Only used for ollama/… models |
DB_PATH |
agentflow.db |
SQLite file location |
MEMORY_WINDOW |
12 |
Messages of history the crew sees |
MAX_AGENTS |
3 |
Cap on agents the planner may create |