A robust, production-ready application for serving Agents as an API.
Clone the repo
Export your OpenAI key
Start the application
Test the application
localhost:8000
.localhost:5432
.http://localhost:8000
as a new endpoint. You can name it Agent API
(or any name you prefer).Stop the application
agent-api
folder contains the following structure:
/agents
folder contains pre-built agents that you can use as a starting point.
agno_assist
knowledge base before using this agent.Modify pyproject.toml
[tool.poetry.dependencies]
section of the pyproject.toml
file.Generate requirements.txt
requirements.txt
file is used to build the application image. After modifying pyproject.toml
, regenerate requirements.txt
using:Rebuild Docker Images
Dockerfile
for building a production-ready container image of the application.
The general process to run in production is:
scripts/build_image.sh
file and set your IMAGE_NAME
and IMAGE_TAG
variables.OPENAI_API_KEY
, database connection strings) are securely managed. Most cloud providers offer a way to set these as environment variables for your deployed service./agents
directory and ensure they are set up for your production needs (e.g., correct model versions, any production-specific settings).scripts/build_image.sh
script to set your desired IMAGE_NAME
and IMAGE_TAG
(e.g., your-repo/agent-api:v1.0.0
).
Run the script to build and push the image:
8000
by default), environment variables, scaling, and database connections.
docker-compose.yml
sets up a PostgreSQL database for local development. In production, use a managed database service (e.g., AWS RDS, Google Cloud SQL, Azure Database for PostgreSQL).
Ensure your deployed application is configured with the correct database connection URL for your production database, usually via environment variables.