A knowledge base that knows where to stop.
A chapter-aware knowledge base that brings together hybrid search, citation-backed answers, and database-enforced spoiler boundaries.
An unfamiliar arrival
Character introducedA name in the archives
Entity relationshipBeyond your chapter
Excluded from contextBeyond your chapter
Excluded from contextMove the boundary. Watch the available context change. Illustrative chapter data.
The boundary is the product.
A conventional wiki knows the whole story. A reader does not. This project makes reading progress part of the knowledge boundary, so the material available to search and answer generation is limited to the reader’s chapter.
From chapters to grounded answers.
I built the FastAPI and React knowledge base with automated scraping, pgvector/HNSW embeddings, hybrid retrieval, citation-backed Q&A, and dynamic entity relationships.
- Ingest chapters into a structured knowledge base.
- Attach chapter boundaries to the searchable material.
- Combine retrieval signals to find relevant context.
- Connect answers to source material with citations.
Enforce the rule before generation.
The project uses database-enforced spoiler boundaries. The important architectural distinction is where the rule lives: the retrieval boundary constrains available context before an answer is generated. An instruction in a prompt alone would leave that restriction up to model behavior.
A useful engineering tradeoff.
A progress boundary limits how much context the system can use. Later chapters may contain an excellent answer, but they should remain unavailable to an earlier reader. Answer completeness has to respect that constraint. Source citations make the permitted context inspectable.
What this example shows.
The interactive chapter diagram illustrates the boundary with synthetic chapter entries. Move the progress control to see the set of permitted passages change. The same boundary needs to hold across ingestion, retrieval, and answer generation.
Let’s build
something that works.
Have an AI problem, a backend challenge, or a team I should meet? I’d like to hear about it.
Based in Kathmandu. Open to a good conversation.