Skip to content
imthi16Public

About

Avanam (meaning "arena" or "stage") is a high-performance, full-stack Document Intelligence Platform. It leverages a state-of-the-art Multi-Agent RAG (Retrieval-Augmented Generation) pipeline to not just retrieve information, but to actively synthesize, fact-check, and format insights from your documents.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

ย 

History

15 Commits

Folders and files

Repository files navigation

๐Ÿ›๏ธ Avanam

A Production-Ready Multi-Agent RAG Document Intelligence Platform

FastAPI LangGraph FAISS React Docker

Avanam demo โ€” a query runs through the agent pipeline, the Critic sends the draft back for revision, and the final answer arrives with citations and an 86% confidence seal

A query runs the full pipeline: the Critic scores the first draft 0.61 and sends it back, the revised answer passes at 86%, and gets stamped with its sources.

๐Ÿ“– Overview

Avanam (เฎ†เฎตเฎฃเฎฎเฏ โ€” Tamil for "document" or "record") is a high-performance, full-stack Document Intelligence Platform. It leverages a state-of-the-art Multi-Agent RAG (Retrieval-Augmented Generation) pipeline to not just retrieve information, but to actively synthesize, fact-check, and format insights from your documents.

Built as a demonstration of modern AI engineering, Avanam features a live-streaming agent visualization UI, allowing users to watch AI agents collaborate, debate, and revise their work in real-time.

The best part? The entire stack is architected to run 100% locally at $0 cost with zero cloud dependencies, utilizing Ollama with llama3.2:3b for LLM inference, local HuggingFace embeddings, and PostgreSQL.

โœจ Key Features

  • ๐Ÿค– 4-Agent LangGraph Pipeline: A cyclic workflow featuring a Retriever, Analyst, Critic, and Formatter.
  • ๐Ÿ”„ Autonomous Revision Loops: The Critic agent scores the Analyst's work. If confidence falls below 70%, the work is kicked back for revision automatically.
  • โšก Live Agent Telemetry: An advanced React frontend consumes Server-Sent Events (SSE) to visualize exact agent states, progress bars, and intermediate outputs in real-time.
  • ๐Ÿ—„๏ธ Zero-Cost Local RAG: Uses sentence-transformers/all-MiniLM-L6-v2 running locally and FAISS (Facebook AI Similarity Search) for blazingly fast vector retrieval without API costs.
  • ๐Ÿ“„ Multi-Format Ingestion: Drag-and-drop support for PDF, DOCX, TXT, and Markdown files with automatic chunking and indexing.
  • ๐Ÿ“Š Analytics Dashboard: Tracks query latency, average agent confidence scores, and vector database health.
  • ๐Ÿณ Production-Ready Infra: Fully containerized with Docker Compose, multi-stage Vite/Nginx frontend builds, structured JSON logging (structlog), and automated GitHub Actions CI/CD.

๐Ÿ“ธ Screenshots

The UI is designed as "The Records Office" โ€” a registry for your documents. Answers that pass the Critic's fact-check are stamped with a vermilion confidence seal; anything below the 70% threshold is sent back for revision.

Chat home โ€” Every answer, on the record Chat home: ask a question or start from a suggested query.

Live agent pipeline with a revision loop in progress Live agent telemetry: the Critic scored the draft 0.61 and sent it back to the Analyst for revision.

A verified answer with citations and the confidence seal The finished record: a cited answer stamped VERIFIED at 86% confidence, revised once.

Document registry

Document registry: drag-and-drop ingestion with per-file chunk counts.

Query ledger dashboard

Query ledger: latency, confidence, and revision history per query.


๐Ÿง  System Architecture

graph TD
    subgraph Frontend [React TypeScript UI]
        UI[Chat Interface]
        Viz[Agent Progress Visualizer]
    end

    subgraph Backend [FastAPI Backend]
        API[REST & SSE Endpoints]
        DB[(PostgreSQL)]
        
        subgraph LangGraph [LangGraph Multi-Agent Pipeline]
            R[๐Ÿ” Retriever Node]
            A[๐Ÿ“Š Analyst Node]
            C[๐Ÿงช Critic Node]
            F[๐Ÿ“ Formatter Node]
            
            R --> A
            A --> C
            C -- "Score < 0.7" --> A
            C -- "Score >= 0.7" --> F
        end
        
        VS[(FAISS Vector Store)]
        Embed[HuggingFace Embeddings]
    end

    UI -- "Query" --> API
    API -- "Init" --> LangGraph
    LangGraph -- "Real-time SSE Events" --> Viz
    R <--> Embed
    R <--> VS
    API <--> DB
Loading

๐Ÿ› ๏ธ Technology Stack

Backend

  • Framework: FastAPI, Uvicorn
  • AI Orchestration: LangGraph, LangChain
  • LLM: Ollama (llama3.2:3b by default โ€” runs fully local; see backend/.env.example for alternatives)
  • Embeddings: HuggingFace all-MiniLM-L6-v2
  • Vector Store: FAISS (CPU)
  • Database & ORM: PostgreSQL, SQLAlchemy (asyncpg)
  • Streaming: Server-Sent Events (sse-starlette)

Frontend

  • Framework: React 19, TypeScript, Vite
  • State Management: Zustand
  • Animations: Framer Motion
  • Styling: Custom CSS design system ("The Records Office" โ€” ledger greens, record paper, and a vermilion confidence seal)
  • Markdown: react-markdown, remark-gfm

DevOps

  • Containerization: Docker, Docker Compose
  • Web Server: Nginx (Alpine)
  • CI/CD: GitHub Actions (Automated Linting & Pytest)

๐Ÿš€ Getting Started

Prerequisites

  • Docker and Docker Compose
  • At least 8GB RAM available for the Ollama LLM model
  • No API keys needed โ€” everything runs locally!

Installation

  1. Clone the repository

    git clone https://github.com/imthi16/Avanam.git
    cd Avanam
  2. Configure Environment Variables (optional) The stack runs out-of-the-box with sane defaults โ€” no API keys required. To customize (model, thresholds, ports), copy the example file:

    cp backend/.env.example backend/.env
  3. Start the Application Spin up the entire stack using Docker Compose:

    docker compose up --build -d     # or: make up

    (Note: The first run will automatically pull the llama3.2:3b model (~2GB) and the HuggingFace embedding model. This may take several minutes depending on your internet speed.)

  4. Access the Platform


๐Ÿ•ต๏ธ How the Multi-Agent Pipeline Works

Avanam moves beyond simple "Retrieval Augmented Generation" by employing a team of specialized agents:

  1. ๐Ÿ” Retriever Agent: Translates the user's query into a vector representation and searches the FAISS index for the top-5 most relevant document chunks.
  2. ๐Ÿ“Š Analyst Agent: Synthesizes the retrieved chunks into a comprehensive answer, carefully mapping every statement back to a specific source citation. It also extracts a structured list of its core "claims".
  3. ๐Ÿงช Critic Agent: The quality-assurance engine. It takes the Analyst's claims and cross-references them against the original source text to check for hallucinations. It outputs a Confidence Score (0.0 to 1.0). If the score is below 0.7, it triggers a Revision Loop, sending actionable feedback back to the Analyst.
  4. ๐Ÿ“ Formatter Agent: Takes the final, approved analysis and formats it into a highly readable Markdown response, appending interactive source citations.

๐Ÿ“ Project Structure

โ”œโ”€โ”€ backend/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ agents/          # LangGraph Nodes (router, retriever, analyst, critic, formatter)
โ”‚   โ”‚   โ”œโ”€โ”€ api/             # FastAPI Routes (query, documents, health)
โ”‚   โ”‚   โ”œโ”€โ”€ core/            # Database, LLM client, Event Bus (SSE), Structured Logger
โ”‚   โ”‚   โ”œโ”€โ”€ models/          # SQLAlchemy ORM and Pydantic schemas
โ”‚   โ”‚   โ””โ”€โ”€ services/        # FAISS Vector Store, Document Chunking, HuggingFace
โ”‚   โ”œโ”€โ”€ alembic/             # Database migrations (applied automatically on startup)
โ”‚   โ”œโ”€โ”€ tests/               # Pytest suite
โ”‚   โ”œโ”€โ”€ pyproject.toml       # Tooling config (ruff, black, pytest)
โ”‚   โ””โ”€โ”€ Dockerfile           # Non-root image with migration entrypoint
โ”œโ”€โ”€ frontend/
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/      # React components (AgentProgress, Chat, Documents, Dashboard)
โ”‚   โ”‚   โ”œโ”€โ”€ hooks/           # useSSE (Streaming event parser)
โ”‚   โ”‚   โ”œโ”€โ”€ services/        # API Client
โ”‚   โ”‚   โ”œโ”€โ”€ store/           # Zustand global state
โ”‚   โ”‚   โ””โ”€โ”€ index.css        # Premium Design System
โ”‚   โ””โ”€โ”€ nginx.conf           # Nginx reverse proxy configuration
โ”œโ”€โ”€ scripts/                 # Manual smoke tests against a running stack
โ”œโ”€โ”€ docker-compose.yml       # Multi-container orchestration
โ”œโ”€โ”€ Makefile                 # Common dev tasks (make help)
โ””โ”€โ”€ .github/workflows/       # CI/CD Pipelines

๐Ÿง‘โ€๐Ÿ’ป Development

make help          # list all targets
make up            # build + start the Docker stack
make test          # backend test suite
make lint          # ruff + black + eslint (same checks as CI)
make format        # auto-format the backend
make smoke         # upload a doc + run a query against a running stack

For local (non-Docker) backend development, install deps with pip install -r backend/requirements-dev.txt, start Postgres/Redis/Ollama (e.g. docker compose up postgres redis ollama -d), then make backend-dev.

Optional: pip install pre-commit && pre-commit install to run the linters on every commit.


๐Ÿ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.

Built with โค๏ธ for modern AI engineering.

About

Avanam (meaning "arena" or "stage") is a high-performance, full-stack Document Intelligence Platform. It leverages a state-of-the-art Multi-Agent RAG (Retrieval-Augmented Generation) pipeline to not just retrieve information, but to actively synthesize, fact-check, and format insights from your documents.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages