Skip to content

Repository files navigation

Limitless

high-performance RAG Pipeline for PDFs

Python FastAPI React

Eval Score CI

Upload any PDF. Ask anything. Get cited, accurate answers in real time.


What it does

Limitless is a full-stack Retrieval-Augmented Generation (RAG) system. Drop in any PDF, and the system parses, chunks, and embeds it locally. You then chat with it through a streaming UI backed by Groq's LPU inference β€” the fastest available LLM API.

v2 goes further: hybrid keyword+vector search, a cross-encoder re-ranker, an AI agent with live web search, multi-document querying, auto-summaries, persistent memory, and citation highlights β€” all backed by an automated evaluation pipeline.


πŸ–₯️ Application Interface

Limitless Neural Cognitive RAG Interface
Neural Cognitive RAG Workspace: Interactive hybrid retrieval tuner (Dense 0.70 / Sparse 0.30 @ 18ms) and Groq LPU inference controller.

Limitless Corpus Management Hub
Corpus Management Drawer: Multi-document ingestion library, PDF vectorization pipeline, and document store status.


Features

Feature Description
Hybrid Search BM25 keyword + Pinecone vector search fused via Reciprocal Rank Fusion
Cross-Encoder Re-ranking ms-marco-MiniLM-L-6-v2 re-ranks 15 candidates to top 5
Agent Mode ReAct agent with document search, live web search, and math tools
Multi-Document Search Query across all uploaded PDFs simultaneously
AI Summaries Auto 3-bullet summary generated on every upload
Persistent Memory SQLite-backed conversation history survives page reloads
Citation Highlights Expand any source chip to see the full retrieved passage
Model Fallback Auto-switches llama-70b β†’ llama-8b β†’ gemma2 on rate limits
RAG Evaluation Automated 10-question benchmark pipeline (current: 80%)
Streaming Token-by-token streaming via Server-Sent Events

Tech Stack

Layer Technology
Frontend Vite 5, React 18, TypeScript, Tailwind CSS, Zustand
Backend FastAPI, Uvicorn, Python 3.11, aiosqlite
LLM Groq Cloud llama-3.3-70b-versatile (LPU inference)
Embeddings HuggingFace all-MiniLM-L6-v2 (runs locally, free)
Vector DB Pinecone serverless (384-dim, cosine)
Keyword Search rank-bm25 local index per document
Re-ranking cross-encoder/ms-marco-MiniLM-L-6-v2
Agent LangChain ReAct + DuckDuckGo Search
Metadata DB SQLite via aiosqlite

Prerequisites


Installation

Option A β€” One-click launcher (recommended)

# macOS / Linux
git clone https://github.com/Ares19v/limitless.git
cd limitless
chmod +x start.sh && ./start.sh
# Windows
git clone https://github.com/Ares19v/limitless.git
cd limitless
INSTALL.bat        :: First-time setup (run once)
Run_Project.bat    :: Start the app

The launcher automatically:

  1. Creates a Python virtual environment
  2. Installs all backend dependencies (CPU-only torch)
  3. Installs frontend npm packages
  4. Copies .env.example β†’ .env and prompts for API keys
  5. Starts both servers and opens the browser

Windows scripts:

  • INSTALL.bat β€” First-time setup (run once)
  • Run_Project.bat β€” Start both servers and open the browser
  • UNINSTALL.bat β€” Remove local installation artifacts

Option B β€” Docker (no Python/Node required)

git clone https://github.com/Ares19v/limitless.git
cd limitless
cp backend/.env.example backend/.env   # Fill in your API keys
docker compose up --build

Open http://localhost β€” the frontend proxies API calls to the backend automatically.


Option B β€” Manual setup

1. Clone the repo

git clone https://github.com/Ares19v/limitless.git
cd limitless

2. Backend setup

cd backend

# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Copy environment file
cp .env.example .env

3. Configure environment variables

Edit backend/.env:

# Groq β€” pre-filled, works immediately
GROQ_API_KEY=gsk_...

# Optional: add more keys to rotate across on rate limits
GROQ_API_KEY_POOL=key1,key2,key3,key4

# Pinecone β€” required
PINECONE_API_KEY=your_key_here
PINECONE_INDEX_NAME=documind

Getting your Pinecone key (2 minutes):

  1. pinecone.io β†’ Sign Up β†’ Dashboard β†’ Create Index
    • Name: documind Β· Dimensions: 384 Β· Metric: cosine Β· Cloud: AWS us-east-1
  2. Dashboard β†’ API Keys β†’ copy key β†’ paste into .env

βœ… No OpenAI key needed. Embeddings run locally via HuggingFace (~90 MB, downloaded once on first run).

4. Start the backend

cd backend
PYTHONPATH=. .venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

5. Frontend setup

cd frontend
npm install
npm run dev

Open http://localhost:5173


Usage

  1. Upload β€” drag a PDF onto the upload zone (max 50 MB)
  2. Wait β€” status shows Processing β†’ Ready (usually under 10 seconds)
  3. Chat β€” type any question; the answer streams in real time with page citations
  4. Expand sources β€” click any source chip to read the exact retrieved passage
  5. Agent mode β€” toggle ⚑ Agent to enable live web search and math tools
  6. All Docs β€” toggle 🌐 to search across every uploaded document at once

API Reference

All endpoints are documented interactively at http://localhost:8000/docs

Method Endpoint Description
GET /health Health check
POST /api/v1/upload Upload a PDF
GET /api/v1/documents List all documents
GET /api/v1/documents/{id} Get document + AI summary
DELETE /api/v1/documents/{id} Delete doc, vectors, index, history
POST /api/v1/chat/{id} Standard RAG chat (SSE stream)
POST /api/v1/chat/global Cross-document search (SSE stream)
POST /api/v1/agent/{id} Agent mode with tools (SSE stream)
GET /api/v1/history/{id} Get conversation history
DELETE /api/v1/history/{id} Clear conversation history

Running Tests

Backend unit tests

cd backend
PYTHONPATH=. .venv/bin/pytest tests/ -v --cov=app --cov-report=term-missing

RAG Evaluation Pipeline

cd backend
PYTHONPATH=. .venv/bin/python scripts/eval.py ../your_document.pdf

Current benchmark score: 8/10 (80%) β€” see EVALUATION_REPORT.md for full analysis.


Project Structure

limitless/
β”œβ”€β”€ .github/workflows/
β”‚   └── ci.yml               # GitHub Actions CI (backend + frontend)
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/routes/          # upload, chat, global_chat, agent_chat, documents, history
β”‚   β”‚   β”œβ”€β”€ core/                # config (pydantic-settings), structured logging
β”‚   β”‚   β”œβ”€β”€ models/              # Pydantic request/response schemas
β”‚   β”‚   β”œβ”€β”€ services/
β”‚   β”‚   β”‚   β”œβ”€β”€ agent.py         # LangChain ReAct agent (3 tools)
β”‚   β”‚   β”‚   β”œβ”€β”€ bm25_store.py    # Local BM25 keyword index
β”‚   β”‚   β”‚   β”œβ”€β”€ document_store.py# SQLite (documents + chat history)
β”‚   β”‚   β”‚   β”œβ”€β”€ embeddings.py    # HuggingFace local embeddings
β”‚   β”‚   β”‚   β”œβ”€β”€ key_manager.py   # Groq key pool + model fallback
β”‚   β”‚   β”‚   β”œβ”€β”€ pdf_processor.py # PDF parsing + chunking
β”‚   β”‚   β”‚   β”œβ”€β”€ rag_chain.py     # Full v2 pipeline + summaries
β”‚   β”‚   β”‚   β”œβ”€β”€ reranker.py      # Cross-encoder re-ranker
β”‚   β”‚   β”‚   └── vector_store.py  # Pinecone + hybrid search + RRF
β”‚   β”‚   └── utils/
β”‚   β”œβ”€β”€ scripts/
β”‚   β”‚   └── eval.py              # Automated RAG benchmark
β”‚   β”œβ”€β”€ tests/                   # Pytest test suite
β”‚   β”œβ”€β”€ Dockerfile
β”‚   β”œβ”€β”€ .env.example
β”‚   └── requirements.txt
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ ChatWindow/      # Agent mode, Global mode, citation drawer
β”‚   β”‚   β”‚   β”œβ”€β”€ FileUpload/
β”‚   β”‚   β”‚   β”œβ”€β”€ Layout/
β”‚   β”‚   β”‚   └── Sidebar/         # AI summary panel
β”‚   β”‚   β”œβ”€β”€ hooks/               # useChat, useUpload, useDocuments
β”‚   β”‚   β”œβ”€β”€ lib/                 # API client
β”‚   β”‚   β”œβ”€β”€ store/               # Zustand global state
β”‚   β”‚   └── types/               # TypeScript interfaces
β”‚   β”œβ”€β”€ Dockerfile
β”‚   └── package.json
β”‚
β”œβ”€β”€ docker-compose.yml           # Full stack with Docker
β”œβ”€β”€ INSTALL.bat                  # Windows first-time setup
β”œβ”€β”€ Run_Project.bat              # Windows launcher
β”œβ”€β”€ UNINSTALL.bat                # Windows cleanup
β”œβ”€β”€ start.sh                     # macOS/Linux one-click launcher
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ EVALUATION_REPORT.md
β”œβ”€β”€ LICENSE
└── README.md

Environment Variables

backend/.env

Variable Required Default Description
GROQ_API_KEY βœ… pre-filled Primary Groq API key
GROQ_API_KEY_POOL β€” Comma-separated keys for rotation
PINECONE_API_KEY βœ… β€” Pinecone API key
PINECONE_INDEX_NAME documind Pinecone index name
LLM_MODEL llama-3.3-70b-versatile Primary Groq model
EMBEDDING_MODEL all-MiniLM-L6-v2 Local embedding model
CHUNK_SIZE 1000 Characters per PDF chunk
CHUNK_OVERLAP 200 Overlap between chunks
TOP_K_RESULTS 5 Final results after re-ranking
MAX_UPLOAD_SIZE_MB 50 Max PDF size
ALLOWED_ORIGINS http://localhost:5173 CORS origins

frontend/.env

Variable Default Description
VITE_API_BASE_URL http://localhost:8000 Backend URL

Contributing

Pull requests are welcome. For major changes, please open an issue first.

# Fork β†’ clone β†’ create branch
git checkout -b feat/your-feature

# Make changes, then
git commit -m "feat: your feature description"
git push origin feat/your-feature
# Open PR

Β© 2026 Devansh Tyagi (Ares19v). All Rights Reserved.

About

RAG pipeline with hybrid BM25 + vector search, cross-encoder re-ranking, and ReAct agent mode. Supports multi-document querying, streaming responses, and persistent memory. Evaluated at 80% on benchmark.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages