Vlk MemAct

io.github.aranajhonny由 GitHub 账号 aranajhonny 发布v0.3.0更新于 Oct 28, 2026

Stateful memory for AI agents. Temporal awareness, error loop detection, and preventive constraints.

发布方自己的服务:core.blue

已验证STDIO仅桌面知识与记忆AI 与机器学习

概览

AI 生成的概览

为 AI 代理提供本地 SQLite 记忆层,区分过去、现在与未来状态,并打断重复的错误循环。

可以做什么
  • 把日志和错误记录为当前记忆槽,并自动对重复错误做指纹识别
  • 获取干净上下文,重写相互矛盾的记忆并拦截已检测到的循环
  • 归档当前上下文并注入预防性约束,也可撤销错误学到的约束
  • 审计完整时间线、按关键词搜索日志与约束、列出提炼出的模式
  • 汇总会话状态与 token 估算,查看后台整合代理的运行状态
  • 固定或取消固定模式,使其免于被自动遗忘
适用场景
适合代理反复尝试同一失败做法(例如同一编译错误在不同文件中重复出现)时,让它停下来并记住教训。也适合需要受限上下文、自动归档陈旧记录,并与其它记忆系统并用的场景。
运行要求
以本地二进制通过 stdio 运行;README 说明需用 Rust 构建,SQLite 随包提供。环境变量 DATABASE_URL 指定 SQLite 数据库路径(默认 sqlite:vlk.db?mode=rwc)。未声明任何认证。
安装前请注意
它会自主写入和改写记忆:后台周期会归档、遗忘和整合条目,检索时也可能重写被判为矛盾的记忆。注入上下文的约束会影响代理行为,出错时应撤销。README 说明对不存在 ID 的固定/取消固定、高负载下的预算控制以及冲突解决尚未测试。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Vlk MemAct,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Vlk² — Temporal State Machine for AI Agents

Vlk² gives AI agents a sense of time: what's happening now (PRESENT), what's already been tried (PAST), and what should guide future decisions (FUTURE). It runs as a single binary over MCP, backed by SQLite, and manages these temporal transitions autonomously.

The killer demo: when an agent repeats the same Rust/TS/Python/Go error 3 times, Vlk² auto-archives the loop and injects a preventive constraint so the agent stops retrying the same broken approach. But the architecture is general — the temporal state machine can track any kind of past→present→future transition across any agent framework.

What It Does

  • Temporal state machine — each memory has a state: PRESENT (active context), PAST (archived, hidden from context), FUTURE (preventive constraints), PURGED (forgotten). A background agent transitions entries between states without agent intervention.
  • Cross-language loop detection — fingerprints errors by language, not by string match. Recognizes Rust (error[E0277]), TypeScript/JS (TS2345, TypeError), Python (ValueError, KeyError), Go (panic: nil pointer), HTTP (503 Service Unavailable), test frameworks (expected: X, got: Y), with a timestamp-stripping fallback. When the same fingerprint appears ≥3 times, Vlk² auto-archives the loop to PAST and injects a FUTURE constraint.
  • Reconsolidation on retrieval — every recall checks current beliefs; if contradictory, the memory rewrites itself.
  • Token budget enforcement — every 30s, estimates total tokens in PRESENT + FUTURE. If over budget (8K default), archives lowest-importance entries until under budget.
  • Autonomous consolidation — background task (30s cycle) evaluates importance, archives stale entries, and forgets disconnected ones.

Why Not Just a Memory System?

General memory systems (agentmemory, Hindsight, Mem0, Supermemory) store facts, preferences, and context. Vlk² does one thing they don't: detect that the same Rust compile error repeated 3 times across different files and inject a constraint so the agent stops retrying the same broken approach. It's not a replacement — it's a specialized fault-detection layer that runs alongside them.

CapabilityVlk²agentmemoryHindsightSupermemory
Fact/persona memory—✅ 53 tools✅ hooks✅ keywords
Cross-language error fingerprinting✅ 7 strategies———
Autonomous loop breaking✅ ≥3 repeats auto-archive———
Reconsolidation on retrieval✅———
Token-bounded context✅ 8K default———

Quick Start

bash
cd vlk-corecargo build --releaseDATABASE_URL="sqlite:vlk.db?mode=rwc" ./target/release/vlk-core

Any MCP client connects via stdin/stdout — JSON-RPC 2.0, one line per message.

MCP Tools

