↗ View on GitHub

Introducing LearnKit — a thin experience distillation layer that wraps any agent and makes it compound knowledge over time. No retraining, no GPU, no amnesia.

See it work
47 tests passing· MIT licensed· v0.1.0
The state of agent memory

Agents are amnesiac by design.

Retraining isn't an option. Storing raw logs isn't learning. We need a better way.

01

Zero-sum runs

Your agent solved this exact problem last Tuesday. Today it's hallucinating again because it has no persistent skill layer.

02

The log haystack

Raw vector memory is just a bigger haystack. Without distillation, your agent gets lost in the noise of its own past.

03

Retraining barrier

Retraining models is slow and expensive. LearnKit gives you fine-tuning results with zero GPU hours and no model changes.

The mechanism

One loop. The agent function never changes.

The decorator orchestrates everything around your function. Eight steps, every call — each successful run feeds the next.

The difference

Typed and auditable, not stored and hoped for.

Naive chat-log memory Mem0 / Zep / SaaS LearnKit
StorageRaw transcriptsVendor-hosted vector storeLocal SQLite + typed records
Quality signalNoneImplicit ("frequency")Explicit 0–5 LLM judge, gates writes
Failure handlingLostLostFirst-class FailureRecord, activates immediately
Memory soup riskHighMediumHard cap: 8 records, 1,200 tokens
AuditabilityNoNo (vendor-controlled)Yes — JSON on disk you can cat
Vendor lock-inNoneHighNone — agent & framework-agnostic
Fine-tuning requiredNoNo
Benchmarks

It works. Here are the numbers.

v0.1.0 custom-clustered benchmark — 60 tasks across 3 domains, Gemini Flash Lite agent scored by a Claude Haiku judge.

Domain Without LearnKit With LearnKit Lift
Contract summarization4.70 / 50.00 / 5+0.0%
Python debugging4.10 / 50.00 / 5+0.0%
SQL authoring4.50 / 54.50 / 50%

Memory compounding — contract domain

Context size injected into the agent, growing as records accumulate across 10 sequential tasks. Characters per run.
0
peak chars / run

An honest note on the numbers. This is n=10 per cell — small, and we're not pretending otherwise. The judge ceiling near 5.0 compresses the visible lift on already-strong domains, and SQL authoring shows no movement at all. The signal we trust is the compounding curve: context accumulates, plateaus around a bounded cap, and stays there. That is the mechanism working as designed, not a leaderboard score.

Try it

See the mechanism. Live.

Type a task. We'll run the Classify → Retrieve → Compose stages of the LearnKit loop against a real SQLite store pre-seeded with this benchmark's distilled records. Nothing is mocked. The agent step is skipped — this is the prompt LearnKit would inject before your agent runs.

Domain store
idle
What happens: the server classifies your task, runs FTS5 + BM25 retrieval against the playground store, picks an inference mode, and composes the bounded context block. Same code path as production; you see the four artifacts the loop produces.
Run an inspect.Pick a domain above, type a task, and watch the LearnKit loop produce the four artifacts it would normally hand to your agent.
Integration

Five lines. Wrap the agent you already have.

agent.py
import learnkit as lk

memory = lk.LearnKit(memory_backend="sqlite", scope="user")

@memory.agent(domain="coding")
def my_agent(task: str, _learnkit_context: str = "") -> str:
    return call_your_llm(prompt=task, system=_learnkit_context)

That is the entire integration. The function never changes. The context it receives gets richer every run.

The memory model

Seven typed records. Each with a lifecycle.

Nothing is stored as raw text. Every distilled artifact is one of seven schemas — quarantined on arrival until a probation window promotes it, except failures, which activate immediately.

Open source

Read the blueprint. Run the tests. Own your data.

LearnKit is MIT-licensed and agent-agnostic. The memory lives in a SQLite file on your disk as JSON you can read, score, and delete. The architecture is documented end to end.

$ pip install -e .
⚖ MIT License
Copied