Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rag Database

Lightweight local RAG web app for private document Q&A.

The app is designed for local or intranet deployment:

  • Upload .txt, .md, .pdf, .docx
  • Store documents and chunks in local SQLite
  • Search locally with deterministic embeddings
  • Answer with cited source chunks
  • Use DeepSeek Flash or Ollama when configured, with an extractive local fallback

Quick Start

Windows

.\start.bat

Open http://localhost:8000.

Docker

docker compose up --build

Open http://localhost:8000.

Local Python

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

Optional Ollama

The app works without Ollama by returning answers from retrieved passages. To use a local model:

ollama pull qwen2.5:7b
$env:OLLAMA_BASE_URL="http://localhost:11434"
$env:OLLAMA_MODEL="qwen2.5:7b"
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000

For Docker Compose, add these environment variables under the service when you want the container to call a host Ollama instance:

OLLAMA_BASE_URL: http://host.docker.internal:11434
OLLAMA_MODEL: qwen2.5:7b

Optional DeepSeek Flash

Copy .env.example to .env, then fill your key:

Copy-Item .env.example .env
notepad .env

Use these values:

DEEPSEEK_API_KEY=sk-...
DEEPSEEK_BASE_URL=https://api.deepseek.com
DEEPSEEK_MODEL=deepseek-v4-flash

Restart the app after changing .env. DeepSeek takes priority over Ollama when DEEPSEEK_API_KEY is set.

Data

Runtime data is stored under data/:

  • data/rag.db: documents, chunks, and local embeddings

Delete data/rag.db to reset the knowledge base.

Privacy Defaults

By default the app does not call cloud APIs.

When DEEPSEEK_API_KEY is configured, the user's question and retrieved document chunks are sent to DeepSeek for generation. Do not enable DeepSeek for deployments that require strict "documents never leave the local network" guarantees.

When OLLAMA_BASE_URL is configured, it should point to a local or private Ollama endpoint.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages