Skip to content
beginner 15 min

RAG Chatbot with Vector Store

From zero to a production RAG chatbot in 15 minutes — choose your vector store, ingest documents, chat

ragchatbotvector-storedocuments

The Problem

Building a RAG chatbot requires choosing and configuring a vector store, setting up document ingestion, implementing similarity search, and connecting it all to a chat interface with streaming — dozens of decisions before you write any AI logic.

The Solution

The Full-Stack AI Agent Template generates a complete RAG pipeline with your choice of vector store (Milvus, Qdrant, ChromaDB, pgvector), document ingestion (PDF, Google Drive, S3, 130+ formats via LlamaParse), and a Next.js chat UI with WebSocket streaming — all in one command.

Working Code

rag.py
# Generated by: fastapi-fullstack new --preset ai-agent
# backend/app/agent/rag.py
from pydantic_ai import Agent
from app.core.vectorstore import get_vector_store
from app.core.config import settings
agent = Agent(
model=settings.LLM_MODEL,
system_prompt="Answer questions using the provided context. Cite sources.",
)
@agent.tool
async def search_documents(ctx, query: str, top_k: int = 5) -> str:
"""Search the knowledge base for relevant documents."""
store = get_vector_store() # Milvus, Qdrant, ChromaDB, or pgvector
results = await store.similarity_search(query, k=top_k)
return "\n\n".join([f"[{r.metadata['source']}]: {r.page_content}" for r in results])

Step by Step

1

Choose your stack (configurator)

Run the CLI configurator or use the web-based interactive tool to select your vector store, document sources, LLM provider, and deployment options. The template supports 75+ configuration options.

2

Ingest documents

Upload PDFs, connect Google Drive, or point to an S3 bucket. The template handles chunking, embedding, and indexing in your chosen vector store automatically.

3

Chat with your data

Open the Next.js chat interface with real-time WebSocket streaming. Ask questions about your documents and get cited answers with source references.

4

Deploy with Docker

Run `docker compose up` to start the complete stack: FastAPI backend, Next.js frontend, vector store, and PostgreSQL — all pre-configured and ready for production.

Ready to build this?

Get started with Vstorm's open-source tools — production-tested, fully documented, and free.

Get Started

Ready to build your first production AI agent?

Open-source tools, battle-tested patterns, zero boilerplate. Configure your stack and ship in minutes — not months.