Document Ingestion & Preprocessing
Load text from files, HTML, and directories, normalize it, and wrap it into document objects with metadata.
Construct ingestion, chunking, embeddings, hybrid retrieval, grounded generation, evaluation, and conversational memory.
Every source step is its own lesson with intuition, concepts, correctly rendered MathJax mathematics, implementation, tests, mistakes, and a checkpoint.
Load text from files, HTML, and directories, normalize it, and wrap it into document objects with metadata.
Split documents into retrievable units using fixed-size, token-based, sentence-aware, and overlapping chunkers with proper metadata.
Load a sentence-transformer model, embed and normalize chunks, and persist the corpus to disk.
Implement cosine similarity search from scratch, then accelerate it with a FAISS index and verify the two agree.
Assemble grounded prompts, load a local instruct model, generate answers, and attach source citations to outputs.
Improve recall and precision with query rewriting, HyDE, BM25, hybrid search, cross-encoder reranking, MMR, and metadata filtering.
Build an eval set and implement retrieval and answer-quality metrics like hit rate, recall@k, MRR, faithfulness, and relevance.
Add abstention, deduplication, embedding caching, and conversational memory with follow-up rewriting.