GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Pramjeetk/RAG-Vectorless: Local document Q&A powered by Mistral 7b — no vectors, no embeddings, no cloud.

BranchesTags
Open more actions menu

Latest commit

 

History

3 Commits
3 Commits

Folders and files

NameName
Last commit message
Last commit date
.streamlit
.streamlit
 
 
PageIndex @ f2dcffc
PageIndex @ f2dcffc
 
 
data
data
 
 
rag_system
rag_system
 
 
tests
tests
 
 
ui
ui
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
README.md
README.md
 
 
pyproject.toml
pyproject.toml
 
 
requirements-dev.txt
requirements-dev.txt
 
 

Repository files navigation

RAG-Vectorless

Local document Q&A powered by Mistral 7b — no vectors, no embeddings, no cloud.

RAG-Vectorless uses PageIndex to build a hierarchical tree index of your documents, then navigates that tree with a local Mistral 7b model (via Ollama) to answer questions in natural language. Everything runs on your machine.


How It Works

┌─────────────────┐   index()    ┌──────────────────┐   PageIndex   ┌─────────────────┐
│  Streamlit UI   │ ───────────► │   RAG-Vectorless  │ ────────────► │ DocumentIndexer │
│   or  CLI       │              │     (facade)      │               │  (tree builder) │
└─────────────────┘              └──────────────────┘               └─────────────────┘
                                          │                                   │
                    query()               │ save / load            PageIndex JSON tree
                                          ▼                                   │
                                 ┌─────────────────┐                         ▼
                                 │ WorkspaceManager│              ┌───────────────────┐
                                 │ (JSON on disk)  │              │  workspace/*.json  │
                                 └─────────────────┘              └───────────────────┘
                                          │
                                          ▼
                                 ┌─────────────────┐   ReAct loop  ┌─────────────────┐
                                 │    RAGAgent     │ ────────────► │  OllamaClient   │
                                 │  (tool loop)    │  tool calls   │  (Mistral 7b)   │
                                 └─────────────────┘ ◄──────────── └─────────────────┘

The agent follows a ReAct loop:

  1. Calls get_document_structure to see the document tree
  2. Calls get_page_content on the most relevant pages
  3. Produces a clean, cited answer — no hallucination of source references

Features

  • No vector database — document navigation via hierarchical tree index
  • Fully local — Mistral 7b runs on-device via Ollama, no cloud API calls
  • Streamlit chat UI — mobile-style chat interface with structured responses
  • Multi-document — index and query PDFs and Markdown files
  • Customer support persona — agent responds as a helpful support agent
  • Answer sanitisation — strips page citations, doc references, and planning artefacts from output
  • Thread-safe workspace — atomic JSON writes with file locking
  • Typed exceptions — full exception hierarchy for precise error handling
  • Dependency injection — swap LLM or workspace backend for testing

Requirements

Requirement Version
Python 3.9+ (tested on 3.14)
Ollama Latest
Mistral model ollama pull mistral
OS macOS / Linux (tested on Mac Mini M4, 24 GB RAM)

Installation

# 1. Clone the repo
git clone https://github.com/Pramjeetk/RAG-Vectorless.git
cd RAG-Vectorless

# 2. Create and activate a virtual environment
python3 -m venv .venv
source .venv/bin/activate

# 3. Install PageIndex (vendored)
pip install -e PageIndex/

# 4. Install RAG-Vectorless
pip install -e .

# 5. Install Streamlit UI dependencies
pip install streamlit markdown

# 6. Pull the Mistral model
ollama pull mistral

Running the UI

streamlit run ui/app.py

Open http://localhost:8501 in your browser.

Pages:

  • Home — Overview and quick-start guide
  • Documents — Upload and index PDF or Markdown files
  • Chat — Select a document and ask questions in a mobile-style chat interface

CLI Usage

# Check Ollama is reachable
rag health

# Index a PDF or Markdown file
rag index ~/Documents/report.pdf
# → doc_id: 20dc7696-d197-48c0-b30c-334bb3ac96fc

# Ask a question
rag query 20dc7696-d197-48c0-b30c-334bb3ac96fc "What are the key findings?"

# JSON output (for scripting)
rag query 20dc7696-... "What are the key findings?" --format json

# List all indexed documents
rag list

# Delete a document
rag delete 20dc7696-d197-48c0-b30c-334bb3ac96fc --yes

Python API

from rag_system import VectorlessRAG

rag = VectorlessRAG()

# Index once
doc_id = rag.index("report.pdf")

# Query any number of times
result = rag.query(doc_id, "What are the main benefits?")
print(result.answer)

# List all documents
for doc in rag.list_documents():
    print(doc.id, doc.name)

# Delete
rag.delete_document(doc_id)

Configuration

All settings can be overridden via environment variables or a .env file.

Setting Default Environment Variable
Ollama server URL http://localhost:11434 OLLAMA_BASE_URL
Ollama model mistral OLLAMA_MODEL
Workspace directory ./workspace WORKSPACE_DIR
Max agent turns 10 MAX_AGENT_TURNS
LLM timeout (seconds) 120.0 LLM_TIMEOUT
Log level INFO LOG_LEVEL
Retry attempts 3 RETRY_ATTEMPTS

Copy .env.example to .env and edit as needed.


Project Structure

RAG-Vectorless/
├── ui/                         # Streamlit UI
│   ├── app.py                  # Entry point — run this
│   ├── _shared.py              # Shared helpers and RAG singleton
│   ├── assets/                 # Logo and static assets
│   └── pages/
│       ├── 1_📄_Documents.py   # Upload and index documents
│       └── 2_💬_Chat.py        # Chat interface
├── rag_system/                 # Core library
│   ├── agent.py                # ReAct agent loop + ToolRegistry
│   ├── rag.py                  # VectorlessRAG facade
│   ├── indexer.py              # PageIndex integration
│   ├── workspace.py            # Thread-safe document store
│   ├── llm.py                  # OllamaClient with retry logic
│   ├── config.py               # Settings (YAML + env vars)
│   ├── models.py               # Pydantic domain models
│   ├── exceptions.py           # Typed exception hierarchy
│   ├── interfaces.py           # Protocol definitions (DI)
│   ├── logger.py               # Centralised logging
│   └── cli.py                  # Typer CLI
├── PageIndex/                  # Vendored PageIndex library
├── data/                       # Sample knowledge base documents
├── tests/                      # Test suite
├── .streamlit/config.toml      # Streamlit theme (green/white)
├── pyproject.toml              # Package metadata
└── requirements-dev.txt        # Test dependencies

Running Tests

pip install -r requirements-dev.txt
pytest tests/ -v

Limitations

  • No streaming — responses are returned after the full ReAct loop completes.
  • No async — all operations are synchronous.
  • Ollama only — other LLM providers require a new LLMClientProtocol implementation.
  • Local files only — workspace stores documents as JSON on disk; S3/cloud backends not implemented.
  • Mistral 7b quality — small models may not always follow tool-calling instructions precisely; the answer sanitiser handles common artefacts.

License

MIT

About

Local document Q&A powered by Mistral 7b — no vectors, no embeddings, no cloud.

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.