work.jackmann.xyz
← Work

Software & Engineering · 2026

AlphaRag

Author & Maintainer

A Chainlit-powered document assistant using parent-child chunking, hybrid dense+sparse search, and automated LLM metadata extraction. Each upload session gets an isolated in-memory vector store — multi-user safe with no disk persistence.

Python · RAG · Chainlit

Document Q&A systems often use flat chunking that fragments narrative context, or persist all user uploads to shared storage — creating privacy risks and data collisions in multi-user deployments. Scanned PDFs and missing metadata make source traceability unreliable.

  • Parent-child split: small child chunks embedded in Qdrant for precise ANN search; parent ID lookup expands to full section context at query time.
  • Hybrid search combining all-MiniLM-L6-v2 dense embeddings with FastEmbed sparse vectors.
  • Pydantic-validated Groq LLM extracts document metadata (title, author, type, date) from page 1 on upload.
  • Session-scoped InMemoryStore and :memory: Qdrant collection per upload — zero cross-session data collision.
  • Chainlit UI with async token streaming and expandable citation sidebar (title, author, page, excerpt).
  • Parent context preserved at generation time while child chunks enable precise vector retrieval.
  • Multiple simultaneous users upload and query different documents without shared state.
  • Citations surface document metadata and source excerpts automatically on every answer.
  • Real-time streaming responses via async LangChain generators and Chainlit.
Top-K 6
Child chunks fetched per query (default)
384-dim
all-MiniLM-L6-v2 + FastEmbed hybrid
1500 / 200
Parent / child characters
Per-session
UUID-scoped in-memory Qdrant
Chainlit UIUpload + streaming chat
PyPDFLoaderPage text extraction
Metadata ExtractorGroq + Pydantic
Parent-Child Splitter1500 / 200 char chunks
Session StoreInMemoryStore + Qdrant
Query EngineHybrid search + parent lookup
ChatGroqLLaMA-3 streaming
  • Storage

    In-memory per session

    Persistent disk-backed index

    Session isolation guarantees privacy and multi-user safety. Documents are cleared on restart — acceptable for ephemeral Q&A workflows.

  • Chunking

    Parent-child with ID lookup

    Flat fixed-size chunks

    Child chunks enable precise ANN search; parent expansion preserves narrative continuity the LLM needs for faithful answers.

  • Ingestion

    PDF-only via PyPDFLoader

    Multi-format with OCR pipeline

    Focused scope for the MVP. Scanned or image-based PDFs without embedded text are a known limitation.

0%