Vlk: MemAct for the IDE – persistent working memory agents can prune themselves

akatsutki1 pts0 comments

GitHub - aranajhonny/vlk · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

aranajhonny

vlk

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>3 Commits<br>3 Commits

vlk-core

vlk-core

.gitignore

.gitignore

README.md

README.md

View all files

Repository files navigation

Vlk — Memory-as-Action for LLM Agents

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.

What it does

Vlk is a native MCP server that acts as persistent working memory for IDE coding agents . It exposes a single tool — vlk_time_travel — 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.

Unlike ephemeral chat context that vanishes between sessions, Vlk's SQLite-backed agent_history table survives restarts. Your Zed or Cursor agent picks up right where it left off — lessons intact, dead ends gone.

[mem_id:5] London: API error 503<br>[mem_id:6] London: API error 503 (retry)<br>[mem_id:7] London: API error 503 (retry)

Agent calls → vlk_time_travel([5,6,7], "London API down, use cached 12°C")

Result: slots 5-7 deleted. Lesson persisted. Context clean. Agent unblocked.

No external controllers, no fixed heuristics. The agent curates its own working memory at runtime. This is MemAct (Zhang et al. 2025).

Architecture

Zed / Cursor / Claude Desktop<br>│ agent calls vlk_time_travel via stdio JSON-RPC<br>vlk-core (Rust) ← persistent memory layer for the IDE<br>│ tools/list → vlk_time_travel<br>│ tools/call → atomic DELETE + INSERT<br>SQLite (WAL) — agent_history

Use cases

Scenario<br>Agent behavior

API retry storm<br>Agent hits same endpoint 6x with 503. Detects loop, prunes failed attempts, injects "use fallback". Continues without wasting context.

Contradictory tool output<br>Two search calls return conflicting facts. Agent prunes the stale one, keeps the verified source, notes the resolution.

Context window pressure<br>Long-running task accumulating dead branches. Agent periodically prunes abandoned reasoning paths, reclaims tokens.

Multi-turn task decomposition<br>Agent explores 5 approaches, 4 dead-end. Prunes dead ends, keeps winning strategy + rationale for downstream steps.

Self-correction<br>Agent realizes early assumption was wrong. Prunes reasoning built on it, injects corrected premise, re-derives from clean state.

IDE session persistence<br>You close Zed, reopen tomorrow. Agent reads agent_history, sees pruned failures + injected lessons from yesterday. Continues without repeating the same mistakes.

Run

cd vlk-core && cargo build --release

Your IDE's agent will use the SQLite database (vlk.db, created automatically on first run) as persistent memory across sessions.

Zed

// .zed/settings.json<br>"context_servers": {<br>"vlk": {<br>"command": "/Users/jhonny/lab/agora/vlk-core/target/debug/vlk-core",<br>"args": [],<br>"env": {<br>"DATABASE_URL": "sqlite:/Users/jhonny/lab/agora/vlk-core/vlk.db?mode=rwc",<br>},<br>},<br>},

Cursor / Claude Desktop

Same pattern — point command at the binary. See MCP docs.

Smoke test

echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | ./target/release/vlk-core<br># → vlk_time_travel listed

echo '{"jsonrpc":"2.0","method":"tools/call","params":{"name":"vlk_time_travel","arguments":{"target_mem_ids":[1],"learning":"test"}},"id":2}' | ./target/release/vlk-core<br># → "1 slots pruned, N tokens saved"

Tool schema

"name": "vlk_time_travel",<br>"inputSchema": {<br>"properties": {<br>"target_mem_ids": { "type": "array", "items": { "type": "integer" } },<br>"learning": { "type": "string" }<br>},<br>"required": ["target_mem_ids", "learning"]

Citation

@article{zhang2025memact,<br>title = {Memory as Action: Autonomous Context Curation for Long-Horizon Agentic Tasks},<br>author = {Zhang, Yuxiang and Shu, Jiangming and Ma, Ye and Lin, Xueyuan and Wu, Shangxi and Sang, Jitao},<br>year = {2025},<br>url = {https://arxiv.org/abs/2510.12635}

About

No description, website, or topics...

agent memory core context vlk_time_travel search

Related Articles