Skip to content

RAG pipeline

End-to-end flow from PDF manuals to cited answers in the portfolio demo.

flowchart TD
    PDF[PDF Documents] --> Chunk[Chunking]
    Chunk --> Embed[Embeddings]
    Embed --> VDB[Vector Database]
    VDB --> Ret[Retriever]
    Ret --> LG[LangGraph Orchestration]
    LG --> LLM[LLM]
    LLM --> Out[Answer + Citations]

Layers

Layer Technology Purpose
PDF Documents PyMuPDF Ingest CAE manuals (page-aware text extraction)
Chunking Parent/child splitter Searchable child chunks with metadata
Embeddings sentence-transformers (multilingual-e5-base) Semantic vectors for retrieval
Vector Database Qdrant Persistent index with payload filters
Retriever Cosine similarity + parent expansion Top-k retrieval with provenance
Orchestration LangGraph Intent routing → RAG / tools → cited report
LLM OpenRouter / OpenAI-compatible Grounded synthesis with numbered citations
Answer + Citations FastAPI + Streamlit Traceable responses, SSE streaming, analytics

The same layer list is exposed at runtime:

curl https://api.cae-copilot.dmitryivanov.dev/architecture

Deeper reading