[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-72548":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":22,"archived":23,"fork":23,"defaultBranch":24,"hasWiki":25,"hasPages":25,"topics":26,"createdAt":10,"pushedAt":10,"updatedAt":38,"readmeContent":39,"aiSummary":40,"trendingCount":16,"starSnapshotCount":16,"syncStatus":41,"lastSyncTime":42,"discoverSource":43},72548,"agentic-context-engine","kayba-ai\u002Fagentic-context-engine","kayba-ai","🧠 Make your agents learn from experience. Now available as a hosted solution at kayba.ai ","https:\u002F\u002Fwww.kayba.ai",null,"Python",2332,284,17,7,0,79,89,123,237,109.36,"MIT License",false,"main",true,[27,28,29,30,31,32,33,34,35,36,37],"agent-learning","agent-memory","agents","ai","ai-agents","ai-tools","context-engineering","llm","machine-learning","memory","python","2026-06-12 04:01:06","\u003Ca href=\"https:\u002F\u002Fkayba.ai\">\u003Cimg src=\"assets\u002Fkayba-banner.png\" alt=\"Kayba - Make your agents self-improve from experience\" width=\"1080\"\u002F>\u003C\u002Fa>\n\n# Agentic Context Engine (ACE)\n\n![GitHub stars](https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fkayba-ai\u002Fagentic-context-engine?style=social)\n[![Kayba Website](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fkayba.ai-6B8BA8?style=flat&logo=data:image\u002Fpng;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAIpElEQVR42q1XbWwU1xU9d2Z29sPe2V3jyHVwDNixkiBiqKKixA1IBloKCRJSAaU4ip0PhaiJE0JSqSU\u002FWqlpihpXiaJGmJBGSiGOEj4MjsuHhDApENzEjYHaxTbGJUUuBsvaHXt3vbuzM6c\u002F1l6MvW7+5EpPu\u002Ft23rvnnvfm3HsFgArAzsvLu1\u002FTtF+SrAYQBKDguzUHgCkipyyRHfFI5AIAVQDA7\u002FevE5E9IhIgp64hAJmxkwggItmRWUOQhENmliHXPpx4nmMiUmuaZrPk5+cvVBSlQ0S8JNMZRkRy7AIRgaqqsG0HyWQCqVQKjuMAABRFhdutw+32QASwbWcagOwXW0Q0kilFUX6giai\u002FFsGkc23agqypqoZ02oJpmvB6vZi\u002FYAHmlZaisLAQiqJgeHgYl\u002Fv7MTAwADoODMOAoigTAGVyTwGgkUyLiO44zm\u002FEMIxhEZlDZh+YGvOEcxWmGUEwGMRjjz2GjRs2YunSpfDl+QAAdtrG+Pg4TNPEpUuX0PTxxzh48ADGx8fh9XpBTg9IKAI4pCmGYSQAceekHAJFVRCJRLB27Vq8\u002FtvXseT7SwAAHR0dOHz4MDo6OnD9+nVYloX8vHyUlZdhcWUlUpaF5uZm9Pf3Q1XV20BM3AMASMMwjIRhGMw1CgoKCIAvvPACU8kkSXJgYIBPPPEEjUCAE7zmHHPvnMuqqioWFRXR7\u002FczEAjk8mHlYCBzXpqmIRwOY9OmTfho70eZqP\u002FRgdraWvT29kJEcN999+Ghhx7C3eV3w+P1IBwOo7u7G+3t7RgcHITH44HH44HjOFOjnmqTDExFF2AwGKTP5+OCBQt47T\u002FXmE6n2dXVxbvuuosAWFRUxIaGBl7\u002F73VONytlsedSD7dt20afz8f8\u002FHwGg0HOwrKV8wgmqX\u002FzD2+SJGPRGNesWUMALCkpYVtbW8ZZ0mLn151sOdzC5uZmfvXlV4xFY1kwB\u002FYfoGEY\u002Fw\u002FETACBQID5+fksKvoeey71kCT\u002F2tpKXdfpdru55y97SJKdX3dy3bp1LCwspNvtpsfjYUFBAVetXMVjx44xmcjcmU8++YS6rjMQCOS6BzMBhEIhqqrKVatWMRaN0bEdPv\u002Fz5wmA1dXVTCaT7LnU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bd68cZO5LBaNcWRkhPfee282ZwxcGaBt2zz9t9P0+Xy55PgWA4ZxiwUR4aZNm0iSO3bsoMfjoaIoVFWVlfdX8qWXXmLjzkZevXqVfX193Lp1Kx999FFGo1Hu3r2bJXNL2H6unalkhpXq6mpqmjYRvTEbAzOz4SvbXiFJtp1s44MPPkiXy3Vb0XH69GmeOHEi+\u002Fu5555jMplkV1cXU4kU6ZAv1r84Wx6YPR0bgQBDoRABsK62jqlkiiS579N9rKmp4eLFi+n3+\u002Fn5qc957tw5lpeXs6amhvs+3cdwOELHdhiPxTPORaaf+1QWcgEITMmMGSYqKyv5Wctn2fMeGxtjd3c3BwcHOTw8zBtDN7L\u002F2WmbZ8+e5YoVKwhgFuczSjK4Z2tnNE1DNBqF4zhYvnw5Nvx0Ax5++GHMnz8fLpcLJGFZFgYHB3HhwgUcOnwYra2tSCTGEQgEZkjv9JJMDMMYBmTOlLp9Sh2f+VQUFQAxNjYG27YRDIZw553FKCgogCIKRsdGMXR9CDeHb8JxCMMwoKoKbNuezTEBAemMimEY+0Rkw63GRHI2JoBAVRVABGkrDctKZaNTFBW67oLL5co0gY6TqwCdaraIqCRbJC8vb5Gqqh0i4r7Vmk1nYmbRckvTJdsXfovTyZbLmXBuichSJRaLdYnIz0hGRUTL9IXIycAkLpKgQziOA8exp0Q8y9Jb8zLhPCYiNaZpnlcBqMlk8l8ej+cYyTkA7gCgT6L9DocNIAzgqIg8bZrmCQDq\u002FwBcV6BSGdN3ewAAAABJRU5ErkJggg==&logoColor=white)](https:\u002F\u002Fkayba.ai)\n[![Discord](https:\u002F\u002Fimg.shields.io\u002Fdiscord\u002F1429935408145236131?label=Discord&logo=discord&logoColor=white&color=5865F2)](https:\u002F\u002Fdiscord.gg\u002FmqCqH7sTyK)\n[![Twitter Follow](https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fkaybaai?style=social)](https:\u002F\u002Ftwitter.com\u002Fkaybaai)\n[![Documentation](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocs-latest-blue.svg)](https:\u002F\u002Fkayba-ai.github.io\u002Fagentic-context-engine\u002Flatest\u002F)\n\n> [!TIP]\n> ### Try our hosted solution for free at [kayba.ai](https:\u002F\u002Fkayba.ai): automated agent self-improvement from your terminal. CLI + dashboard that analyzes traces, surfaces failures, and ships improvements directly from Claude Code, Codex, and more.\n> [![Kayba Pro](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FKayba_Pro-Start_Free_Trial-4A6B80?style=for-the-badge)](https:\u002F\u002Fkayba.ai)\n\n---\n\n**AI agents don't learn from experience.** They repeat the same mistakes every session, forget what worked, and ignore what failed. ACE adds a persistent learning loop that makes them better over time.\n\n\u003Cimg src=\"examples\u002Fseahorse-emoji-ace.gif\" alt=\"ACE learns from mistakes in real time\" width=\"70%\"\u002F>\n\n> The agent claims a seahorse emoji exists. ACE reflects on the error, and on the next attempt, the agent responds correctly — without human intervention.\n\n---\n\n## Proven Results\n\n| Metric | Result | Context |\n|:-------|:-------|:--------|\n| **2x consistency** | Doubles pass^4 on Tau2 airline benchmark | 15 learned strategies, no reward signals |\n| **49% token reduction** | Browser automation costs cut nearly in half | 10-run learning curve |\n| **$1.50 learning cost** | Claude Code translated 14k lines to TypeScript | Zero build errors, all tests passing |\n\n---\n\n## Quick Start\n\n```bash\nuv add ace-framework\n```\n\n**Option A** — Interactive setup (recommended):\n\n```bash\nace setup            # Walks you through model selection, API keys, and connection validation\n```\n\n**Option B** — Manual configuration:\n\n```bash\nexport OPENAI_API_KEY=\"your-key\"    # or ANTHROPIC_API_KEY, or any of 100+ supported providers\n```\n\nThen use it:\n\n```python\nfrom ace import ACELiteLLM\n\nagent = ACELiteLLM(model=\"gpt-4o-mini\")\n\n# First attempt — the agent may hallucinate\nanswer = agent.ask(\"Is there a seahorse emoji?\")\n\n# Feed a correction — ACE extracts a strategy and updates the Skillbook\nagent.learn_from_feedback(\"There is no seahorse emoji in Unicode.\")\n\n# Subsequent calls benefit from the learned strategy\nanswer = agent.ask(\"Is there a seahorse emoji?\")\n\n# Inspect what the agent has learned\nprint(agent.get_strategies())\n```\n\nNo fine-tuning, no training data, no vector database.\n\n[-> Quick Start Guide](https:\u002F\u002Fkayba-ai.github.io\u002Fagentic-context-engine\u002Flatest\u002Fgetting-started\u002Fquick-start\u002F) | [-> Setup Guide](https:\u002F\u002Fkayba-ai.github.io\u002Fagentic-context-engine\u002Flatest\u002Fgetting-started\u002Fsetup\u002F) | [-> Hosted API: Where Do Traces Come From?](https:\u002F\u002Fkayba-ai.github.io\u002Fagentic-context-engine\u002Flatest\u002Fintegrations\u002Fhosted-api\u002F#where-do-traces-come-from)\n\n---\n\n## How It Works\n\nACE maintains a **Skillbook** — a persistent collection of strategies that evolves with every task. Three specialized roles manage the learning loop:\n\n| Role | Responsibility |\n|:-----|:---------------|\n| **Agent** | Executes tasks, enhanced with Skillbook strategies |\n| **Reflector** | Analyzes execution traces to extract what worked and what failed |\n| **SkillManager** | Curates the Skillbook — adds, refines, and removes strategies |\n\nThe **Recursive Reflector** is the key innovation: instead of summarizing traces in a single pass, it writes and executes Python code in a sandboxed environment to programmatically search for patterns, isolate errors, and iterate until it finds actionable insights.\n\n```mermaid\nflowchart LR\n    Skillbook[(Skillbook)]\n    Start([Task]) --> Agent[Agent]\n    Agent \u003C--> Environment[Environment]\n    Environment -- Trace --> Reflector[Reflector]\n    Reflector --> SkillManager[SkillManager]\n    SkillManager -- Updates --> Skillbook\n    Skillbook -. Strategies .-> Agent\n```\n\nAll roles are backed by [PydanticAI](https:\u002F\u002Fai.pydantic.dev\u002F) agents with structured output validation. PydanticAI routes to 100+ LLM providers through its LiteLLM integration, with native support for OpenAI, Anthropic, Google, Bedrock, Groq, and more.\n\n*Based on the [ACE paper](https:\u002F\u002Farxiv.org\u002Fabs\u002F2510.04618) (Stanford & SambaNova) and [Dynamic Cheatsheet](https:\u002F\u002Farxiv.org\u002Fabs\u002F2504.07952).*\n\n---\n\n## Runners\n\n| Runner | Class | Description |\n|:-------|:------|:------------|\n| **LiteLLM** | `ACELiteLLM` | Batteries-included agent with `.ask()`, `.learn()`, `.save()` — accepts any [LiteLLM model string](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002Fproviders) |\n| **Core** | `ACE` | Full learning loop with batch epochs and evaluation |\n| **Trace Analyser** | `TraceAnalyser` | Learn from pre-recorded traces without re-running tasks |\n| **browser-use** | `BrowserUse` | Browser automation that improves with each run |\n| **LangChain** | `LangChain` | Wrap any LangChain chain or agent with learning |\n| **Claude Code** | `ClaudeCode` | Claude Code CLI tasks with learning |\n\n```bash\nuv add 'ace-framework[browser-use]'    # Browser automation\nuv add 'ace-framework[langchain]'      # LangChain\nuv add 'ace-framework[logfire]'        # Observability (auto-instruments PydanticAI)\nuv add 'ace-framework[mcp]'            # MCP server for IDE integration\nuv add 'ace-framework[deduplication]'  # Embedding-based skill deduplication\n```\n\nHave existing agent logs? Extract strategies from them directly:\n\n```python\nfrom ace import ACELiteLLM\n\nagent = ACELiteLLM(model=\"gpt-4o-mini\")\nagent.learn_from_traces(your_existing_traces)\nprint(agent.get_strategies())\n```\n\n[-> Examples](examples\u002F)\n\n---\n\n## Benchmarks\n\n### Tau2 — Multi-Step Agentic Tasks\n\n[tau2-bench](https:\u002F\u002Fgithub.com\u002Fsierra-research\u002Ftau2-bench) by Sierra Research: airline domain tasks requiring tool use and policy adherence. Claude Haiku 4.5 agent, strategies learned on the train split with no reward signals, evaluated on the held-out test split.\n\n\u003Cimg src=\"benchmarks\u002Ftasks\u002Ftau_bench\u002FTau2Benchmark Result Haiku4.5.png\" alt=\"Tau2 Benchmark — ACE doubles consistency at pass^4\" width=\"35%\"\u002F>\n\n*pass^k = probability all k independent attempts succeed. ACE doubles consistency at pass^4 with 15 learned strategies.*\n\n### Claude Code — Autonomous Translation\n\nACE + Claude Code translated this library from Python to TypeScript with zero supervision:\n\n| Metric | Result |\n|:-------|:-------|\n| Duration | ~4 hours |\n| Commits | 119 |\n| Lines written | ~14,000 |\n| Build errors | 0 |\n| Tests | All passing |\n| Learning cost | ~$1.50 |\n\n---\n\n## Pipeline Architecture\n\nACE is built on a composable pipeline engine. Each step declares what it requires and what it produces:\n\n```\nAgentStep -> EvaluateStep -> ReflectStep -> UpdateStep -> DeduplicateStep\n```\n\nUse `learning_tail()` for the standard learning sequence, or compose custom pipelines:\n\n```python\nfrom ace import Pipeline, AgentStep, EvaluateStep, learning_tail\n\nsteps = [AgentStep(agent, skillbook), EvaluateStep(env)] + learning_tail(reflector, skill_manager, skillbook)\npipeline = Pipeline(steps)\n```\n\nThe pipeline engine ([`pipeline\u002F`](pipeline\u002F)) is framework-agnostic with `requires`\u002F`provides` contracts, immutable context, and error isolation. See [Pipeline Design](docs\u002Fdesign\u002FPIPELINE_DESIGN.md) and [Architecture](docs\u002Fdesign\u002FACE_ARCHITECTURE.md).\n\n---\n\n## CLI\n\n| Command | Description |\n|:--------|:------------|\n| `ace setup` | Interactive setup — model selection, API keys, connection validation |\n| `ace models \u003Cquery>` | Search available models with pricing |\n| `ace validate \u003Cmodel>` | Test a model connection |\n| `ace config` | Show current configuration |\n| `kayba` | Cloud CLI — upload traces, fetch insights, manage prompts |\n| `ace-mcp` | MCP server for IDE integration |\n\n---\n\n## Documentation\n\n- [Full Documentation](https:\u002F\u002Fkayba-ai.github.io\u002Fagentic-context-engine\u002Flatest\u002F) — Guides, API reference, examples\n- [Quick Start](https:\u002F\u002Fkayba-ai.github.io\u002Fagentic-context-engine\u002Flatest\u002Fgetting-started\u002Fquick-start\u002F) — 5-minute setup\n- [Setup Guide](https:\u002F\u002Fkayba-ai.github.io\u002Fagentic-context-engine\u002Flatest\u002Fgetting-started\u002Fsetup\u002F) — Configuration and providers\n- [Hosted API Guide](https:\u002F\u002Fkayba-ai.github.io\u002Fagentic-context-engine\u002Flatest\u002Fintegrations\u002Fhosted-api\u002F) — Hosted CLI, trace upload, prompt install\n- [Architecture](docs\u002Fdesign\u002FACE_ARCHITECTURE.md) — Core concepts and system design\n- [Code Reference](docs\u002Fdesign\u002FACE_REFERENCE.md) — Implementations, API, usage examples\n- [Design Decisions](docs\u002Fdesign\u002FACE_DECISIONS.md) — Rejected alternatives and rationale\n- [Pipeline Engine](docs\u002Fdesign\u002FPIPELINE_DESIGN.md) — Step composition and context flow\n- [Examples](examples\u002F) — Runnable demos\n- [Changelog](CHANGELOG.md) — Version history\n\n---\n\n## Contributing\n\nContributions are welcome. See [Contributing Guidelines](CONTRIBUTING.md).\n\n---\n\n\u003Cdiv align=\"center\">\n\n**Built by [Kayba](https:\u002F\u002Fkayba.ai) and the open-source community.**\n\n\u003C\u002Fdiv>\n","Agentic Context Engine (ACE) 是一个让AI代理能够从经验中学习的工具。它通过提供一种机制，使AI代理能够在执行任务时积累和利用上下文信息，从而实现自我改进。项目基于Python开发，具有强大的记忆管理和机器学习功能，适用于需要长期交互并能从中学习的应用场景，如客户服务、个性化推荐系统等。此外，该项目还提供了托管解决方案，方便用户快速部署使用。",2,"2026-06-11 03:42:31","high_star"]