diff --git a/docs/index.md b/docs/index.md index 3ee78c4a..5cbbcb56 100644 --- a/docs/index.md +++ b/docs/index.md @@ -27,16 +27,19 @@ kernelspec: ReMe provides AI agents with a unified memory system—enabling the ability to extract, reuse, and share memories across users, tasks, and agents. -``` -Personal Memory + Task Memory + Tool Memory = Agent Memory +Agent memory can be viewed as: + +```text +Agent Memory = Long-Term Memory + Short-Term Memory + = (Personal + Task + Tool) Memory + (Working Memory) ``` -Personal memory helps "**understand user preferences**", task memory helps agents "**perform better**", and tool memory enables "**smarter tool usage**". +Personal memory helps "**understand user preferences**", task memory helps agents "**perform better**", and tool memory enables "**smarter tool usage**". Working memory provides **short-term contextual memory** by keeping recent reasoning and tool results compact and accessible without overflowing the model's context window. ## Architecture Design

- ReMe Logo + ReMe Logo

ReMe integrates three complementary memory capabilities: @@ -83,6 +86,25 @@ Data-driven tool selection and usage optimization Learn more about how to use tool memory from [tool memory](tool_memory/tool_memory.md) +:::{admonition} Working Memory +:class: note + +Short‑term contextual memory for long‑running agents via **message offload & reload**: + +- **Message Offload**: Compact large tool outputs to external files or LLM summaries +- **Message Reload**: Search (`grep_working_memory`) and read (`read_working_memory`) offloaded content on demand + +**📖 Concept & API**: +- Message offload overview: [Message Offload](work_memory/message_offload.md) +- Offload / reload operators: [Message Offload Ops](work_memory/message_offload_ops.md), [Message Reload Ops](work_memory/message_reload_ops.md) + +**💻 End‑to‑End Demo**: +- Working memory quick start: [Working Memory Quick Start](cookbook/working/quick_start.md) +- ReAct agent with working memory: [react_agent_with_working_memory.py](../cookbook/working_memory/react_agent_with_working_memory.py) +- Runnable demo: [work_memory_demo.py](../cookbook/working_memory/work_memory_demo.py) + +::: + --- ## 📦 Ready-to-Use Memories diff --git a/docs/work_memory/message_offload_ops.md b/docs/work_memory/message_offload_ops.md index 9dbbf45f..d3965918 100644 --- a/docs/work_memory/message_offload_ops.md +++ b/docs/work_memory/message_offload_ops.md @@ -18,7 +18,20 @@ kernelspec: ### Purpose -Manages context window limits by intelligently offloading message content through compaction and compression strategies to reduce token usage while preserving important information. +As AI agents evolved from simple chatbots to sophisticated autonomous systems, the focus shifted from "prompt engineering" to "context engineering". Agentic systems work by binding LLMs with tools and running them in a loop where the agent decides which tools to call and feeds results back into the message history. This creates a **context explosion** problem: + +- **Rapid Growth**: A seemingly simple task can trigger 50+ tool calls, with production agents often running hundreds of conversation turns +- **Large Outputs**: Each tool call can return substantial text, consuming massive amounts of tokens +- **Memory Pressure**: The context window quickly fills up as messages and tool results accumulate chronologically + +When context grows too large, model performance degrades significantly—a phenomenon known as **"context rot"**: + +- **Repetitive Responses**: The model starts generating redundant or circular answers +- **Slower Reasoning**: Inference becomes noticeably slower as context length increases +- **Quality Degradation**: Overall response quality and coherence decline +- **Lost Focus**: The model struggles to identify relevant information in the bloated context + +**MessageOffloadOp** addresses this fundamental challenge by managing context window limits through intelligent offloading strategies. It implements compaction and compression techniques to reduce token usage while preserving important information, enabling agents to handle arbitrarily long conversations and complex tasks while maintaining optimal performance throughout. ### Functionality