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
Restructure memory documentation and add missing eager creation tool
- Restructure working-memory.md to focus on messages and data first, then structured memories
- Combine data examples and improve conversation context examples
- Add comprehensive section on producing long-term memories from working memory
- Cover both server-side and client-side extraction approaches
- Update long-term-memory.md to refer to working memory for automatic promotion
- Add manual creation examples with both API and LLM tool usage
- Add missing create_long_term_memory tool schema to Python client
- Update Python SDK docs with correct tool names (not the non-existent ones)
- Add tool call handler and resolver for eager memory creation
- All client tests passing
By default, the system automatically extracts structured memories from
204
-
conversations so they flow from working memory to long-term storage. This
205
-
happens in a background process after clients update working memory. This
206
-
extraction process can be customized using different **memory strategies**.
203
+
There are two main ways to create long-term memories:
207
204
208
-
The extraction strategy is set in the working memory session and controls what
209
-
the server extracts into long-term memory. When you give an LLM the ability to
210
-
store long-term memories as a tool, the tool description includes information
211
-
about the configured extraction strategy, helping the LLM understand what types
212
-
of memories to create.
205
+
### 1. Automatic Promotion from Working Memory
213
206
214
-
!!! info "Memory Strategies"
215
-
The system supports multiple extraction strategies (discrete facts, summaries, preferences, custom prompts) that determine how conversations are processed into memories. The extraction strategy set in working memory is visible to LLMs through strategy-aware tool descriptions. See [Memory Extraction Strategies](memory-extraction-strategies.md) for complete documentation and examples.
207
+
The most common approach is to let the system automatically promote memories from working memory to long-term storage. This handles extraction strategies, background processing, and batch optimization.
208
+
209
+
!!! info "Working Memory Integration"
210
+
For automatic memory promotion from conversations, see the [Working Memory documentation](working-memory.md). This covers extraction strategies, background processing, and how to configure the memory server to automatically create long-term memories from conversation content.
211
+
212
+
### 2. Manual Creation via API
213
+
214
+
For immediate storage of important facts, you can create long-term memories directly using the API or LLM tools.
215
+
216
+
#### Direct API Calls
217
+
218
+
```python
219
+
# Create memories directly via Python client
220
+
await client.create_long_term_memories([
221
+
{
222
+
"text": "User prefers dark mode interfaces",
223
+
"memory_type": "semantic",
224
+
"topics": ["preferences", "ui"],
225
+
"entities": ["dark mode"],
226
+
"user_id": "user_123"
227
+
},
228
+
{
229
+
"text": "User completed Python certification on January 15, 2024",
230
+
"memory_type": "episodic",
231
+
"event_date": "2024-01-15T10:00:00Z",
232
+
"topics": ["education", "certification"],
233
+
"entities": ["Python certification"],
234
+
"user_id": "user_123"
235
+
}
236
+
])
237
+
```
238
+
239
+
#### LLM Tool Usage (Eager Creation)
240
+
241
+
Your LLM can use the `create_long_term_memory` tool for immediate storage:
1.**`eagerly_create_long_term_memory`** - Eagerly create a long-term memory by making an API request
218
-
2.**`lazily_create_long_term_memory`** - Lazily create a long-term memory by adding it to working memory (does not require an immediate network request; does require saving working memory afterward)
219
-
3.**`search_long_term_memory`** - Search with semantic similarity
220
-
4.**`edit_memory`** - Update existing memories
221
-
5.**`delete_memory`** - Remove memories
222
-
6.**`set_working_memory`** - Update or create a working memory session
223
-
7.**`get_or_create_working_memory`** - Retrieve or create a working memory session
217
+
1.**`create_long_term_memory`** - Eagerly create long-term memories by making an API request
218
+
2.**`add_memory_to_working_memory`** - Lazily create memories by adding them to working memory (promoted to long-term storage later)
219
+
3.**`search_memory`** - Search with semantic similarity across long-term memories
0 commit comments