Advanced / Task router
Advanced Overview
Advanced work is about controlling writes, shaping retrieval, maintaining records, and limiting sensitive data — all through documented request fields and response branches.
Router
Pick the task you are working on
Use this
add() with source, tags, importance, and metadata — then branch on created versus skipped.
Open the guideBoundary
The controls you actually have
Everything advanced you can do is expressed through documented request fields and the response you get back. Ranking internals, model choices, and background schedules are not part of the contract, so do not build logic that assumes them.
write add(text, source=…, tags=[…], importance=0–1, session_id=…, metadata={…})
→ Memory | { status: "skipped", reason, candidates_extracted, candidates_stored }
read query(query, k=…, filters={"tags": […]}, session_id=…, traversal_depth=…)
→ { memories: [Memory], context, latency_ms, session_id, query_intent }
maintain get(id) · update(id, …) · summarize(ids, lossless=…) · forget(ids, reason=…)
export export_all() → { user_id, memories, generated_at }Copy and run
Copy a working example
write = ms.add("The user prefers concise answers.", tags=["preference"], source="chat")result = ms.query("How should answers be formatted?", k=5, filters={"tags": ["preference"]})for memory in result.memories:print(memory.id, memory.score, memory.text)