Ever since I started creating content, one question keeps coming up:
How should I structure my Agent projects? 🤔
This cookiecutter is my best attempt to answer that question. It reflects the structure I personally use when building Agent APIs.
Give it a spin, adapt it to your workflow, and let me know how it works for you!
This is how the project structure looks like with this cookiecutter 👇
example-agent-api
├── Dockerfile
├── Makefile
├── README.md
├── data
├── docker-compose.yaml
├── notebooks
├── pyproject.toml
├── src
│ └── example_agent_api
│ ├── __init__.py
│ ├── application
│ │ ├── __init__.py
│ │ ├── chat_service
│ │ ├── evaluation_service
│ │ ├── ingest_documents_service
│ │ └── reset_memory_service
│ ├── config.py
│ ├── domain
│ │ ├── __init__.py
│ │ ├── exceptions.py
│ │ ├── memory
│ │ ├── prompts
│ │ ├── tools
│ │ └── utils.py
│ └── infrastructure
│ ├── __init__.py
│ ├── api
│ │ ├── __init__.py
│ │ ├── main.py
│ │ └── models.py
│ ├── db
│ ├── llm_providers
│ ├── mcp_clients
│ └── monitoring
├── static
└── tests
├── __init__.py
├── conftest.py
└── test_example_agent_api.py
|
Join The Neural Maze and learn to build AI Systems that actually work, from principles to production. Every Wednesday, directly to your inbox. Don't miss out! |
A cookiecutter makes it really easy to create a new project. You just need to have Cookiecutter installed.
pip install -U cookiecutter
Next, you can use the cookiecutter to spin up a new project:
cookiecutter https://github.com/neural-maze/agent-api-cookiecutter.git
After this, you'll be asked to fill in a few details about your project ... and that's it!
If you're curious about the folder structure, and what each file and folder is for, you can check my video post on Substack.
[TODO: Add link to the video post]
In this section, I'll share a few sample projects built with this cookiecutter, so you can see practical examples of how it can be applied.
(👷♂️ WIP 👷♂️)
![]() |
Miguel Otero Pedrido | Senior ML / AI Engineer Founder of The Neural Maze. Rick and Morty fan. YouTube The Neural Maze Newsletter |
This project is licensed under the MIT License. See the LICENSE file for details.