RAG Knowledge Base

RAG Knowledge Base demonstrates how documents and business knowledge can support search and answers with visible source references.

The task

Turn uploaded documents into a searchable knowledge base for semantic search and Q&A over retrieved content.

Implemented solution

Search and Q&A system for internal knowledge bases. Documents are converted into vector representations, relevant context is retrieved via semantic search and passed to an AI model to generate answers with source citations. The implementation supports PDF, UTF-8 TXT, text preparation, embeddings, ChromaDB, retrieval, answer generation, and source metadata.

How the retrieval pipeline works

  1. 01

    PDF / TXT

  2. 02

    Parsing and normalization

  3. 03

    Chunks

  4. 04

    Embeddings

  5. 05

    ChromaDB

  6. 06

    Semantic retrieval

  7. 07

    Relevance filtering

  8. 08

    Context assembly

  9. 09

    AI generation

  10. 10

    Answer + sources

Engineering decisions

01

Retrieved candidates can be filtered by vector distance before generation.

02

An adjacent fragment from the same document can be added to preserve continuity.

03

The generation prompt constrains the answer to retrieved context.

04

When suitable context is absent, generation is not started.

05

Source references are built by the backend from retrieval results.

06

Hash-based document identity prevents repeated indexing of identical content.

Architecture

  1. 01

    Frontend

    React / Vite

    Upload, search, and Q&A interface

  2. 02

    API & orchestration

    FastAPI

    API and pipeline orchestration

  3. 03

    Document processing & retrieval

    Parsing · chunks · embeddings · semantic retrieval

  4. 04

    Vector store

    ChromaDB

    Vector storage and similarity search

  5. 05

    AI providers

    Embeddings · answer generation

Capabilities

01

PDF/TXT upload

02

Preview

03

Indexing

04

Document inspection

05

Semantic search

06

Q&A

07

Filename/page/section/excerpt metadata

08

Document deletion

Technologies

FastAPIReactViteChromaDBRAGEmbeddings

Next step