{"slug": "vlk-memact-for-the-ide-persistent-working-memory-agents-can-prune-themselves", "title": "Vlk: MemAct for the IDE – persistent working memory agents can prune themselves", "summary": "Vlk, a native MCP server, provides persistent working memory for IDE coding agents by exposing a single tool, vlk_time_travel, that prunes dead memory slots from SQLite and injects learned lessons. This enables agents to autonomously curate their context, avoid failure loops, and retain knowledge across sessions, implementing the MemAct approach from Zhang et al. 2025.", "body_md": "Dead context kills long-running agents. Vlk gives them a scalpel, not a sledgehammer — and doubles as persistent memory for your IDE's coding agent.\n\nVlk is a native [MCP](https://modelcontextprotocol.io) server that acts as **persistent working memory for IDE coding agents**. It exposes a single tool — `vlk_time_travel`\n\n— that your agent calls when it detects a failure loop or context bloat. Vlk atomically prunes dead memory slots from SQLite and injects the lesson learned.\n\nUnlike ephemeral chat context that vanishes between sessions, Vlk's SQLite-backed `agent_history`\n\ntable survives restarts. Your Zed or Cursor agent picks up right where it left off — lessons intact, dead ends gone.\n\n```\n[mem_id:5] London: API error 503\n[mem_id:6] London: API error 503 (retry)\n[mem_id:7] London: API error 503 (retry)\n\nAgent calls → vlk_time_travel([5,6,7], \"London API down, use cached 12°C\")\n\nResult: slots 5-7 deleted. Lesson persisted. Context clean. Agent unblocked.\n```\n\nNo external controllers, no fixed heuristics. The agent curates its own working memory at runtime. This is [MemAct (Zhang et al. 2025)](https://arxiv.org/abs/2510.12635).\n\n```\nZed / Cursor / Claude Desktop\n  │  agent calls vlk_time_travel via stdio JSON-RPC\n  ▼\nvlk-core (Rust) ← persistent memory layer for the IDE\n  │  tools/list  → vlk_time_travel\n  │  tools/call  → atomic DELETE + INSERT\n  ▼\nSQLite (WAL) — agent_history\n```\n\n| Scenario | Agent behavior |\n|---|---|\nAPI retry storm |\nAgent hits same endpoint 6x with 503. Detects loop, prunes failed attempts, injects \"use fallback\". Continues without wasting context. |\nContradictory tool output |\nTwo search calls return conflicting facts. Agent prunes the stale one, keeps the verified source, notes the resolution. |\nContext window pressure |\nLong-running task accumulating dead branches. Agent periodically prunes abandoned reasoning paths, reclaims tokens. |\nMulti-turn task decomposition |\nAgent explores 5 approaches, 4 dead-end. Prunes dead ends, keeps winning strategy + rationale for downstream steps. |\nSelf-correction |\nAgent realizes early assumption was wrong. Prunes reasoning built on it, injects corrected premise, re-derives from clean state. |\nIDE session persistence |\nYou close Zed, reopen tomorrow. Agent reads `agent_history` , sees pruned failures + injected lessons from yesterday. Continues without repeating the same mistakes. |\n\n```\ncd vlk-core && cargo build --release\n```\n\nYour IDE's agent will use the SQLite database (`vlk.db`\n\n, created automatically on first run) as persistent memory across sessions.\n\n```\n// .zed/settings.json\n{\n  \"context_servers\": {\n    \"vlk\": {\n      \"command\": \"/Users/jhonny/lab/agora/vlk-core/target/debug/vlk-core\",\n      \"args\": [],\n      \"env\": {\n        \"DATABASE_URL\": \"sqlite:/Users/jhonny/lab/agora/vlk-core/vlk.db?mode=rwc\",\n      },\n    },\n  },\n}\n```\n\nSame pattern — point `command`\n\nat the binary. See [MCP docs](https://modelcontextprotocol.io/docs).\n\n```\necho '{\"jsonrpc\":\"2.0\",\"method\":\"tools/list\",\"id\":1}' | ./target/release/vlk-core\n# → vlk_time_travel listed\n\necho '{\"jsonrpc\":\"2.0\",\"method\":\"tools/call\",\"params\":{\"name\":\"vlk_time_travel\",\"arguments\":{\"target_mem_ids\":[1],\"learning\":\"test\"}},\"id\":2}' | ./target/release/vlk-core\n# → \"1 slots pruned, N tokens saved\"\n{\n  \"name\": \"vlk_time_travel\",\n  \"inputSchema\": {\n    \"properties\": {\n      \"target_mem_ids\": { \"type\": \"array\", \"items\": { \"type\": \"integer\" } },\n      \"learning\": { \"type\": \"string\" }\n    },\n    \"required\": [\"target_mem_ids\", \"learning\"]\n  }\n}\n@article{zhang2025memact,\n  title  = {Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks},\n  author = {Zhang, Yuxiang and Shu, Jiangming and Ma, Ye and Lin, Xueyuan and Wu, Shangxi and Sang, Jitao},\n  year   = {2025},\n  url    = {https://arxiv.org/abs/2510.12635}\n}\n```\n\n", "url": "https://wpnews.pro/news/vlk-memact-for-the-ide-persistent-working-memory-agents-can-prune-themselves", "canonical_source": "https://github.com/aranajhonny/vlk", "published_at": "2026-06-17 23:23:12+00:00", "updated_at": "2026-06-17 23:53:13.414149+00:00", "lang": "en", "topics": ["ai-agents", "developer-tools", "ai-tools", "large-language-models", "ai-infrastructure"], "entities": ["Vlk", "MCP", "SQLite", "Zed", "Cursor", "Claude Desktop", "Zhang", "MemAct"], "alternates": {"html": "https://wpnews.pro/news/vlk-memact-for-the-ide-persistent-working-memory-agents-can-prune-themselves", "markdown": "https://wpnews.pro/news/vlk-memact-for-the-ide-persistent-working-memory-agents-can-prune-themselves.md", "text": "https://wpnews.pro/news/vlk-memact-for-the-ide-persistent-working-memory-agents-can-prune-themselves.txt", "jsonld": "https://wpnews.pro/news/vlk-memact-for-the-ide-persistent-working-memory-agents-can-prune-themselves.jsonld"}}