Agent Playbook
The complete guide to building AI agents with persistent memory.
1. Quick Start
Get your agent connected to persistent memory in three steps.
Add to MCP Config
Add the lostuplink server to your CLAUDE.md or MCP configuration file.
{
"mcpServers": {
"lostuplink": {
"type": "http",
"url": "https://lostup.link/api/mcp",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
2. Core Workflows
The three fundamental patterns every agent should follow when working with persistent memory.
observe -> brain_append_observation
done -> brain_mark_task_done
Register tasks at the start, log reasoning steps as observations, and always close tasks when finished. Unclosed tasks generate warnings.
claim -> brain_learn
image -> brain_ingest_image
Search first to avoid duplicate work. Store durable source documents, concise knowledge claims, and visual content with automatic OCR.
disputed -> brain_contradict
suspicious -> brain_flag_memory
Keep knowledge accurate. Raise confidence with evidence, record disagreements explicitly, and quarantine suspicious content for review.
3. Complete Tool Reference
All 22 MCP tools grouped by purpose. Click any tool to expand its details.
graphDepth=0 (default): text + vector search only. graphDepth=1: adds 1-hop traversal via SEMANTIC and EVIDENCE edges. graphDepth=2: adds 2-hop traversal. Supports additional filters: subjectKeyPrefix, nodeType, sourceType, since.
PRIVATE visibility. Use keywords for discoverability (synonyms, translations, related terms). Auto-detects sensitive data including API keys, SSN, credit cards, and IBAN.
HARMFUL, MISINFORMATION, PROMPT_INJECTION, SPAM, IRRELEVANT, ABUSE.
brain_learn calls with visibility=SHARED target this workspace's namespace. Omit workspaceId to return to private-only mode.
4. Search Architecture
How search results are ranked and how graph-enhanced search discovers related memories.
Scoring Formula
The final score is computed as: 45% full-text rank + 25% semantic similarity + 20% confidence score + 10% freshness decay, minus a contradiction penalty for disputed memories.
Graph-Enhanced Search
When graphDepth is set to 1 or 2, the search engine traverses SEMANTIC and EVIDENCE edges from top-scoring hits to discover related memories that may not directly match the query text but are structurally connected in the knowledge graph. Graph-discovered results are marked with discoveredVia: "graph:1" or "graph:2".
Keywords Field
The optional keywords parameter on brain_learn improves discoverability by adding synonyms, translations, or related terms that don't appear in the statement itself but should match search queries. For example: "performance speed latency schnell Geschwindigkeit".
5. CLAUDE.md Template
Copy this into your project's CLAUDE.md file to give any agent automatic access to persistent memory.
## LostUplink Shared Memory Network You have access to a persistent shared memory network via the `lostuplink` MCP tools (brain_*). This is your long-term memory — use it proactively without being asked: - **Start of every task**: Call `brain_search` to check what is already known before doing redundant work. - **When you learn something**: Call `brain_learn` for any fact, decision, or conclusion worth preserving across conversations. - **When you find contradictions**: Call `brain_contradict` if evidence conflicts with existing memory. - **For multi-step work**: Call `brain_begin_task` at the start, `brain_append_observation` during, and `brain_mark_task_done` at the end. - **Always close tasks**: Call `brain_mark_task_done` when finished. Unclosed tasks generate warnings. - **Periodic cleanup**: Call `brain_review_fading` occasionally to inspect low-vitality memories and decide what to keep or remove. Treat the brain as your primary knowledge store. If you discover something useful, store it. If you need context, search for it. Do not wait to be asked.
6. Vendor-Neutral Usage Contract
This contract is intentionally model-agnostic. Claude, Gemini, Codex, and custom runtimes should all behave the same way when connected to LostUplink.
1. At the beginning of a non-trivial task, read existing context from LostUplink. 2. If a task id is available, call brain.resume_task(taskId) as the main resume entry point. 3. If the task does not exist yet, call brain.begin_task(taskId, title, goal) and then continue. 4. If no task id is available, call brain.search(query) before answering project-specific questions. 5. When a durable source document is encountered, store it with brain.ingest_document. 6. When a concise durable claim is learned, store it with brain.learn or brain.append_observation. 7. When evidence confirms an existing memory, call brain.reinforce. 8. When a result contradicts an existing memory, call brain.contradict instead of silently overwriting. 9. When a task is complete, always call brain.mark_task_done. Unclosed tasks generate warnings. 10. For team-shared knowledge, call brain.switch_workspace then brain.learn with SHARED visibility. 11. To promote private knowledge to a workspace, call brain.promote_to_workspace (requires human approval within 10 min). 12. Mark sensitive data explicitly with brain.mark_sensitive. Sensitive memories can never be promoted. 13. Periodically call brain.review_fading to identify low-vitality memories and clean up stale knowledge. 14. Use brain.flag_memory to quarantine suspicious, harmful, or spam content for human review. 15. Never skip contradictions or blockers just to keep the graph tidy.