CEMS exposes six memory management tools through the Model Context Protocol.
memory_search
Search memories using a unified 5-stage retrieval pipeline: query synthesis, vector+graph search, relevance filtering, temporal ranking, and token budgeting.
Example
result = memory_search(
query="database optimization techniques",
scope="both",
max_results=5,
enable_graph=True,
enable_query_synthesis=True
)
Response
{
"success": true,
"results": [
{
"id": "mem_123",
"content": "PostgreSQL indexing strategies...",
"score": 0.92,
"category": "technical",
"scope": "personal",
"created_at": "2024-02-15T10:30:00Z"
}
],
"count": 1,
"query_synthesis_used": true
}
memory_add
Store a memory in personal or shared namespace.
Example
result = memory_add(
content="Alice prefers dark mode and uses PostgreSQL",
scope="personal",
category="preferences",
tags=["ui", "database"],
infer=True
)
Bulk Import Example
# For bulk imports, disable inference for 10x speed improvement
for item in large_dataset:
memory_add(
content=item.text,
scope="shared",
infer=False, # Much faster for bulk operations
source_ref=f"project:{item.project}"
)
Response
{
"success": true,
"memory_id": "mem_456",
"facts_extracted": 2,
"message": "Memory stored"
}
memory_get
Retrieve a full memory document by ID.
Example
result = memory_get(memory_id="mem_456")
Response
{
"success": true,
"memory": {
"id": "mem_456",
"content": "Full memory content here...",
"scope": "personal",
"category": "preferences",
"tags": ["ui", "database"],
"created_at": "2024-02-28T14:00:00Z",
"updated_at": "2024-02-28T14:00:00Z"
}
}
Use memory_get when search returns truncated results and you need the complete content.
memory_forget
Delete or archive a memory.
Example
# Soft delete (archive)
result = memory_forget(
memory_id="mem_456",
hard_delete=False
)
# Hard delete (permanent)
result = memory_forget(
memory_id="mem_456",
hard_delete=True
)
Response
{
"success": true,
"message": "Memory archived"
}
memory_update
Update an existing memory’s content.
Example
result = memory_update(
memory_id="mem_456",
content="Alice prefers dark mode, uses PostgreSQL, and works remotely"
)
Response
{
"success": true,
"memory_id": "mem_456",
"message": "Memory updated"
}
memory_maintenance
Run memory maintenance jobs for optimization and housekeeping.
Job Types
- consolidation - Merge duplicate or similar memories
- summarization - Generate summaries of memory collections
- reindex - Rebuild search indexes
- all - Run all maintenance tasks
Example
result = memory_maintenance(job_type="consolidation")
Response
{
"success": true,
"job_type": "consolidation",
"items_processed": 42,
"items_merged": 7,
"duration_ms": 1523
}
Maintenance operations can be resource-intensive. Run them during off-peak hours.