Agent KB: Universal Memory for AI Agents
- Agent KB is a universal shared memory infrastructure aggregating execution trajectories, which enhances agentic reasoning and accelerates adaptation to new tasks.
- It employs a hybrid lexical-semantic retrieval mechanism, blending BM25 and MiniLM embeddings to accurately extract and structure relevant experiences.
- Its RESTful API and disagreement gate enable seamless integration across frameworks, promoting collective agent intelligence without retraining.
Agent KB is a universal shared memory infrastructure enabling heterogeneous AI agent frameworks to exchange and leverage problem-solving experiences without retraining or architectural entanglement. It addresses the fragmentation and knowledge isolation prevalent in contemporary agent systems by aggregating and structuring execution trajectories—action sequences, reasoning traces, and goal constraints—across diverse platforms into a unified, high-utility knowledge base accessible via standardized APIs. The result is enhanced agentic reasoning, accelerated adaptation to new tasks, and empirical gains in complex reasoning and code-generation benchmarks, establishing a foundation for collective agent intelligence (Tang et al., 8 Jul 2025).
1. System Architecture and Knowledge Representation
Agent KB formalizes experience aggregation as the construction and continual updating of a structured knowledge base: where:
- denotes a task embedding generated by an all-MiniLM-L6-v2 encoder applied to a task statement ;
- encodes goal constraints as structured predicates (e.g., success criteria, domain parameters);
- is the ordered sequence of action/reasoning pairs from an agent’s trajectory;
- bundles cross-framework compatibility metadata.
Experience utility is tracked with a running score updated by
where is an observed reward (e.g., successful task completion) and is a learning rate; low-utility items are evicted under memory pressure.
Agent KB employs hybrid lexical-semantic similarity metrics for retrieval: a weighted combination of BM25 (lexical) and MiniLM-embedding cosine similarity,
0
where 1 tunes the blend of lexical and semantic scoring. Length normalization ensures fair fusion.
2. Hybrid Retrieval Workflow and Disagreement Gate
Agent KB operates as a mediation layer in the typical agent “solve” loop, with two key retrieval hooks:
- Planning Stage: The agent issues a planning query 2 derived via an internal reasoning step; Agent KB retrieves the top-3 relevant experiences 4 and provides them to a refinement module that proposes an initial plan.
- Feedback Stage: After plan execution, the agent summarizes feedback information 5 (e.g., traces, error states). Agent KB retrieves candidate experiences 6 relevant to this post hoc state, yielding suggested plan fixes.
Pseudocode abstraction: 3
A disagreement gate ensures that refinement does not disrupt agentic autonomy; only plan updates exceeding a similarity threshold 7 (cosine similarity on MiniLM embeddings, typically 8) are adopted: 9
3. API and Framework Integration
Agent KB exposes lightweight RESTful interfaces enabling integration with arbitrary agent frameworks, without requiring model retraining:
POST /experienceingests experiences.GET /retrieve/planning?query=<...>&k=<int>returns the top-0 planning experiences for a provided task description.GET /retrieve/feedback?feedback=<...>&k=<int>returns feedback-relevant experiences keyed on execution traces.
Typical usage pattern involves synchronous retrieval and plan refinement inside agentic inference, supporting interleaved cross-framework workflows.
4. Empirical Evaluation and Ablations
Experimental results span major agent frameworks (smolagents, OpenHands, OWL, SWE-Agent) and multiple model backbones (GPT-4o, GPT-4.1, Claude-3.7, Qwen-3 32B, DeepSeek-R1, o3-mini), validated on reasoning and code completion benchmarks:
| Benchmark | Agent/Backbone | Baseline Pass@1 | Agent KB Pass@k | 1 |
|---|---|---|---|---|
| GAIA, pass@3 | smolagents/GPT-4.1 | 55.2% | 73.9% | +18.7pp |
| GAIA, pass@1 | OWL/GPT-4o | 43.6% | 63.6% | +20.0pp |
| GPQA, pass@1 | OpenHands | 62.6% | 72.7% | +10.1pp |
| SWE-bench, 50 its | OpenHands/GPT-4.1 | 24.3% | 38.7% | +14.4pp |
Ablation studies demonstrate:
- Removing either planning or feedback retrieval reduces accuracy (2 pp per stage on GAIA),
- Hybrid lexical-semantic retrieval outperforms exclusive modalities,
- The “reason–retrieve–refine” modular design and the disagreement gate are both critical,
- Automatically distilled experiences achieve parity with manual curation (75.15% vs 76.97% pass@1).
These findings attest to robust, cross-stack generalization and efficiency advantages.
5. Comparative Context and Theoretical Positioning
Agent KB’s cross-system memory architecture addresses a defining limitation of agentic systems: lack of universal, composable, and retrievable experience representations. Distinct from “single-agent” or “framework-bound” demonstration stores, Agent KB abstracts workflows and diagnostic fixes for plug-and-play reuse across disparate agent capacities, languages, and backbones, enabled by semantic normalization and metadata encoding (Tang et al., 8 Jul 2025).
Related efforts in multi-agent coordination (e.g., knowledge-base-aware orchestration (Trombino et al., 23 Sep 2025), graph-structured tool/agent retrieval (Nizar et al., 22 Nov 2025)) share the objective of leveraging structured experience and capability metadata to improve reasoning, orchestration, and retrieval in heterogeneous agent ensembles. However, Agent KB is unique in its cross-framework, non-retraining, and experience-first universal sharing paradigm.
6. Limitations, Transfer, and Future Extensions
Empirical evidence points to notable transfer asymmetry: experiences grounded in software engineering tasks are less portable to pure reasoning domains and vice versa. Extension to richer modalities (e.g., image-based workflows, long-document contexts), longer-horizon inter-agent plans, or multi-agent active learning will likely require hierarchical indexing and deeper abstractions. Further research opportunities include dynamic experience chaining, provenance-linked retrieval, and agent–agent collaborative exchange protocols (Tang et al., 8 Jul 2025).
A plausible implication is that as agentic environments become more complex and multi-modal, scalable shared memory solutions akin to Agent KB will be crucial for maintaining empirical performance improvements and enabling stable emergent collective intelligence across agent ecosystems.