System design ยท proposal
Designing answers that can show their evidence
A proposed retrieval and answer path for Ask Habib, with explicit evidence types, canonical citations, and bounded failure behaviour.
Status: proposal. The deployed site currently provides static portfolio content and a health API. The retrieval, database, and answer services described here are planned work.
The problem to solve
A portfolio assistant should help a reader find relevant experience and understand engineering decisions. It should also make clear what supports an answer. A design exercise must not quietly become professional experience, and a plausible sentence must not stand in for a source.
One content corpus
Plain Markdown is the proposed source for both the static site and the future indexer. Every document has a title, summary, date, publication status, and evidence type. Its repository path determines its canonical URL through a shared contract tested in TypeScript and Go.
The indexer would read only published content, retain the source path and canonical URL, and partition the text into traceable chunks. Content changes would carry a version so that stale indexed text can be distinguished from the current page. A renamed URL would require a redirect or tombstone for at least one release.
Retrieval before generation
The planned data layer is PostgreSQL with full-text and vector search. A question would first retrieve candidate chunks, then select a bounded evidence set. Each result should preserve its document, evidence type, and citation target through the answer path.
The answer service would receive source excerpts as untrusted data, separate from its instructions. An architecture proposal could support an explanation of a design, but not a claim about employment. Where retrieved evidence is insufficient, the answer should say so and offer relevant source pages.
Boundaries and failure behaviour
The browser would call the Go API through the existing proxy route. Request limits, validated inputs, timeouts, and bounded provider spend would be required before enabling public generation. The trusted visitor-identity work is an input to that design, not a complete abuse defence.
If the model provider fails, source links and static pages should remain useful. If indexing is stale, the system should expose that state rather than cite an incompatible page silently. Operational logs should capture request outcomes and durations without retaining raw visitor addresses or confidential prompt contents by default.
Questions to validate
- Does retrieval find the correct source for representative questions about roles, decisions, and tradeoffs?
- Can every factual answer claim be traced to an eligible evidence type and a working citation?
- What should happen when a source is removed between retrieval and response?
- Can concurrency, token budgets, and timeouts keep a single VPS responsive?
Those questions require evaluation data and implementation evidence. This page records the intended direction; the case studies describe what has already been built and verified.