A minimal FastAPI app that demonstrates how to run multi-agent, multi-database workflows using Vanna.
Watch the video walkthrough here:
- Takes a natural language query and a
start_agent
("agent_1" or "agent_2") - Calls the first agent and enforces a consistent output using a standardized background prompt
- Extracts a shared identifier (
email
) from the first agent's output - Uses those emails to query the second agent
- Returns both steps in the response
LLMs are inconsistent without structure. This app shows how to:
- Standardize agent outputs using a background prompt (
email
column) - Chain LLM-based agents across different data sources
- Ensure reproducible, structured multi-agent workflows
Both agents get a custom instruction + a shared standardization prompt like:
Always include a column named 'email' that uniquely identifies a user.
This ensures that:
- Output from one agent is reliably usable by the other
- The interface between agents is stable and predictable
gcloud builds submit --tag gcr.io/YOUR_PROJECT_ID/vanna-multi-agent
gcloud run deploy vanna-multi-agent \
--image gcr.io/YOUR_PROJECT_ID/vanna-multi-agent \
--platform managed \
--region us-central1 \
--allow-unauthenticated \
--set-env-vars VANNA_API_KEY=your-api-key USER_EMAIL=your-email@example.com
POST /query
{
"start_agent": "agent_1",
"query": "show me the top users by engagement"
}
main.py
: Main FastAPI apprequirements.txt
: DependenciesDockerfile
: For containerizing.dockerignore
: For cleaner builds.env.example
: Example environment configopenapi.yaml
: OpenAPI spec for GPT tool use
Let us know if you'd like to contribute or extend this to other Vanna agent workflows!