Skip to content

agentic-context-engine

AI Agents & Assistants

Agentic Context Engine (ACE) adds persistent learning to AI agents so they improve from experience without human intervention

Python Latest v0.12.0 · 27d ago Security brief →

Features

  • Persistent memory of successes and failures across agent sessions
  • Automatic strategy extraction and skill‑book updates from user feedback
  • Works with any LLM provider (OpenAI, Anthropic, etc.) without fine‑tuning
  • Reduces token usage and improves consistency on benchmarks

Recent releases

View all 23 releases →
v0.12.0 Breaking risk
⚠ Upgrade required
  • Update any code referencing `record_observation` to use `think`
  • Migrate Skillbook v1 usage to the new v2 schema; legacy aliases are no longer available
Breaking changes
  • Skillbook v1 legacy aliases removed — only Skillbook v2 schema remains
  • `record_observation` renamed to `think`
Notable features
  • RecursiveAgent core abstraction extracted for generic recursive PydanticAI agent with sandbox and microcompaction
  • RR collapsed into a single RRStep, implementing true recursive loop
  • Agentic SkillManager initial tool‑calling loop with atomic mutation tools (add_skill, update_skill, remove_skill, tag_skill) and read‑only tools
Full changelog

This is the merger of two release lines that had not yet shipped to PyPI: the 0.11.0 architectural rewrite and the 0.12.0 SkillManager hardening. Skipping a separate v0.11.0 tag — v0.12.0 supersets it.

0.11.0 — Architectural rewrite

  • RecursiveAgent core abstraction extracted from RR (ace/core/recursive_agent.py). Generic recursive PydanticAI agent with sandbox, microcompaction, default tool set, depth-aware sub-agent registration.
  • RR collapsed into a single RRStep. Orchestrator/worker split, batch machinery, and AttachInsightSourcesStep removed. RR is now a true recursive loop.
  • Skillbook v2 — full schema rewrite, section-grouped storage (context / harness), richer InsightSource provenance, BM25-backed retrieval (rank-bm25 runtime dep). Skillbook.as_prompt() now returns markdown; python-toon dropped.
  • Agentic SkillManager (first cut) — tool-calling loop (ace/implementations/sm_tools.py) with atomic mutation tools (add_skill, update_skill, remove_skill, tag_skill) and read-only tools (search_skills, read_skill).
  • Reflector skillbook tools — Reflector can introspect / propose updates from inside the recursive loop.
  • Anthropic prompt caching enabled by default for RR; cache_read_tokens / cache_write_tokens forwarded in run metadata.
  • Logfire spans around recursive agent sessions.
  • Online / offline mode in the ACE runner.
  • record_observation renamed to think.

0.12.0 — SM hardening

  • Cross-trace generalization gate (four-criterion: ≥3 instances across ≥2 domains, named slot, no API-specific params in action, verifiable runtime trigger). Backed by skill_generalization.md (14 cited sources).
  • Action-equivalence rule — splits on action, not trigger surface.
  • Atomicity rule for insight — one trigger + one action; explicit good/bad shape examples.
  • ICL-grounded insight format drawn from icl_skill_formatting.md: 15-50 word cap, imperative voice, positive framing default.
  • Evidence-only tagging — SM no longer iterates injected_skill_ids; tags only skills the reflection actually implicates.
  • Broaden-via-comparison for UPDATE — same root cause in different niches → broaden issue, don't duplicate.
  • Prompt caching for SM via CachePoint(ttl="5m"), mirroring RR.
  • Hard removal cap removedharmful_count >= 3 no longer auto-REMOVES skills.
  • update_skills signature: source is optional; SkillbookView dropped from parameters.
  • Skillbook v1 legacy aliases removed — v2 is the only schema.

End-to-end retail result (Haiku 4.5)

| Metric | Value |
|---|---|
| Baseline pass@1 | 45.0% |
| With learned skillbook | 67.5% |
| Δ pass@1 | +22.5 pp (12 improved, 3 regressed) |
| Skillbook size | 35 skills |

Tau-bench fix

evaluation_type=ALL_WITH_NL_ASSERTIONS on both run_task and run_tasks call sites in ace-eval/src/ace_eval/e2e/benchmarks/tau_bench.py. Retail and any future benchmark with NL_ASSERTION in reward_basis now produces real reward numbers instead of crashing in reward computation.

See CHANGELOG.md for full details.

openclaw-tracing-v0.1.1 New feature
Notable features
  • Kayba-tracing plugin registers as 'kayba-tracing' and emits structured trace per agent turn including user message, full LLM input/output, tool calls, sessionId, userId, request/response previews, and folder tagging.
  • Capture knobs: captureSystemPrompt (default true), captureHistory (delta|full|none, default delta), maxAttributeBytes (default 64 KiB).
  • Recursively unwraps OpenClaw pre-stringified content fields for clean JSON in trace dashboard.
Full changelog

