MemCollab: Cross-Agent Memory Framework
- MemCollab is a cross-agent memory framework that aggregates shared solution patterns from diverse LLM-based agents to improve reasoning across tasks.
- It employs contrastive trajectory distillation to extract transferable invariants while filtering out agent-specific biases and heuristics.
- Empirical results demonstrate significant gains in accuracy and efficiency on benchmarks like MATH500 and HumanEval through task-aware memory retrieval.
MemCollab is a cross-agent, collaborative memory framework that enables heterogeneous LLM-based agents to construct, share, and leverage a unified agent-agnostic memory bank, thereby enhancing accuracy and efficiency across mathematical reasoning and code generation tasks. Unlike per-agent memory approaches—which conflate agent-specific heuristics with problem-solving knowledge—MemCollab employs contrastive trajectory distillation to distill shared reasoning invariants that generalize across model families, architectures, and reasoning styles. This architecture supports task-category–conditioned retrieval and serves as a foundation for collective intelligence over distributed LLM agent deployments (Chang et al., 24 Mar 2026).
1. Motivation: Cross-Agent Memory Reuse and Its Limitations
Traditional LLM agent deployments construct and store memory independently per agent, encoding not only shared solution strategies but also model-specific preferences, heuristics, and idiosyncratic tool usage. Given a set of agents , each presented with task , the generated trajectory entwines global task constraints with agent-local peculiarities. Naïvely transferring memory from agent to agent has been shown to degrade downstream performance, as agent-specific bias can conflict with 's reasoning style. Empirical results demonstrate accuracy drops in Qwen-7B on MATH500 when using Qwen-32B-derived memory, underscoring the need for agent-agnostic memory that encodes shared invariants and excludes agent-unique elements (Chang et al., 24 Mar 2026).
2. Formalization: Problem Setup and Agent-Agnostic Memory Construction
MemCollab formalizes the construction of a global memory bank 0 that aggregates knowledge from all available agent trajectories on the training set:
1
The goal is to maximize task accuracy and efficiency for any agent 2 on new task 3 by retrieving a relevant memory slice:
4
Agent-specific memory 5 is formed by distillation solely from 6, whereas ideal agent-agnostic memory 7 captures only shared solution patterns, maximizing transferability.
3. Methodology: Contrastive Trajectory Distillation
The core methodological innovation of MemCollab is to extract abstract, agent-agnostic constraints via contrastive distillation:
- Agents 8 (weaker) and 9 (stronger) solve training instances 0, producing trajectories 1.
- An indicator function 2 identifies the preferred (correct) trajectory 3 and the less-preferred (incorrect) 4.
- A backbone LLM is prompted to contrast 5, extracting pairs of (\emph{violated}, \emph{invariant}) reasoning patterns 6:
7
- Each pair is converted to an abstract memory entry 8“enforce 9”; “avoid 0”1, labeled with the originating task category, and stored in 2.
- No gradient-based training is used; memory extraction and retrieval leverage prompt-based summarization and classification.
This contrastive extraction is interpretable as maximizing a proxy InfoNCE objective over positive/negative trajectory pairs:
3
where 4 is a trajectory-memory scoring function (Chang et al., 24 Mar 2026).
4. Task-Aware Memory Retrieval and Inference
At inference, a task-aware retrieval pipeline conditions memory access on relevant categories:
- The inference agent 5 first uses its backbone LLM to predict the tuple 6—the coarse and fine category of the query 7 (e.g., “Algebra”, “Quadratic Equations”).
- Category filtering restricts retrieval to
8
- Relevance ranking is performed via TF–IDF or embedding similarity between 9 and 0.
- The top 1 memory entries (default 2) are selected.
- These constraints serve as soft prompts to 3 during solution generation, enforcing valuable invariants and discouraging known failure paths; concrete output 4.
This architecture ensures that only category-applicable, agent-neutral constraints participate in inference-time guidance, balancing informativeness and noise (Chang et al., 24 Mar 2026).
5. Empirical Evaluation: Benchmarks, Accuracy, and Efficiency
Empirical studies validate MemCollab's improvements on mathematical and code-generation benchmarks. Representative datasets include MATH500, GSM8K, MBPP, and HumanEval. Primary metrics are exact match accuracy (math) and pass@1 (code).
| Backbone | Vanilla | Self-Contrast | MemCollab | Δ over Vanilla |
|---|---|---|---|---|
| Qwen-7B | 57.1 | 67.5 | 71.6 | +14.5% |
| Qwen-32B | 70.8 | 77.4 | 79.6 | +8.8% |
| LLaMA-8B | 41.7 | — | 53.9 | +12.2% |
Across Qwen-7B, MemCollab reduces average reasoning turns per problem: on MBPP from 3.1 to 1.4, on HumanEval from 3.3 to 1.5. Ablation demonstrates that performance increases up to 5 retrieved constraints, then declines due to noise. The two-stage retrieval (classification + similarity ranking) outperforms prompt selection or single-stage retrieval (Chang et al., 24 Mar 2026).
6. Design Insights, Limitations, and Future Directions
MemCollab’s contrastive methodology successfully isolates transferable solution invariants and removes agent-level artifacts. It distills concise, abstract constraints and prunes known failure modes, thereby serving as a generalizable reasoning resource. Limitations include:
- Over-retrieval introduces irrelevant or weakly correlated constraints, degrading accuracy.
- Memory quality depends on the fidelity of trajectory discrimination and summarization prompts.
- The cap on 6 memory entries per task may under-summarize highly complex cases.
Future avenues include scaling to larger and dynamically composed agent pools, integrating more sophisticated re-ranking of memory entries, jointly optimizing retrieval/summarization modules, and annotating memory with richer tool or solution structure. Extensions to domains with fine-grained tool use and non-trivial task taxonomies are suggested as fertile ground for MemCollab (Chang et al., 24 Mar 2026).
7. Broader Context in Multi-Agent Memory Collaboration
MemCollab represents one approach in a spectrum of multi-agent collaborative memory work. Complementary lines include reinforcement-learning–driven inter-agent optimization (Mao et al., 13 Mar 2026), mesh memory protocols for long-term multi-session agent state sharing (Xu, 21 Apr 2026), and multimodal/robotic memory frameworks employing memoization and geometric plan cache search (Wang et al., 28 Jan 2026). In contrast, MemCollab’s core contribution is its contrastive extraction of agent-agnostic knowledge, which empirically demonstrates strong gains in cross-agent transfer, correctness, and computational efficiency in heterogeneous LLM deployments.