RAG AI Agent Backend
A minimal FastAPI backend that demonstrates retrieval-augmented generation with vector similarity search, built for learning and for wiring into a frontend.
RAG AI Agent Backend is a FastAPI backend demonstrating retrieval-augmented generation (RAG) with vector similarity search, built for educational use and for integration with a frontend such as Next.js.
It uses Supabase and its pgvector extension for vector similarity search, supports both OpenAI and Anthropic as model providers, generates vector embeddings for semantic search, and returns citation-based answers with source tracking. The backend is organized into infrastructure, Pydantic data models, and RAG and embedding services, with a SQL script for initializing the Supabase database.
Setup involves creating a Python virtual environment, installing dependencies, and configuring a Supabase project along with OpenAI and Anthropic API keys; the project also runs in Docker. It is presented alongside a full video walkthrough of building and launching it.