Agent API: FastAPI and Postgres
The Agent API workspace provides a simple RestAPI + database for serving agents. It contains:
- A FastAPI server for serving Agents, Teams and Workflows.
- A postgres database for session and vector storage.
Setup
Create and activate a virtual environment
Install Agno
Install uv and docker
Export your OpenAI key
Agno works with any model provider, just need to update the agents in the workspace.
Create your Agent API codebase
Create your codebase using the agent-api
template, give it any name you like.
This will create a folder agent-api
with the following structure:
Run your Agent Api locally
cd
into the agent-api
folder
Start your Agent Api using the following command:
Press Enter to confirm and give a few seconds for the image to download (only the first time). Verify container status and view logs on the docker dashboard.
- Open localhost:8000/docs to view the FastAPI routes.
Notes:
- The
Agents
are defined in theagents
folder. - The api routes are defined in the
api
folder.
Stop local workspace
Play around and stop the workspace using:
Next
Congratulations on running your Agent API locally. Next Steps:
- Run your Agent API on AWS
- Read how to update workspace settings
- Read how to create a git repository for your workspace
- Read how to manage the development application
- Read how to format and validate your code
- Read how to add python libraries
- Chat with us on discord