Skip to content

Latest commit

 

History

50 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚡ GalvanR.A.G

Version FastAPI LangChain Ollama Python Docker License

Self-hosted, fully local RAG pipeline. Upload docs. Get cited answers. Zero API keys, zero token costs.

Quickstart · Setup Wizard · API Docs · Evaluation


What is GalvanR.A.G?

GalvanR.A.G is a local-first Retrieval-Augmented Generation (RAG) engine — a free, unlimited NotebookLM-style tool that runs entirely on your own machine.

Upload PDFs or documents → ask questions in natural language → get answers backed by source citations. Everything — the LLM, the embeddings, the vector store — runs locally through Ollama. No API keys, no per-token cost, no internet dependency once set up, and your documents never leave your device.

A built-in RAGAS evaluation dashboard scores your pipeline on faithfulness, relevancy, and context recall — judged by your own local model.

URL ingestion is not supported yet — PDFs, research papers, and text documents only, for now.


Stack

Layer Technology
API FastAPI
Orchestration LangChain
LLM Ollama — pick any model your hardware supports
Vector Store ChromaDB (local)
Metadata DB PostgreSQL
Embeddings Sentence Transformers (local)
Evaluation RAGAS, judged locally by Ollama
Demo UI Streamlit
Setup Wizard Next.js (guided onboarding)
Local Launcher Python
Infra Docker + GitHub Actions

Architecture

graph LR
    subgraph IN["Ingestion"]
        PDF[PDF] & TXT[TXT]
    end
    subgraph PROC["Processing"]
        CHUNK[Chunker] --> EMBED[Embedder]
    end
    subgraph STORE["Storage"]
        CV[(ChromaDB)] & PG[(PostgreSQL)]
    end
    subgraph QUERY["Query"]
        HS[Hybrid Search] --> LLM[Ollama LLM]
        MEM[Memory] --> LLM
    end
    subgraph OUT["Output"]
        ANS[Answer + Citations]
        EVAL[RAGAS Dashboard]
    end

    IN --> PROC --> STORE --> QUERY --> OUT
Loading

Full system design, including the setup wizard flow and launcher API contract, lives in architecture.md.


Key Features

  • Fully local — LLM, embeddings, and vector store all run on your machine
  • No cost, no limits — no token metering, no rate limits, no API keys
  • Hybrid Search — vector similarity + BM25 keyword fusion
  • Multi-turn Memory — stateful conversation across queries per session
  • Guided setup — a wizard detects your hardware and suggests the right model
  • Pluggable LLM — swap Ollama models with one config change
  • RAGAS Evaluation — automated scoring, judged by your own local model
  • Source Citations — every answer references the exact chunk it came from

Setup Wizard

New here? Skip the manual steps below and run the guided setup instead:

git clone https://github.com/Ashutosh3021/galvanprime
cd galvanprime
python launcher/bootstrap.py

The launcher bootstrap step creates a project-local .galvan_venv/ at the repo root, installs the launcher dependencies there, and launches the local setup server at http://127.0.0.1:5321. The only prerequisites are Python 3.10+ plus Docker Desktop and Ollama on the machine; the wizard can guide you through the Ollama install and Docker startup steps if they are missing.

The wizard walks through the same steps the shipped implementation uses:

  1. Check whether Ollama is installed and show the install command if it is not
  2. Detect RAM and GPU (with manual override)
  3. Suggest and pull the best-fit model for the hardware
  4. Write the selected values to backend/.env
  5. Start the backend with Docker Compose and wait until the backend health check reports healthy

If startup fails, the wizard now surfaces actionable states for missing Ollama, pull failures, a port conflict, Docker daemon issues, or insufficient disk space. See architecture.md for the full setup API contract.


Quickstart (manual)

# Clone and configure
git clone https://github.com/Ashutosh3021/galvanprime
cd galvanprime
cp backend/.env.example backend/.env

# Install Ollama (see https://ollama.com/download for your OS)
ollama pull llama3.1:8b   # or whatever your hardware supports — see architecture.md
ollama serve

# Run with Docker
docker compose up -d --build

# Backend API available at http://localhost:8000
# Backend docs at http://localhost:8000/docs
# Setup wizard available at http://127.0.0.1:5321 when the launcher is running

API

Ingest a document

POST /ingest
Content-Type: multipart/form-data

file=@paper.pdf
chunk_strategy=semantic   # or "fixed"
collection=my-docs

Query

POST /query
{
  "question": "What are the main findings?",
  "collection": "my-docs",
  "session_id": "abc123"
}

Response:

{
  "answer": "The main findings include...",
  "citations": [
    { "source": "paper.pdf", "page": 4, "chunk": "...relevant excerpt..." }
  ],
  "session_id": "abc123"
}

Evaluation

RAGAS runs against a test question set, judged entirely by your local Ollama model, and logs scores to PostgreSQL. View the live dashboard at http://localhost:8501/eval.

Metric Target
Faithfulness > 0.80
Answer Relevancy > 0.75
Context Recall > 0.70

Roadmap

  • Document ingestion (PDF / TXT)
  • Fixed + semantic chunking
  • ChromaDB local vector store
  • Hybrid search (vector + BM25)
  • Query API with citations
  • Multi-turn conversation memory
  • RAGAS eval suite + dashboard (local judge)
  • Fully local LLM via Ollama
  • Guided setup wizard + local launcher
  • URL ingestion
  • Packaged desktop installer

Project Structure

galvanprime/
├── backend/          # FastAPI app: ingest, query, eval, generation, retrieval
├── launcher/         # Local Python launcher + setup API + static wizard assets
├── setup-wizard/     # Next.js onboarding UI (exported to launcher/static)
├── .galvan_venv/     # Project-local launcher environment created on first run
├── docker-compose.yml
└── .github/workflows/ci.yml

Migration plan and phase-by-phase implementation prompts: see plan.md and prompts.md.


Built by Ashutosh Patra · AI/ML Track · B.Tech CSE (AI/ML)

About

GalvanR.A.G is a Self-hostable RAG engine that ingests PDFs, URLs, and text, stores embeddings across ChromaDB and Pinecone, and returns answers with source citations. Features hybrid vector+BM25 search, multi-turn memory, pluggable LLM backend, and a RAGAS evaluation dashboard to score pipeline quality.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages