Everything Khwan adds to your model.
The cognition layer that turns a stateless model call into an agent with memory, identity, and receipts — without ever running your model.
Persistent memory
Structured, queryable memory that survives every session. The agent recalls what's relevant to this turn instead of re-filling a context window that resets.
- Persists between sessions
- Relevance-based recall, assembled into each prompt
- Works with whatever model you call
Constitutional identity & coherence gate
Give the agent a written identity. Before the model is called, the coherence gate checks the turn against that constitution and what the brain already knows — and can refuse it outright, with a reason.
- A written identity the agent is held to
- Runs before generation — a blocked turn costs no tokens
- Consistent across long-running sessions
Overnight learning
Between sessions, Khwan consolidates recent turns into durable memory. Next run, the agent starts from what it worked out — not a blank slate.
- Recent turns consolidated into memory
- Resumes with prior context intact
- Runs in the background
Isolated cores
One account, many separate brains — test, staging, per-client. Each core has its own memory and identity; select one with a single line. Plan limits stay pooled at the account level.
- Separate memory per core — no crossover
- Select a core with the `core` option (one line)
- Plan limits shared across the account
Traceability
Every memory write and gate decision is recorded with its source. See why the agent answered the way it did — for debugging and for compliance.
- Source recorded for every memory and decision
- Auditable trace behind each response
- Answer: why did it say that?
Model-agnostic (BYOM)
Khwan is the layer around your model, not a replacement. Bring your own — swap providers, run open weights, mix per task — and keep the same memory, identity, and traceability. Khwan never touches your model.
- Bring your own model on every plan
- No provider lock-in
- Never touches your model or your key
Answer-gate
The coherence gate runs before generation. The answer-gate runs after: send the draft back and Khwan scores it against the brain, so a reply that contradicts what it knows can be blocked or regenerated before anyone sees it.
- Checks the answer, not just the turn
- Non-destructive — the turn still records normally
- One call: POST /verify
Built to be audited
Khwan holds no model-provider key and never generates an answer — there is no hosted chat path in the engine. What it does hold is memory, and the isolation between tenants is enforced by tests rather than asserted.
- No provider key stored — nothing to leak
- Cross-tenant access covered by BOLA tests
- Crypto and rate limiting fail closed, never open
- Secret scanning and SAST block the build