Documentation
AgentGraph Kit is a production-ready SaaS boilerplate for building AI-powered multi-agent applications. Built with FastAPI (LangGraph Supervisor pattern), Next.js 14, Supabase, and integrated with Clerk authentication and Stripe payments.
Setup Guide
Follow these steps to get your agent application running in minutes.
1. Clone & Configure
git clone https://github.com/your-org/agentgraph-kit.git
cd agentgraph-kit
# Backend
cp backend/.env.example backend/.env
# Frontend
cp frontend/.env.example frontend/.env.local2. Required Environment Variables
You need API keys for the following services:
- OpenAI (LLM & Embeddings)
- Tavily (Web Search)
- Supabase (Database)
- Pinecone (Vector DB)
Agent Architecture
We use the Supervisor Pattern where a central LLM router (GPT-4o) decides which specialized worker to call.
Adding a New Agent
To register a new worker capability:
- Create the agent function in
backend/app/agents/workflow.py - Add the tool definition
- Register the node in the LangGraph workflow:
workflow.add_node("MyNewAgent", create_my_agent())
workflow.add_edge("MyNewAgent", "supervisor")Database Schema
Supabase (PostgreSQL) is used for persistence. The boilerplate includes 3 main tables:
users
| Column | Type | Desc |
|---|---|---|
| id | TEXT | Clerk User ID (PK) |
| credits | INT | Balance |
Tools & RAG
RAG Pipeline
Documents are uploaded, chunked (1000 chars), embedded with text-embedding-3-small, and stored in Pinecone.
Defined Tools
rag_search: Queries Pinecone for similar vectors.tavily_search: Performs live web searches.
Stripe Configuration
Webhooks handle credit top-ups automatically.
Running Locally: Use the Stripe CLI to forward webhooks to localhost:8000/api/webhook/stripe.
# Production Webhook Endpoint https://your-domain.com/api/webhook/stripe