question: What is RAG?

gold_answer: RAG stands for Retrieval-Augmented Generation. It is a method where the system first retrieves relevant passages from a document corpus and then uses those passages as context to generate an answer.

expected_terms: retrieval augmented generation

difficulty: easy


question: What does BM25 do in a RAG system?

gold_answer: BM25 is a keyword-based retrieval algorithm that ranks documents by term frequency and inverse document frequency. It is used in RAG systems for fast, interpretable text search without requiring vector embeddings.

expected_terms: BM25 keyword retrieval term

difficulty: easy


question: What is the purpose of chunking in document processing?

gold_answer: Chunking splits documents into smaller passages so that the retrieval system can find and return the most relevant pieces of text rather than entire documents.

expected_terms: chunk split text retrieval

difficulty: easy


question: What is a knowledge graph?

gold_answer: A knowledge graph represents entities and their relationships as nodes and edges, enabling multi-hop reasoning over structured facts extracted from documents.

expected_terms: knowledge graph entities relationships

difficulty: easy


question: What is entity extraction?

gold_answer: Entity extraction is the process of identifying important named entities such as people, organizations, dates, and concepts from text, making documents queryable by name.

expected_terms: entity extraction named text

difficulty: easy


question: How does hybrid retrieval combine keyword and semantic search?

gold_answer: Hybrid retrieval combines BM25 keyword matching with vector-based semantic search, using weighted scores from both methods to rank results. This captures both exact term matches and semantic meaning.

expected_terms: hybrid keyword semantic BM25 vector

difficulty: medium


question: What chunking strategies exist and what are their trade-offs?

gold_answer: Strategies include fixed-size chunking, sentence-based splitting, sliding window with overlap, and parent-child hybrid. Fixed-size is simple but cuts mid-thought. Sentence-based preserves grammar but varies in size. Sliding window preserves cross-boundary context but creates more chunks.

expected_terms: fixed sentence sliding overlap chunk

difficulty: medium


question: What metadata fields are stored with each chunk and why?

gold_answer: Each chunk stores chunk_id as primary key, document_id for linking, section_title for context, page_number for source location, start_char and end_char for window expansion, and has_table flag for retrieval ranking.

difficulty: medium


question: How does entity normalisation work and why is it needed?

gold_answer: Entity normalisation maps different surface forms of the same entity to a single canonical form, for example mapping TCS to Tata Consultancy Services. This prevents duplicate entries and ensures consistent entity retrieval.

expected_terms: normalisation entity canonical mapping

difficulty: medium


question: What is the database design for a vectorless RAG system?

gold_answer: The database uses a relational schema with tables for documents, chunks, entities, and their relationships. SQLite is used for its simplicity. The schema connects documents to chunks, chunks to entities, and entities to each other through typed relationships.

expected_terms: database schema SQLite relational chunks

difficulty: medium


question: How does the knowledge graph enable multi-hop reasoning?

gold_answer: The knowledge graph connects entities through typed relationships like belongs_to, replaced_by, and related_to. Multi-hop queries traverse these edges to find connections that span multiple documents or sections, which keyword search alone cannot discover.

expected_terms: multi-hop graph entities relationships reasoning

difficulty: hard


question: What are the trade-offs between different entity extraction methods?

gold_answer: Regex patterns are deterministic and fast but require manual effort and miss novel entities. spaCy NER handles unknown entities but needs a trained model. The hybrid approach combines spaCy NER with custom EntityRuler patterns for both statistical and deterministic extraction.

expected_terms: regex spaCy NER extraction entity

difficulty: hard


question: How does the retrieval router decide which retrieval strategy to use?

gold_answer: The retrieval router classifies the query type and routes it to the appropriate retrieval method. Entity queries go to the entity retriever, metadata queries use metadata filtering, exact phrase queries use BM25 with phrase matching, and general questions use hybrid search.

expected_terms: retrieval router query entity BM25

difficulty: hard


question: Compare NetworkX and Neo4j for knowledge graph storage. When would you choose each?

gold_answer: NetworkX stores the graph in-memory as a Python object, making it simple and suitable for graphs up to roughly 10 million nodes. Neo4j is a separate disk-based server that handles billions of nodes but requires infrastructure management. NetworkX is chosen for prototyping and CPU-only environments.

expected_terms: NetworkX Neo4j graph memory storage

difficulty: hard


question: What problems does BM25 length normalisation cause for RAG retrieval and how can they be addressed?

gold_answer: BM25 length normalisation heavily favours short documents, so very short chunks with exact matches may be retrieved even if they contain almost no useful context. Very long chunks are penalised even when highly relevant. This can be addressed by using consistent chunk sizes and tuning the BM25 b parameter.

expected_terms: BM25 length normalisation chunk retrieval

difficulty: hard