Skip to content

A minimal FastAPI app that demonstrates how to run multi-agent, multi-database workflows using Vanna

Notifications You must be signed in to change notification settings

vanna-ai/multi-agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vanna Multi-Agent Query Router

A minimal FastAPI app that demonstrates how to run multi-agent, multi-database workflows using Vanna.

📹 Demo Video

Watch the video walkthrough here:

Watch the demo

✨ What it does

  • 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

🤖 Why it's useful

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

🧠 Key idea: background prompt

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

🚀 Deploy to Cloud Run

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

🧪 Example Request

POST /query
{
  "start_agent": "agent_1",
  "query": "show me the top users by engagement"
}

🗂 Files

  • main.py: Main FastAPI app
  • requirements.txt: Dependencies
  • Dockerfile: For containerizing
  • .dockerignore: For cleaner builds
  • .env.example: Example environment config
  • openapi.yaml: OpenAPI spec for GPT tool use

Let us know if you'd like to contribute or extend this to other Vanna agent workflows!

About

A minimal FastAPI app that demonstrates how to run multi-agent, multi-database workflows using Vanna

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published