ToolPurpose
vlk_record_statePush a log/error as a PRESENT slot for loop detection
vlk_fetch_contextClean context with reconsolidation + loop interception
vlk_time_travelArchive PRESENT → PAST and inject a FUTURE constraint
vlk_get_historyFull timeline audit
vlk_search_memoryKeyword search across logs and constraints
vlk_summarize_sessionState counts + token estimates
vlk_revoke_futureRemove incorrectly learned constraints
vlk_get_factsRetrieved distilled patterns
vlk_consolidation_statusShow consolidation agent state with token bar
vlk_pin_memoryProtect a pattern from forgetting
vlk_unpin_memoryRestore normal forgetting eligibility

How Loop Detection Works

  1. Each error is fingerprinted by type: Rust error[E...], TS TS..., Python TypeError:, Go panic:, HTTP 503, test assertion, or first-80-chars fallback
  2. Fingerprints group near-duplicates — same error code with different timestamps/line numbers count as one pattern
  3. At ≥3 repeats → auto-archives the loop + injects [SYSTEM ANCHOR] preventive constraint
  4. Future context fetches include the constraint, so the agent stops repeating

Architecture

memory_contents (immutable, team-agnostic)  └── FK ──► agent_timeline (PRESENT / PAST / FUTURE / PURGED)               ├── memory_metadata (temporal vectors, importance, connectivity)               └── semantic_facts (distilled patterns from errors)                    └── fact_contradictions (resolution tracking)
Consolidation Agent (background tokio, 30s cycle)  SCAN → EVALUATE importance → BUDGET_CHECK → ARCHIVE low-value → FORGET stale

Verification

What's tested: the core loop detection path is verified: 3 identical Rust errors → auto-archive to PAST + FUTURE constraint injection. All 13 MCP tools respond correctly.

Not yet tested: pin/unpin with non-existent timeline_ids, token budget enforcement under load, conflict resolution.

Loop detection smoke test — sends the same Rust error[E0277] 3 times and verifies auto-archive + constraint injection:

python
import subprocess, json, tempfile, os, sys
db = tempfile.mktemp(suffix='.db')proc = subprocess.Popen(['./target/release/vlk-core'],    stdin=subprocess.PIPE, stdout=subprocess.PIPE,    stderr=subprocess.DEVNULL,    env={'DATABASE_URL': f'sqlite:{db}?mode=rwc'})
def rpc(msg):    proc.stdin.write((json.dumps(msg) + '\n').encode())    proc.stdin.flush()    return json.loads(proc.stdout.readline())
# Initrpc({'jsonrpc':'2.0','id':1,'method':'initialize','params':{    'protocolVersion':'2024-11-05','capabilities':{},    'clientInfo':{'name':'test','version':'1.0'}}})
# Send the same Rust error 3 times to trigger loop detectionerror = 'error[E0277]: cannot add `str` to `str`'for i in range(3):    r = rpc({'jsonrpc':'2.0','id':i+2,'method':'tools/call','params':{        'name':'vlk_record_state',        'arguments':{'raw_log': error, 'file_context': f'lib.rs:{i*10}'}}})    assert 'PRESENT state recorded' in r['result']['content'][0]['text']    print(f'  Record {i+1}: OK')
# fetch_context triggers loop detection → auto-archive → constraint injectionr = rpc({'jsonrpc':'2.0','id':5,'method':'tools/call','params':{    'name':'vlk_fetch_context','arguments':{}}})txt = r['result']['content'][0]['text']assert 'E0277' in txt, 'error missing after fetch'assert any(kw in txt for kw in ['SYSTEM ANCHOR', 'PREVENTIVE', 'CONSTRAINT']), \    'no constraint injected'print(f'  Fetch: loop archived + constraint injected')
proc.terminate(); proc.wait()for f in (db, db + '-wal', db + '-shm'):    try:        os.remove(f)    except FileNotFoundError:        passprint('PASS: loop detection works')

Integration

Add to Hermes, OpenCode, Claude Code, Codex, or any MCP host:

yaml
# ~/.hermes/config.yaml or equivalentmcp_servers:  vlk2:    command: "vlk2"    env:      DATABASE_URL: "sqlite:~/.hermes/vlk/vlk.db?mode=rwc"    timeout: 30

Compatible with any MCP client. Works alongside agentmemory, Hindsight, Supermemory, or Hermes built-in memory.

Requirements

  • Rust 2021 edition
  • SQLite (bundled via sqlx)
  • 6.4MB binary

Current Status

Actively developed. The core loop detection and corrective memory cycle is implemented and E2E-tested. Vlk² is a specialized complement to general memory systems — not a replacement.

来源:README.md,提交 e14635c

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.3.0最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。

其他 Core 集成