Skip to content
baris-gungorPublic

About

Local RAG app: upload PDF, Markdown and text files, ask in English or Turkish, and get answers with numbered citations to the exact passage. PostgreSQL + pgvector, FastAPI, Vue 3. Runs with Ollama or OpenAI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

RAG: ask your documents and get answers that cite the exact passage they came from

What it does     How it works     Get started     Screenshots


What it does

You have handbooks, policies, contracts or notes spread across dozens of files. Finding one fact means opening them one by one.

RAG reads them for you. Type a question the way you would ask a colleague, and it:

  • finds the paragraphs in your files that are closest in meaning to the question,
  • answers using only those paragraphs, in the language you asked in,
  • shows its sources. Every claim carries a number like 1. Click it and you see the file, the page and the exact passage.

If the answer is not in your documents, it says so instead of guessing.

Why "RAG"? It stands for Retrieval-Augmented Generation: the AI first retrieves relevant passages from your files, then generates an answer from them, not from memory.


Answers you can check

Numbered citations link each sentence to the passage behind it. No more taking the AI's word for it.

Private by default

With Ollama, everything runs on your own computer. Your files and questions never leave it.

Two languages

Mix English and Turkish documents freely. Ask in either; the answer comes back in the same language.

Collections

Keep topics apart: one collection for HR, one for engineering notes. Each has its own models and settings.

See why it answered

Open the retrieval panel under any answer to see every passage that was found, how close it was and whether it was used.

Pleasant to use

Drag and drop uploads, light and dark themes, works on a phone, English or Turkish interface.

How it works

Three steps: add documents, ask a question, get a cited answer

When you add a file, it is split into short passages. Each passage is turned into a meaning fingerprint (an embedding): a list of numbers that captures what the text is about. Two sentences that say the same thing in different words get similar fingerprints.

When you ask a question, it gets a fingerprint too, and the closest passages are picked out. That is why asking "how much time off do I get?" finds a paragraph that talks about "20 days of paid annual leave", even though the words differ. The AI model then writes the answer from those passages alone.


Get started

Setup takes a few developer tools and is done once. After that, everything happens in the browser.

What you need
Docker Desktop Runs the database and file storage
uv Installs Python and the app's dependencies
Node.js 22.12 or newer Builds the interface, once
Ollama or an OpenAI API key The AI models. Ollama is free and local, for example ollama pull bge-m3 and ollama pull qwen3.5:2b
Install and run
  1. Create the settings file and a secret key:

    cp .env.example .env
    uv run python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"

    Paste the printed value after APP_SECRET_KEY= in .env.

  2. Start the database and file storage:

    docker compose up -d
  3. Install dependencies and prepare the database:

    uv sync
    uv run python -m app.cli migrate
  4. Build the interface:

    cd frontend && npm install && npm run build && cd ..
  5. Start the app:

    uv run uvicorn app.main:app
  6. Open http://localhost:8000.

First steps in the app
  1. Go to Providers, add an Ollama or OpenAI connection and press Test connection.
  2. Add two models to it: an embedding model (finds passages) and an LLM (writes answers). Fetch models lists what is available.
  3. Go to Collections, create one and pick those two models.
  4. Drop your files on the Documents tab. When they show Ready, switch to Ask.

Want something to try it with? eval/docs/ has sample files: an employee handbook, a returns policy, Kubernetes and PostgreSQL notes.


Privacy

  • Built for one person on one computer. There is no login, and the app only listens on your own machine.
  • With Ollama, documents and questions stay on your computer. With OpenAI, the passages found for a question are sent to OpenAI to write the answer.
  • API keys are stored encrypted and only ever shown masked.

Screenshots

Ask a question. The answer cites its source; clicking a number highlights the passage.

Question and answer with a numbered citation and the highlighted source card



Look behind the answer. Every passage the search found, how similar it was (the tick marks the minimum score), and whether it went into the answer.

Retrieval panel listing the found passages with similarity bars and status labels



Documents tab with upload area and file list

Documents. Drag and drop, watch each file become ready.

Collection settings

Settings. Choose the model and how strict the search is.

Providers and models

Providers. Ollama or OpenAI connections and their models.

Logs with an expanded AI call

Logs. Every AI call with its timing, request and reply.

Dark theme

Dark theme

Phone layout

On a phone


For developers

Python 3.14 FastAPI PostgreSQL 18 + pgvector Vue 3 TypeScript Tailwind CSS 4 Ollama and OpenAI

About

Local RAG app: upload PDF, Markdown and text files, ask in English or Turkish, and get answers with numbered citations to the exact passage. PostgreSQL + pgvector, FastAPI, Vue 3. Runs with Ollama or OpenAI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages