Skip to content

Portfolio Brief: Knowledge Base Agent ​

Use this brief beside the deterministic fixture when explaining the capstone in a review or interview.

Architecture ​

The trust boundary is before retrieval results reach an answerer. A provider model can draft text after policy filtering, but the application owns source selection, citations, refusals, checkpointing, and report emission.

Threat model ​

ThreatGuardrailEvidence
Prompt injection in a sourceTreat source text as data and refuse explicit injection requestscase://prompt-injection and safety.refusal
Cross-tenant disclosureFilter by tenant and restricted access before citation generationcase://acl-denied and zero ACL leakage
Stale or conflicting factsPrefer the newest trusted source and report the disagreementcase://stale-source and grounding.conflict
Timeout or interruptionRetry once with a bounded policy and replay from a checkpointretrieval.timeout and run.replayed

Trace and failing case ​

The good run includes trace://knowledge-base-agent/good. Inspect the failing report to see how degraded metrics expose a broken implementation. The fixture keeps failing cases explicit so a green answer cannot hide a failed safety or recovery path.

Latency and cost note ​

The deterministic fixture performs local token matching and has no provider cost. It establishes a baseline for retrieval, policy, and report overhead. A provider adapter must measure model latency and token cost separately, publish the model revision and prompt hash, and retain the same pass/fail gates.

Interview explanation ​

I started with a deterministic, cited retrieval contract. The application filters tenant access and untrusted instructions before an optional model sees the context. Every answer includes a locator and freshness, every refusal leaves a trace, and an interruption can replay from a checkpoint. The eval report makes the evidence reproducible without pretending one run is a mastery score.

Host adapter note ​

For ai-jue, package the command and policy as an AGENTS.md entry plus a Skill or Extension. For Pi, expose the same command through a Skill or package adapter. Both hosts should consume the report contract and keep their adapter outside the policy engine. See learn-design#9 and ai-jue#41.

Built for frontend engineers · Powered by VitePress