Skip to content
The memory layer for AI agents

Memory that makes your AI agent cheaper and sharper — every run.

For developers and teams building agents that have to remember. Bring any model — Khwan adds the memory, the learning, and a coherence gate, and never touches it.

Model-agnostic · Hosted or on-prem · No credit card to start

Raw LLMs forget every session — turn 1,000 costs the same as turn 1. Khwan remembers what works and turns it into lower cost.

~80%

lower cost per task after synthesis — in our tests

3 calls

the whole loop: prepare → your model → record

0

of your model's tokens metered or marked up by us

The loop

Three calls. Your model in the middle.

You never hand Khwan your model or your key. It prepares the context, you call your own model, and it learns from the answer — so the next run starts sharper than the last.

Read the docs →
agent.ts
import { Khwan } from "@khwan/client";
 
const kw = new Khwan({ apiKey: process.env.KHWAN_API_KEY });
 
// 1 — Khwan builds the context (memory + coherence). No LLM call.
const turn = await kw.prepare(input);
 
// 2 — You call your own model. Your provider, your key.
const answer = await yourModel(turn.messages);
 
// 3 — Hand it back. Khwan persists + learns; next prepare is sharper.
await kw.record(turn, answer);
01

Remembers

One brain per user, across every session. No re-learning the same context on each call.

02

Compounds

Each task builds on what the last one learned, so the brief stays tight — and your model spends fewer tokens on repeat work.

03

Sharpens

A coherence gate checks each response against the agent's written identity before it ships — so behavior stays consistent instead of drifting. A better prompt, not a longer one.

04

Isolated cores

One account, many separate brains — test, staging, per-client. Pick one with a single line; memory never crosses over.

How it works

Wrap your model. Keep the memory.

1

Bring your model.

Khwan wraps it, never replaces it.

2

It remembers as it runs.

Every turn evolves the brain — memory, axes, coherence.

3

It compounds.

Lessons synthesize into lower cost and sharper answers. The longer it runs, the more you save.

Bring your own model

Claude Code is already the model. Khwan is the memory it's missing.

In a Claude Code session, Claude itself is the "your model" step — no key to wire, no provider to trust, no token markup. Khwan slots in as the memory, so Claude remembers across sessions, projects, and people, not just one chat window. Isolated cores give you a separate brain per repo or client, natively.

$claude mcp add khwanComing soon

Also works with OpenAI · open weights · anything you can call

Differentiation

Memory that thinks, not just recalls.

vs. a raw LLM

It forgets every session and never gets cheaper. Khwan remembers and compounds cost down.

vs. memory tools

They store and retrieve. Khwan also synthesizes, gates for coherence, and improves the agent itself.

vs. agent frameworks

Orchestration isn't memory. Khwan is a model-agnostic layer, not a stack you rebuild around.

FAQ

Questions builders ask first.

I already pay for Claude / ChatGPT — why Khwan?
Claude is the brain. Khwan is that brain's long-term memory. You don't pick one — you take the model you already have and make it remember across sessions, people, and time. A chat subscription is for chatting; Khwan is for when you build a product, an agent, or a multi-user system that has to remember. If you just want to chat, you don't need Khwan yet.
Does Khwan run or host my model?
No. Khwan is a pure memory layer — it never calls your model, meters its tokens, or marks it up. The only loop is prepare → your model → record: Khwan builds the context before your call and learns from the answer after. You run any model, your key, and pay your provider directly.
How does it make my agent cheaper?
Synthesis distills what worked into standing lessons, so each prompt gets shorter and sharper instead of re-stuffing context every call. In our tests, cost per task dropped roughly 80% once synthesis kicked in. You spend fewer of your own tokens as the agent runs.
What is a coherence gate?
A written identity (a constitution) that the agent is held to. Before a response ships, the gate checks it against that identity so behavior stays consistent across long-running sessions instead of drifting.
Can I run it where my data lives?
Yes. Khwan runs hosted, or single-tenant and on-prem for teams with compliance and data-residency requirements. Talk to us about the Scale plan.

Pay for the memory, not the model.

Start free. You bring the model; Khwan is the memory that makes each run cheaper — no tokens metered, no markup.

Run Khwan where your data lives.

On-prem and single-tenant — run your own model where your data lives, with the controls and SLA your security team asks for.

Talk to us →

Give your agent a memory that pays for itself.

Start free — feel the compounding before you pay for it. No credit card.