The question
How does a local RAG pipeline change when documents are chunked differently, retrieval is tuned, or a smaller language model is used? This lab makes those stages explicit so I can inspect behavior and compare configurations.
My work
I developed a Python command-line workflow for collecting a corpus, splitting documents, generating embeddings with Ollama, storing vectors in PostgreSQL/pgvector, retrieving evidence, and generating answers with source references.
The lab includes token-aware chunking with source offsets, exact and HNSW vector search, duplicate removal, lexical reranking, retrieval evaluation, answer evaluation, and controlled prompt-injection regression exercises.
Engineering decisions
- Keep evidence traceable. Document metadata, chunk offsets, source references, and supporting quotes connect generated claims to retrieved material.
- Separate pipeline stages. Ingestion, retrieval, answer generation, and evaluation have individual commands and outputs.
- Make comparisons reproducible. Explicit model and chunking settings accompany reports, with isolated database schemas for comparison work.
What you can inspect
The repository contains the implementation, labeled questions, and evaluation reports. My Qwen3 comparison documents a small local experiment involving generation speed, memory use, and answer quality.
This is a study lab. Retrieval and answer metrics depend on the corpus, labels, models, and hardware used. Local experiments do not establish general model superiority or production reliability.