CodeDocs Vault

LLM Leverage Patterns

OpenKnowledge is unusual in this corpus: it barely calls an LLM at all. It ships no agent loop, no provider abstraction, no prompt-caching strategy, no thinking management. The intelligence is borrowed from whatever harness mounts it. So the interesting question isn't "how does OK use the LLM" — it's "how does OK make a borrowed agent more effective, and safer, than it would be alone?"


1. The tool result is a just-in-time prompt

The strongest pattern. The workflow tool returns instructional prose, not data (04_knowledge_workflows.md). Calling workflow({kind:'research'}) hands the agent an 8-step procedure with hard gates; consolidate hands it a different one with a decision gate. The harness "loop" stays generic; OK injects the method per call. This is scope-injected-at-render and markdown-as-skills taken to their conclusion: the procedure is delivered at tool-call time, scoped to the mode requested, and versioned server-side so it can improve without the agent reinstalling anything.

2. Skill as the floor, MCP as the ceiling

The discovery skill is written to work with no MCP server at all — bare ls/cat/grep (05_skills.md). The agent's baseline capability is assumed to be "a shell and a filesystem"; everything richer is an upgrade. This is a robust way to leverage any agent: never depend on a capability the weakest harness lacks.

3. Human-in-the-loop as STOP gates

Across discover/research/consolidate, the agent proposes and waits at every phase boundary. consolidate refuses to promote research to canonical until a human confirms a decision landed. The guardrail isn't a content filter — it's a workflow gate that keeps the agent from advancing the knowledge base's state of truth on its own. Two autonomy modes (Supervised / Headless) let you dial how many gates are interactive while keeping the safety-critical ones (research-body.ts:28-41).

4. Provisional vs. canonical as enforced voice

The same model writes very differently depending on the workflow: provisional articles must hedge ("tentative", "initial findings"); canonical articles must decide ("we chose"). The status frontmatter and the prose voice are both mandated. Leverage pattern: constrain the model's register with the document's type, so a reader (or a downstream agent) can trust the confidence level without re-judging it.

5. Evidence discipline

"Capture raw sources first; cite every claim; no bare URLs" (04). The agent is steered to ground before it synthesizes, and the grounding is preserved in the KB (the ingest layer) so the citation never rots. This is the cheapest possible hallucination guardrail — make the verifiable thing the required input.


What distinguishes OpenKnowledge from "just ask Claude Code"?

Claude Code can already write markdown and run git. So what does OK add?

The honest flip side: for a one-off note, "just ask Claude Code" is fine. OK earns its keep when knowledge accumulates over time and provenance, review, and curation start to matter — which is precisely the regime a code-review meta-harness and a compliance platform both live in.


For the owner's two projects