Add model card with paper and code links
#1
by
nielsr
HF Staff
- opened
README.md
CHANGED
|
@@ -1,3 +1,69 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
pipeline_tag: text-generation
|
| 4 |
+
library_name: transformers
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# MemoBrain: Executive Memory as an Agentic Brain for Reasoning
|
| 8 |
+
|
| 9 |
+
**MemoBrain** is an executive memory model for tool-augmented agents that constructs a dependency-aware memory over reasoning steps, capturing salient intermediate states and their logical relations. Operating as a co-pilot alongside the reasoning agent, MemoBrain organizes reasoning progress without blocking execution and actively manages the working context. Specifically, it prunes invalid steps, folds completed sub-trajectories, and preserves a compact, high-salience reasoning backbone under a fixed context budget.
|
| 10 |
+
|
| 11 |
+
- **Paper:** [MemoBrain: Executive Memory as an Agentic Brain for Reasoning](https://huggingface.co/papers/2601.08079)
|
| 12 |
+
- **Repository:** [https://github.com/qhjqhj00/MemoBrain](https://github.com/qhjqhj00/MemoBrain)
|
| 13 |
+
|
| 14 |
+
## Model Description
|
| 15 |
+
|
| 16 |
+
MemoBrain introduces an executive memory system that acts as a cognitive co-pilot for reasoning agents. Unlike traditional approaches that passively accumulate context, MemoBrain actively manages the reasoning trajectory by:
|
| 17 |
+
1. **Memory Construction**: Building a dependency-aware graph of reasoning steps.
|
| 18 |
+
2. **Flush**: Removing invalid or redundant reasoning nodes.
|
| 19 |
+
3. **Fold**: Compressing completed sub-trajectories into compact summaries.
|
| 20 |
+
4. **Context Management**: Maintaining a fixed-size, high-salience reasoning backbone.
|
| 21 |
+
|
| 22 |
+
## Usage
|
| 23 |
+
|
| 24 |
+
The model can be deployed using [vLLM](https://github.com/vllm-project/vllm) and utilized via the `memobrain` Python package.
|
| 25 |
+
|
| 26 |
+
### Basic Usage
|
| 27 |
+
|
| 28 |
+
```python
|
| 29 |
+
import asyncio
|
| 30 |
+
from memobrain import MemoBrain
|
| 31 |
+
|
| 32 |
+
async def main():
|
| 33 |
+
# Step 1: Initialize MemoBrain
|
| 34 |
+
# Assuming model is deployed via vLLM: vllm serve TommyChien/MemoBrain-8B --port 8002
|
| 35 |
+
memory = MemoBrain(
|
| 36 |
+
api_key="EMPTY", # vLLM doesn't require API key
|
| 37 |
+
base_url="http://localhost:8002/v1",
|
| 38 |
+
model_name="TommyChien/MemoBrain-8B"
|
| 39 |
+
)
|
| 40 |
+
|
| 41 |
+
# Step 2: Initialize memory with your task
|
| 42 |
+
memory.init_memory("Solve a complex research problem")
|
| 43 |
+
|
| 44 |
+
# Step 3: Memorize conversation interactions
|
| 45 |
+
# Episodic unit: thinking → tool call → tool response
|
| 46 |
+
await memory.memorize([
|
| 47 |
+
{"role": "assistant", "content": "I need to search for information about Paris..."},
|
| 48 |
+
{"role": "user", "content": "Search results: Paris is the capital of France..."}
|
| 49 |
+
])
|
| 50 |
+
|
| 51 |
+
# Step 4: Optimize memory (flush invalid steps & fold completed sub-trajectories)
|
| 52 |
+
optimized_messages = await memory.recall()
|
| 53 |
+
print(f"Memory optimized: {len(optimized_messages)} messages")
|
| 54 |
+
|
| 55 |
+
asyncio.run(main())
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Citation
|
| 59 |
+
|
| 60 |
+
If you find MemoBrain useful for your research, please cite:
|
| 61 |
+
|
| 62 |
+
```bibtex
|
| 63 |
+
@article{memobrain2026,
|
| 64 |
+
title={MemoBrain: Executive Memory as an Agentic Brain for Reasoning},
|
| 65 |
+
author={Hongjin Qian, Zhao Cao, Zheng Liu},
|
| 66 |
+
journal={arXiv preprint arXiv:2601.08079},
|
| 67 |
+
year={2026}
|
| 68 |
+
}
|
| 69 |
+
```
|