This repository contains an implementation of agentic patterns such as Planning (ReAct flow), Reflection, and Multi-Agent workflows. It showcases advanced agent orchestration with APIs and tools.
- Follow this repo to learn more about multi-agent patterns: agentic_patterns
- Follow this repo to learn more about multi-agent orchestrator: multi-agent-orchestrator
multi-agent/
│
├── api/ # API logic
│ ├── routers/ # API routers
│ └── services/ # Service logic
│ └── agent.py # Main agent services
│
├── docker/ # Docker setup
│ ├── Dockerfile.backend # Backend Dockerfile
│ └── Dockerfile.frontend # Frontend Dockerfile
│
├── src/ # Source code
│ ├── agents/ # Agent-specific implementations
│ └── tests/ # Test files
│ ├── agent_test.py # Tests for agents
│ └── llm_test.py # Tests for LLM functions
│
├── tools/ # Utility tools
├── utils/ # Configuration and helper functions
│ ├── config.py # Configuration settings
│ └── prompt.py # Prompt definitions
│
├── venv/ # Virtual environment
├── app_fastapi.py # FastAPI app
├── app_streamlit.py # Streamlit app for UI
├── docker-compose.yaml # Docker Compose setup
├── .env.example # Environment variable template
├── requirements.txt # Python dependencies
└── README.md # Project documentation
git clone https://github.com/buithanhdam/multi-agent.git
cd multi-agent
- For Unix/macOS:
python3 -m venv venv source venv/bin/activate
- For Windows:
python -m venv venv .\venv\Scripts\activate
pip install -r requirements.txt
Copy the .env.example
file to a new .env
file and update the API keys:
cp .env.example .env
Add the following keys:
GOOGLE_API_KEY=your_google_api_key
OPENAI_API_KEY=your_openai_api_key
ANTHROPIC_API_KEY=your_anthropic_api_key
- Run the test suite using
pytest
:
pytest src/tests/
- Or if you dont want to use
pytest
then runpython
cmd:
python3 src/tests/llm_test.py
python3 src/tests/agent_test.py
uvicorn app_fastapi:app --host 0.0.0.0 --port 8000 --reload
- Access the API at:
http://127.0.0.1:8000
streamlit run app_streamlit.py --server.port=8501 --server.address=0.0.0.0
- Access the frontend UI at:
http://localhost:8501
- If you dont have
docker-compose
usedocker compose
instead
docker-compose build
docker-compose up
- The backend will be available at
http://localhost:8000
. - The frontend will be available at
http://localhost:8501
.
To stop the running containers, press Ctrl+C
or run:
docker-compose down
Feel free to open an issue or submit a pull request to improve this project.
This project is licensed under the MIT License.