All Projects
Open Source 2026

Generic RAG

A Retrieval-Augmented Generation (RAG) template that serves as a foundation for building document-based AI applications. Supports document indexing, semantic search, and contextual answer generation.

Python AI RAG LLM Vector DB

Overview

Generic RAG is a full-stack AI assistant with a production-grade RAG pipeline, a ReAct agent, and human-in-the-loop tool approval - built to be provider-agnostic and extensible without touching frontend code.

Core: Knowledge Base & RAG

  • Ingest text (paste), PDF, .txt, .md - auto chunked, embedded, and stored to ChromaDB
  • Vector search with relevance threshold (score > 0.6) for precision retrieval
  • Source citation - every answer includes the document chunks used as references
  • Knowledge management - list, delete documents; reindex when switching embedding provider

Chat & Agent

  • Streaming responses token-by-token via SSE (Server-Sent Events) - low perceived latency
  • Thinking tokens - Gemini 2.5 reasoning process shown in a collapsible section
  • ReAct agent via LangGraph - uses tools, reasons, then answers
  • Human-in-the-loop tool approval - user can approve, reject, or edit args before the agent executes any tool
  • General knowledge badge - warning shown when the answer comes from LLM training data instead of the knowledge base

Multi-User & Audit Trail

  • Multi-user support - identity via request header, chat state isolated per user (Zustand)
  • Audit trail - every tool call logged: who, which tool, AI args vs user-edited args, approved/rejected
  • Filterable audit log - filter by username, tool name, and date range

Anti Vendor Lock-in

  • Switchable LLM - OpenAI (GPT-4o) or Google Gemini via env var
  • Switchable embeddings - Google or OpenAI, independent of LLM provider
  • Dynamic tool registry - add a new tool in config → automatically appears in UI, no frontend changes needed

Available Agent Tools

ToolTypeFunction
search_knowledgeStatic (built-in)Vector search over the knowledge base (ChromaDB)
search_webStatic (built-in)Real-time web search - returns human-readable + structured JSON
send_notificationDynamic (microservice)Send notification to a recipient (email or username)
get_random_numberDynamic (microservice)Generate random number with customizable min–max range
manage_taskDynamic (microservice)CRUD tasks - create, update, delete, list; supports nested arrays and objects

Static tools are defined as Python classes. Dynamic tools only need an entry in microservices.json - no backend or frontend code changes required. Every tool call goes through human-in-the-loop approval, and all decisions are recorded in the audit trail.

Tech Stack

  • Backend: Python, FastAPI, LangChain, LangGraph
  • Vector Store: ChromaDB (local, persistent)
  • Frontend: React 18, TypeScript, Vite, Tailwind CSS v4
  • Audit DB: SQLite via SQLAlchemy (migratable to PostgreSQL)