Problem
librefang-memory is a SQLite + vector substrate. It is good at "find me the K nearest snippets to this query", weak at "give me a navigable, durable knowledge base I can also open in Obsidian and edit by hand."
Long-running agents accumulate facts (project conventions, people, recurring decisions, how systems are wired). Today these facts live as opaque memory rows that only the agent can introspect. The user cannot:
- See what the agent thinks it knows.
- Edit / correct a wrong fact directly.
- Carry the knowledge to another tool (Obsidian, Logseq, plain markdown viewer).
- See provenance — when did the agent learn this, from which conversation, on whose claim.
Reference: openclaw
extensions/memory-wiki is a persistent wiki compiler that produces:
- A markdown vault at
~/.openclaw/wiki/<vault> with deterministic indexes (index.md, per-topic pages, backlinks).
- Provenance metadata on every claim (source conversation, source turn, source channel, capture timestamp).
- Optional Obsidian-friendly render mode (vault structure, frontmatter,
[[wiki-link]] syntax) vs native mode (plain markdown, no Obsidian assumptions).
- Three modes:
isolated (default): own vault, own ingest, no dependency on the active-memory plugin.
bridge: reads public artifacts from memory-core through documented seams.
unsafe-local: explicit same-machine escape hatch for private local paths (e.g. point at an existing Obsidian vault).
When active-memory exposes shared recall, agents can memory_search with corpus=all to span both stores in one pass, then fall back to wiki_search / wiki_get for wiki-specific ranking and provenance.
Proposed approach
-
New crate librefang-memory-wiki (or a feature-gated module under librefang-memory).
-
Compiler pipeline:
- Subscribe to memory events (
memory_store writes that pass a "durable" filter — ignore ephemeral session scratch).
- Group by topic (LLM-assisted topic extraction in a follow-up; v1 can use explicit
topic tags).
- Render to
<vault>/<topic>.md with frontmatter (provenance, created, updated, claims: []).
- Maintain
index.md and a _meta/backlinks.json deterministically.
-
Tools:
wiki_get(topic) — return the rendered page.
wiki_search(query) — full-text + vector hybrid over the vault.
wiki_write(topic, body, provenance) — controlled write with the same prompt-injection scan as skills.
memory_search(corpus = "all" | "kv" | "wiki") — extend existing recall to span both.
-
Config:
[memory_wiki]
enabled = false # default off
mode = "isolated" # isolated | bridge | unsafe_local
vault_path = "~/.librefang/wiki/main"
render_mode = "native" # native | obsidian
ingest_filter = "tagged" # tagged | all
-
Backups / hand-edit safety:
- Never overwrite a page whose mtime is newer than the last compiler run without prompting.
- Compiler reads back hand-edits before re-rendering so user edits survive.
Acceptance criteria
This is a P2 / longer-horizon feature. Skill workshop (#3328) and the prompt-build hook (#3326) should land first; this benefits from both.
Problem
librefang-memoryis a SQLite + vector substrate. It is good at "find me the K nearest snippets to this query", weak at "give me a navigable, durable knowledge base I can also open in Obsidian and edit by hand."Long-running agents accumulate facts (project conventions, people, recurring decisions, how systems are wired). Today these facts live as opaque memory rows that only the agent can introspect. The user cannot:
Reference: openclaw
extensions/memory-wikiis a persistent wiki compiler that produces:~/.openclaw/wiki/<vault>with deterministic indexes (index.md, per-topic pages, backlinks).[[wiki-link]]syntax) vsnativemode (plain markdown, no Obsidian assumptions).isolated(default): own vault, own ingest, no dependency on the active-memory plugin.bridge: reads public artifacts frommemory-corethrough documented seams.unsafe-local: explicit same-machine escape hatch for private local paths (e.g. point at an existing Obsidian vault).When active-memory exposes shared recall, agents can
memory_searchwithcorpus=allto span both stores in one pass, then fall back towiki_search/wiki_getfor wiki-specific ranking and provenance.Proposed approach
New crate
librefang-memory-wiki(or a feature-gated module underlibrefang-memory).Compiler pipeline:
memory_storewrites that pass a "durable" filter — ignore ephemeral session scratch).topictags).<vault>/<topic>.mdwith frontmatter (provenance,created,updated,claims: []).index.mdand a_meta/backlinks.jsondeterministically.Tools:
wiki_get(topic)— return the rendered page.wiki_search(query)— full-text + vector hybrid over the vault.wiki_write(topic, body, provenance)— controlled write with the same prompt-injection scan as skills.memory_search(corpus = "all" | "kv" | "wiki")— extend existing recall to span both.Config:
Backups / hand-edit safety:
Acceptance criteria
enabled = falsedefault, no behavior change for existing users.isolatedmode end-to-end: an agent callswiki_write, the page lands at<vault>/<topic>.md,wiki_getreturns it,wiki_searchfinds it.obsidianrender mode produces[[wiki-link]]syntax and parses cleanly in Obsidian.memory_storecalls with topic tags produce 5 wiki pages with correct backlinks.This is a P2 / longer-horizon feature. Skill workshop (#3328) and the prompt-build hook (#3326) should land first; this benefits from both.