Initial release of the OpenClaw tracing plugin.

Registers as an OpenClaw plugin (`kayba-tracing`) and ships one structured Kayba trace per agent turn — user message, full LLM input/output with thinking, tool calls, final reply — with sessionId, userId, request/response previews, and folder tagging. No client SDK changes required.

Capture knobs (`plugins.entries.kayba-tracing.config`):

  • `captureSystemPrompt`: capture system prompt once per session (default: true)
  • `captureHistory`: `delta` (default, per-session cursor — eliminates N² bloat) | `full` | `none`
  • `maxAttributeBytes`: per-attribute truncation (default: 64 KiB)

Recursively unwraps OpenClaw's pre-stringified `content` fields so the trace dashboard renders clean JSON instead of multi-level escaped strings.

See `sdk/openclaw/README.md` for setup.

kayba-tracing-ts-v0.10.0 New feature
⚠ Upgrade required
  • Internal API rename: `injectFolderTag` → `injectKaybaContext`; folder, session, and user tags are now emitted via a single `updateCurrentTrace` call
  • `package-lock.json` corrected to remove stale `@kayba/[email protected]` lockfile name and stray `openai`/`dotenv` dependencies
Notable features
  • `kayba.setSession(id) / getSession()` auto‑injects `mlflow.trace.session` metadata on all traces
  • `kayba.setUser(id) / getUser()` auto‑injects `mlflow.trace.user` metadata for per‑user attribution
  • `kayba.updateTrace({ tags, metadata })` provides an escape hatch to attach per‑call values to the active trace
Full changelog

TypeScript SDK release. (No changes to ace-framework or kayba-tracing Python in this release.)

Added

  • kayba.setSession(id) / getSession() — auto-injects mlflow.trace.session metadata on every subsequent trace, so multiple traces produced by the same agent run can be filtered together in the dashboard.
  • kayba.setUser(id) / getUser() — auto-injects mlflow.trace.user metadata for per-user attribution.
  • kayba.updateTrace({ tags, metadata }) — escape hatch for attaching per-call values (e.g. tool call ids) to the active trace.

Changed

  • Internal injectFolderTag renamed to injectKaybaContext; folder, session, and user are now emitted in a single updateCurrentTrace call.
  • package-lock.json corrected (was stuck on a stale @kayba/[email protected] lockfile name with stray openai/dotenv deps).

Back-compat

Additive only — existing callers using configure, trace, startSpan, setFolder are unchanged.

v0.10.0 New feature
Notable features
  • RecursiveConfig.usage_callback fires once per pydantic-ai model request via ace.rr.MeteredModel
  • RRStep, create_rr_agent, create_sub_agent, and RecursiveConfig.subagent_model now accept a pre-built pydantic_ai.models.Model instance in addition to model-id strings
  • create_sub_agent threads an explicit ModelSettings parameter into its PydanticAgent constructor
Full changelog

Added

  • Usage metering hookRecursiveConfig.usage_callback: (RequestUsage, model_id) -> None fires once per pydantic-ai model request (orchestrator turns, sub-agent runs, tool-call follow-ups). Implemented via ace.rr.MeteredModel, a pydantic_ai.models.wrapper.WrapperModel subclass, so metering lives at the framework's own model boundary — one firing site, no per-call-site plumbing. Callback exceptions are caught and logged so metering never crashes the pipeline.
  • Pre-built model instance supportRRStep, create_rr_agent, create_sub_agent, and RecursiveConfig.subagent_model now accept either a model-id string or a pre-built pydantic_ai.models.Model instance. Enables callers that need a custom provider (e.g. a Bedrock model carrying STS-assumed credentials) to inject a fully-configured model rather than resolving from a string.
  • Sub-agent model_settingscreate_sub_agent now threads an explicit ModelSettings parameter into its PydanticAgent constructor.

Back-compat

Existing RRStep(model="...") callers are unchanged. The widened type signatures are additive.

v0.9.5 New feature
Notable features
  • TypeScript tracing SDK @kayba_ai/tracing for Node.js agents
  • Standalone Python tracing package kayba-tracing installable independently
Full changelog

What's new

  • TypeScript tracing SDK (@kayba_ai/tracing) — instrument Node.js agents and send traces to Kayba, mirroring the Python SDK API
  • Standalone Python tracing package (kayba-tracing) — can be installed independently without the full ace-framework
  • ace.tracing continues to work as before (re-exports from kayba-tracing)
  • CI publishes all three packages (ace-framework, kayba-tracing, @kayba_ai/tracing) on release

Weekly OSS security release digest.

The CVE patches and breaking changes that affected production tools this week. One email, every Sunday.

No spam, unsubscribe anytime.

About

Stars
2,244
Forks
277
Languages
Python Shell TypeScript
Downloads/week
18 ↓86%
NPM Maintainers
1
Contributors
30
TypeScript
Types included ✓

Community & Support

Beta — feedback welcome: [email protected]