What is BetterContext?
API Guide
Quickstart
Comparison
Agents, skills & MCP
How it works?
Experience Engine
Focus Mode
Memory Graph
Files & Folders
Token Usage
Overview
API keys
Invite team member
Tools connection
Usage & Analytics
Ingestion
General
Benchmarking
Billing and Invoice
Security & Compliance
Use cases
From other providers
Upgrade BetterContext
Concepts Copy
Experience Engine
Translating human developer interventions and real-world execution into reusable procedural skills and institutionalized agent habits.
LLMs possess broad general knowledge, but zero organizational memory. When an experienced staff engineer solves a subtle concurrency bug or refactors a sensitive payment flow, that knowledge traditionally remains locked in PR review comments or ephemeral Slack threads.
The Experience Engine captures human corrections and successful resolutions, compiling them into structured procedural memory that agents apply across future tasks.
The Three Memory Layers
Factual knowledge: API specs, architectural diagrams, schemas, and README documentation.
Event chronology: what PRs were merged, which tickets were resolved, and past deploy logs.
Actionable workflows: "How we review PRs here", "How we debug our auth service", and "Rules we never break".
Automated Habit Formation
The Experience Engine continuously analyzes developer interactions:
- Correction Ingestion: When a senior engineer rewrites an AI agent's proposed code, the diff is analyzed to isolate the underlying stylistic or architectural rule.
- Rule Generalization: The pattern is distilled into a concise procedural invariant (e.g. "Always sanitize tenant IDs using the multi-tenant middleware before invoking db queries").
- Skill Compilation: The rule is compiled into a high-priority guardrail node within the knowledge graph.
- Proactive Injection: Whenever any agent on the team attempts a similar refactor, the procedural habit is injected before execution occurs.
Recording Experiences via SDK
Teams can explicitly record procedural playbooks programmatically:
from bettercontext import BetterContextClient
client = BetterContextClient()
# Record an institutional procedural habit
client.experience.record(
title="Postgres Connection Pool Handling",
trigger_patterns=["database", "db_pool", "sqlalchemy", "connections"],
guideline="Always wrap async session scopes in a context manager to prevent pool exhaustion.",
severity="critical",
tags=["backend", "database", "reliability"]
)
Next Steps
Powered By BetterContext