You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the Issue Tracker and Discussions and did not find an issue that benchmarks modern memory and context-management strategies end to end.
CAMEL already provides useful memory and context-management building blocks:
ChatHistoryMemory, VectorDBMemory, and LongtermAgentMemory
message windows and dense top-k recall
proactive progressive summarization in ChatAgent
manual and agent-driven context summarization
tool-call pruning, snapshot cleanup, and long tool-result truncation/offloading
JSON/Mem0 persistence and Workforce workflow memory
However, the current pieces do not yet form a unified, evaluated memory lifecycle and context-assembly policy.
A code audit of current master found that ScoreBasedContextCreator now preserves the first system message, sorts the remaining records chronologically, and counts tokens; it does not use ContextRecord.score for selection, and its token_limit is retained for API compatibility rather than enforcing a budget. LongtermAgentMemory uses the latest user message for dense retrieval and inserts the retrieved records into chat history, without a shared policy for deduplication, per-layer token budgets, temporal updates, consolidation, or forgetting.
Recent work has also expanded the design space beyond simple chat buffers and vector recall: typed episodic/semantic/procedural memory, recoverable raw event logs, temporal graphs, hybrid retrieval, structured compaction, evaluator-guided retention, agent-controlled memory actions, and cache-aware context editing.
Before CAMEL adopts a specific product or performs a broad memory refactor, we should establish reproducible baselines and determine which abstractions measurably improve agent behavior.
This issue is intended as a research/RFC and benchmark umbrella. Production implementation should be split into focused follow-up issues after the evidence is available.
Research questions
Should durable memory storage and per-call context assembly be separate abstractions?
Should raw interaction/tool trajectories remain the recoverable source of truth, with summaries, facts, graphs, and skills treated as derived views?
Which logical memory types are useful in CAMEL: working, episodic, semantic, procedural, and possibly prospective memory?
Is a strong flat hybrid-retrieval baseline sufficient, and for which workloads does a temporal or multi-relational graph add measurable value?
Which operations should be deterministic policies, agent-callable tools, background jobs, or learned controllers?
How should provenance, writer identity, scope, supersession, confidence, retention, and multi-agent access be represented?
How should context be budgeted across pinned instructions, working state, recent turns, summaries, retrieved memories, tool schemas, and tool results?
Which benchmarks and invariants should gate future memory/context changes?
Research landscape to evaluate
Research reviewed on 2026-07-20 suggests the following families. Recent preprints should be independently reproduced rather than treated as established engineering results.
Family
Core idea
Potential value for CAMEL
Main trade-off
Layered context hierarchy
Stable/pinned prefix, structured working set, recent raw turns, summaries, on-demand retrieval, and cold archive
Separates always-visible state from recoverable long-term data
More lifecycle, synchronization, and budgeting complexity
Ground-truth-preserving episodic memory
Keep raw events/episodes and build replaceable derived indexes
Prevents irreversible information loss and supports audit/rehydration
Define user/agent/task/workforce scopes, isolation, deletion, and memory-poisoning boundaries.
Required baselines
At minimum, compare under the same model, embedding model, reader prompt, token budget, and dataset version:
Full history where it fits
Current CAMEL recent/windowed chat behavior
Current automatic summary + recent messages
Current VectorDBMemory / LongtermAgentMemory
Raw event store + flat hybrid retrieval + reranking + token-budgeted context packing
Baseline 5 + typed memory, temporal supersession, and structured compaction
Optional temporal/graph index, changing only the component under test
Optional agent-controlled memory operations as an experimental tier
Graph-based memory should have an explicit go/no-go decision based on controlled ablations, rather than being assumed to outperform a tuned flat baseline.
Evaluation plan
Use a fixed, reproducible subset when the complete benchmark is too expensive.
Suggested suites:
LongMemEval: extraction, multi-session reasoning, temporal reasoning, knowledge updates, and abstention
LoCoMo for long conversational memory and multi-hop/temporal questions
Mem2ActBench: whether remembered information is actually used in tool choice and parameters
A CAMEL-specific long tool-use trace covering repeated observations, oversized results, unresolved tasks, and multiple compactions
A Workforce scenario covering handoff, shared memory, writer provenance, and agent isolation
Measure both retrieval and downstream use:
task success / final answer quality
Recall@k and MRR/NDCG, with retrieval failures separated from retrieved-but-not-used failures
temporal/update/multi-hop/abstention accuracy
constraint, decision, open-task, and artifact-reference retention after repeated compaction
contradiction rate, stale-fact rate, and incorrect-memory introduction rate
peak/average active input tokens and compression ratio
LLM calls, estimated cost, storage growth, and write/retrieval/compaction p50/p95 latency
prompt-cache read/write tokens or hit rate where available
duplicate/invalid tool calls and tool-call/result sequence validity
cross-agent leakage, poisoning resistance, and deletion/supersession correctness
Deliverables / success criteria
Inventory the existing CAMEL memory/context assembly path and reconcile code, docs, and examples where their described behavior differs.
Produce a comparison matrix for at least 10 representative papers/systems, including representation, write/update policy, retrieval, context assembly, forgetting, provenance, cost, license, and maturity.
Clearly distinguish peer-reviewed work, preprints, official framework guidance, and vendor-reported results.
Add a reproducible benchmark configuration for current CAMEL baselines and at least two candidate policies.
Keep model, embedding, reader, token budget, data version, and seeds controlled; report repeated runs for stochastic results.
Verify that pinned constraints, current goals, key decisions, unresolved work, and tool-call/result validity survive repeated compaction.
Verify that every derived memory can be traced back to recoverable source records.
Report quality/efficiency Pareto results and negative results, not only the best score.
Produce an RFC recommending the smallest useful data model and policy interfaces.
Split any chosen implementation into focused follow-up issues with compatibility and migration plans.
Define graph support, learned memory policies, procedural-memory generation, and prospective memory as explicit go/no-go or later-phase decisions.
The research can be considered successful even if a candidate does not beat the current baseline, provided the setup, negative result, and resulting decision are reproducible.
Non-goals
Selecting a memory vendor from self-reported benchmark scores
Implementing a complete "memory OS" in this issue
Replacing all current memory classes before controlled evidence exists
Duplicating provider/backend integrations, multimodal memory, graph storage, or prompt-only optimization work already tracked elsewhere
Treating a larger context window or prompt cache as a substitute for context selection
Related CAMEL work
This research should coordinate with, not replace:
Required prerequisites
Motivation
CAMEL already provides useful memory and context-management building blocks:
ChatHistoryMemory,VectorDBMemory, andLongtermAgentMemoryChatAgentHowever, the current pieces do not yet form a unified, evaluated memory lifecycle and context-assembly policy.
A code audit of current
masterfound thatScoreBasedContextCreatornow preserves the first system message, sorts the remaining records chronologically, and counts tokens; it does not useContextRecord.scorefor selection, and itstoken_limitis retained for API compatibility rather than enforcing a budget.LongtermAgentMemoryuses the latest user message for dense retrieval and inserts the retrieved records into chat history, without a shared policy for deduplication, per-layer token budgets, temporal updates, consolidation, or forgetting.Recent work has also expanded the design space beyond simple chat buffers and vector recall: typed episodic/semantic/procedural memory, recoverable raw event logs, temporal graphs, hybrid retrieval, structured compaction, evaluator-guided retention, agent-controlled memory actions, and cache-aware context editing.
Before CAMEL adopts a specific product or performs a broad memory refactor, we should establish reproducible baselines and determine which abstractions measurably improve agent behavior.
This issue is intended as a research/RFC and benchmark umbrella. Production implementation should be split into focused follow-up issues after the evidence is available.
Research questions
Research landscape to evaluate
Research reviewed on 2026-07-20 suggests the following families. Recent preprints should be independently reproduced rather than treated as established engineering results.
Candidate architecture to benchmark
This is a research target, not a proposed final API:
Recoverable event/trajectory store
Derived memory views
Pluggable lifecycle policy
retain,update,merge,supersede,forget,retrieve,summarize, andoffloaddecisions.Provider-agnostic context policy/compiler
Observability and governance
Required baselines
At minimum, compare under the same model, embedding model, reader prompt, token budget, and dataset version:
VectorDBMemory/LongtermAgentMemoryGraph-based memory should have an explicit go/no-go decision based on controlled ablations, rather than being assumed to outperform a tuned flat baseline.
Evaluation plan
Use a fixed, reproducible subset when the complete benchmark is too expensive.
Suggested suites:
Measure both retrieval and downstream use:
Deliverables / success criteria
The research can be considered successful even if a candidate does not beat the current baseline, provided the setup, negative result, and resulting decision are reproducible.
Non-goals
Related CAMEL work
This research should coordinate with, not replace:
GraphDBBlocktoLongtermAgentMemoryand addGraphDBMemory#846, [Feature Request] Merge GraphDB memory: #1712, [Feature Request] Add code memory for MCP tool calling workflow #3406Primary references
Peer-reviewed / proceedings:
Representative papers/preprints to reproduce carefully:
Official engineering guidance: