Wiki Knowledge Base
Myrm includes a compiled knowledge base (Wiki)—not a pile of markdown skills for the agent to interpret. A dedicated engine handles compile, index, search, review, and maintenance. The same workflow works on Local WebUI, Tauri desktop, and SaaS cloud.Wiki knowledge base
Build structured knowledge with a compiler engine—not a pile of markdown skills for the Agent to interpret. The same workflow runs on local WebUI, Tauri desktop, and SaaS cloud.Consumption loop
Myrm connects the wiki to the Agent through 12 code-level paths (no manual AGENTS.md like OpenWiki):- Four tools auto-mounted when Wiki is enabled on an agent profile (ingest / compile / query / maintain).
- Large upload hints inject wiki_ingest → wiki_query instructions so PDFs are not pasted into the chat context.
- Deep Research vault writes reports into the same wiki vault via the shared archiver and triggers compilation.
- Save to Wiki on any assistant message with provenance frontmatter.
- Post-compaction session notes — when context is compressed, session notes are automatically archived to the wiki (after summary persist, not on every note save).
- Settings overview tab for ad-hoc query, compile, maintain, and vault health badges.
Memory → Wiki auto-bridge
When Wiki is enabled on an agent profile, four automatic ingress paths land in the same vault throughpublish_raw (Roadmap #16 — not separate toggles):
Security & gates: Every path runs #15 archive security (credential block/redact) and #14 raw gate (no silent overwrite on stable paths). Agent-level
enable_wiki is the master switch — no per-source Settings toggles.
Recall direction: Wiki content is pulled into chat via knowledge_recall_tool(corpus=wiki|all) when both Wiki and Memory are enabled — not pushed into every turn like OpenClaw-style digest injection.
Tests: 37 targeted pytest (Harness 18 + Server 19, Jul 2026).
Wiki vs Memory write boundary
When both Wiki and Memory are enabled, Myrm keeps long-form knowledge out of compact memory storage:
vs Hermes: flat MEMORY.md with a 2,200-character cap — no compiled wiki vault or unified
corpus=all search.
Tests: 25 targeted pytest (Harness wiki boundary module, Jul 2026).
Karpathy cognitive map trio (index / log / hot)
After compile, maintain, import, or human review, the engine deterministically maintains three vault-root files (zero extra LLM cost):
Honest differentiation vs competitors:
- Stronger than Molio: hot is used only on the wiki query path — not injected into the agent global system prompt → safer prompt cache
- Stronger than Hippocampus: event-driven refresh, not blind per-session hot inject
- Intentionally not: Molio-style LLM hot rewrite (token/hallucination cost); global middleware hot (breaks cache)
Unified vault path
All wiki data lives under a single vault directory per workspace. Settings, REST API, Agent tools, Save to Wiki, Deep Research, and compaction archive share the same path. On startup, legacy paths are migrated automatically. In Settings → Wiki → Overview, stats load on page open and show:- Vault ready — the wiki directory exists and is writable.
- Legacy migrated — any old vault location was merged into the current path.
- Knowledge catalog / Activity log / Recent context — whether the Karpathy-style trio (
index.md,log.md,hot.md) is built and fresh after compile, import, or review actions.
Project vault (file-centric SSOT) vs Wiki import
Two different paths — pick the one that matches your workflow:
After competitor migration, use the Migration Result vault bind card so your first chat already points at the real vault — no manual Project setup.
Per-chat task scope (without creating a Project): use the folder icon in the message composer (
WorkspaceDirPicker) to bind a directory for this conversation.
Per-agent wiki scope
Each agent can have its own wiki vault. In Settings → Wiki, use the Agent scope dropdown (or open/settings/wiki?agentId=<agent-id> from the agent banner). Stats, compile, maintain, and imports apply to the selected agent only.
Artifact Save to Wiki and chat-bound ingest use the current chat’s agent id, so documents do not land in the default vault by mistake.
Honest boundary (until Agent Scope SSOT v2 ships): the Queue tab and ingest SSE follow the selected agent immediately. If you switch agents while staying on Pending or Concepts, reload the page or switch tabs until scope reload is fully wired — approving a draft against the wrong vault is the risk we are closing in the next scope hardening release.
Unified memory + wiki recall
When both Wiki and Memory are enabled on an agent profile, Myrm mounts a unifiedknowledge_recall_tool with corpus=all — one tool call searches long-term memory and the agent wiki together. Memory hits emit cited memory IDs for the UI; wiki hits appear in the tool result text.
Default agent profiles include Memory; enable Wiki in Agent config → Built-in tools to get the unified path.
Memory citation button (reload-safe)
When the agent recalls semantic/episodic memories, completed assistant messages show a Memory N button in the action bar. Open the sheet to inspect which memories influenced the answer (type, score, namespace, link back to source chat). Citations are persisted to the database and survive page reload — not SSE-only ephemeral state.Open Wiki settings
- Go to Settings → Wiki 知识库 (Wiki).
- Use the tabs:
- Overview — purpose, stats, compile/maintain actions, ad-hoc query.
- Concepts (词条管理) — folder tree, CRUD, drag-and-drop.
- Pending edits — human-in-the-loop approve/reject for LLM drafts.
- Queue — document ingestion pipeline status.
Live compile visibility (Settings open)
When Settings → Wiki is open in the browser or desktop app:Live updates require the Settings Wiki page to stay open (EventSource subscription). Closing Settings stops SSE — this is intentional GUI-scope visibility, not a background daemon. Competitors with CLI-only or file-tree-only wikis (Hermes SKILL, OpenClaw markdown folders) do not offer an equivalent Queue panel + live ingest badges.
External source sync (Settings Overview)
Settings → Wiki → Overview → External sources pulls saved mail and feeds intowiki/raw/ on a schedule or on demand:
Zero-LLM pull: fetching Gmail/RSS does not call your chat model. Optional Auto-compile after sync only uses LLM when a model is configured.
Cron: the Read-it-later ingestion blueprint runs daily (often paired with Wiki morning delta via Second Brain preset). Router job
__wiki_source_sync__ executes server-side with no agent tools — safe, deterministic automation.
Observability: last sync time, published/skipped/failed counts, and the first error line (e.g. Gmail label not found) appear on the card.
Honest boundary: Gmail labels and Drive folder IDs are typed manually — there is no label dropdown or Drive Picker. Create a matching label in Gmail (default preset uses
ReadLater). If Google is connected but Drive read scope is missing, the card shows a reconnect hint (google_drive_authorized: false). OneDrive is not supported (no Microsoft OAuth infra). Misconfiguration is surfaced on sync, not silently ignored.Evolution synthesis at compile (CCSP)
When you Compile Wiki, Step 2.5 runs a Compile-Time Contradiction Synthesis Pass after normal article generation:
Live count: ingest SSE exposes
synthesis_pending_count; Overview refreshes without a full page reload when Settings → Wiki stays open.
Honest differentiation vs OpenClaw: OpenClaw writes reports/contradictions.md and expects CLI follow-up. Myrm keeps the same intelligence in Settings Pending + GUI filters + bidirectional Timeline links — better for Article 8-style “decide which definition wins” workflows.
Honest boundary: Cross-concept only (same-batch name merges are skipped). This is Wiki compile synthesis, not the separate Memory ConflictCard notification path.
Tests (2026-07-29): Harness 8 (test_contradiction_synthesis) + 12 (test_linter_extended) + Server 2 (stats/pending API) = 22 passed. Browser MCP E2E not run this round.
Manage concepts in the tree
In Concepts:- New folder — pick an optional parent folder (root or nested), then name the folder.
- Rename / delete — hover a row; delete shows the full path and how many items inside will be removed.
- Drag and drop — move folders or concepts between parents (link refs are updated server-side).
- Detail panel — select a concept to view rich-rendered content (Mermaid diagrams, KaTeX math, GFM tables, syntax-highlighted code blocks, and dark mode) or switch to raw Markdown editing.
- Four-tab editor (Edit) — narrow writes via
POST /wiki/apply(not full-page PUT):- Compiled Truth — patch the
## Compiled Truthsection only. - Timeline — append-only entries; duplicate lines are skipped with a toast.
- Metadata — replace tags and aliases in frontmatter (Settings path; Agent merge uses a different caller gate).
- Advanced — full-page replace; Settings-only (
caller=settings). Agent and chat cannot use this op.
- Compiled Truth — patch the
if_match = last known content_hash). If another tab or client changed the page first, you get a page conflict toast — reload and retry.
Controlled write surface (POST /wiki/apply)
All wiki mutations go through one REST endpoint: POST /wiki/apply?caller= (settings | agent | chat).
Write-time dedup:
canonical_id and alias index reject near-duplicate pages on create (HTTP 409 canonical_conflict). Save to Wiki shows a friendly toast when a note on the same topic already exists.
Honest boundary: Agent wiki_apply_tool still uses CSV-style parameters and does not auto-send if_match; the Settings GUI and Save to Wiki paths are complete.
Raw evidence layer gate (import & ingest)
Stable-path writes towiki/raw/ go through the harness publish_raw gate — complementary to concept-layer POST /wiki/apply (#12+#13).
Honest boundary: Timestamp/uuid raw paths (research dumps, artifact ingest, session archive) are intentionally ungated — no stable-path conflict. There is no dedicated Raw Audit panel; read
wiki/log.md or use Overview stats.
Archive security governance (sensitive content)
All durable Wiki writes share the harness persistence scan SSOT (core/security/persistence/content_scan.py):
Honest boundary: No security stats dashboard yet; Settings/chat import injection is warn-only; agent
wiki_ingest blocks high-confidence injection. Agent blocked paths surface as tool errors, not a Settings dialog.
Wiki files remain plain Markdown on disk. Obsidian and other editors can open the same vault; Myrm adds indexing, search, and GUI management on top.
Reference Wiki in chat with @wiki:
Type@wiki: in the chat input to search your Wiki concepts with live autocomplete. Select a concept to inject its compiled content as context for the current message:
@wiki:keyword— filters the dropdown to show only matching Wiki concepts (fuzzy match on concept name).- Select a concept — the input becomes
@wiki:ConceptNamewith a removable pill tag, just like@stagedor@diff. - The Agent receives the concept content in a
<mentioned_files>XML block, grounding its answers in your knowledge base. - Combine references —
@wiki:ProjectArchitecture @stagedsends both the wiki article and your git staged changes in one message. - Plain
@search — typing@keyword(without thewiki:prefix) shows a mixed list of agents, wiki concepts, and uploaded files.
Save a chat message to Wiki
On any completed assistant message, use Save to Wiki (book icon) in the message action bar:- Choose a filename and optional target folder in the tree picker.
- Confirm save — content is written via
create_noteonPOST /wiki/apply(managed Compiled Truth + Timeline skeleton). - Each save adds YAML frontmatter:
source_chat,source_message,saved_atfor traceability. - If a note with the same canonical topic already exists, you get a canonical conflict toast instead of silently creating a duplicate page.
Page type contract (frontmatter type)
Every wiki page must declare a page type in YAML frontmatter. This is enforced at compile time, on pending-edit approval, and by the linter — not just a prompt suggestion.
Allowed values: source, entity, concept, comparison, overview, question, session (Google OKF–compatible subset).
Honest boundary: Save to Wiki from chat currently writes provenance fields only (
source_chat, etc.); run Repair Page Types or Maintain to backfill type on those notes. Settings Advanced full-page replace is not hard-blocked on frontmatter — the linter heals drift on the next maintain pass.
This closes the loop: conversation → one-click archive → searchable knowledge.
Search and maintain
- Query Wiki (Overview tab) — natural-language answers with zero LLM on the query path: seeds from the cognitive index, sidecar summaries, FTS5, and keywords converge through a budgeted best-first graph expansion before assembling L0/L1/L2 snippets and claim/evidence cards.
- Retrieval mode (Overview → Query Wiki) — choose General (balanced across index, directories, and articles) or Claims first (boost concepts with structured frontmatter claims and linked evidence; falls back to General when no claim match). OpenClaw offers similar
raw-claimbehavior via CLI only; Myrm exposes it in Settings without memorizing flags. - Citation trust — answer cards include claim text, evidence paths, and
snapshot_statusso you can see whether cited content still matches the vault on disk. - Evidence citation Drawer (Closure v2) — tap a citation chip in Chat or Settings: claim status badges (contested/unsupported only, to reduce noise), compile confidence % when explicitly set, and raw excerpt blocks. Retrieval ranks fresh supported claims ahead of stale contested ones with zero LLM cost.
- Settings retrieval path trace — below Query results, a card shows index hits, seeds, sidecar directories, and selected concepts so power users can debug “why this concept matched.”
- Compile / Maintain — incremental compile (SHA256 change detection), parallel batch ingestion (Semaphore-limited concurrency for ~40% faster multi-document processing), visual element guidance (the compiler prompts the LLM to produce Mermaid diagrams, GFM tables, and fenced code blocks where appropriate), and linter-driven health fixes (broken links, drift, stale content, knowledge-gap detection for isolated/bridge concepts).
- Structural health stats (Overview tab) — zero-LLM scan counts broken markdown links, broken Obsidian
[[wikilink]]targets (path + unique title alias), and missing frontmattertypevalues. Amber badges update after compile, import, concept edits, pending approvals, and folder deletes — no CLIwiki lintrequired. CI runs a 4-case retrieval regression gate on every harness change. - Library / Brain views — 3D knowledge graph with community detection and concept exploration (product navigation may vary by deployment).
- Knowledge graph — the compiler auto-extracts concepts and their relationships, building a graph with weighted edges (direct link + source overlap + common neighbors). LPA community detection groups related concepts; gap analysis highlights isolated nodes and bridge concepts that connect otherwise separate domains.
- Smart context recall — when starting a new conversation, the agent automatically recalls relevant memories and knowledge based on the current topic, so you never need to manually point it to the right documents.
- Contradiction detection — the Claim Graph tracks
contradiction_statusandCONTRADICTED_BYrelationships across knowledge entries. Consolidation automatically flags conflicting facts for human review rather than silently overwriting. - Federated search — when multiple wiki namespaces or published directories exist, queries search across all sources and merge results with RRF ranking, ensuring comprehensive coverage without manual scoping.
Import from Obsidian
Myrm provides a dedicated Obsidian Vault importer that preserves your notes, tags, and images:- In Settings → Wiki, scroll to the import section.
- Tauri desktop: click Import Obsidian Vault and select the local vault directory.
- WebUI / Cloud: click Upload Obsidian ZIP and upload the vault as a
.zipfile.
- YAML frontmatter — both inline arrays (
tags: [a, b]) and YAML indented lists (tags:\n - a\n - b), includingaliases,created, andupdated. - Image embeds —
![[image.png]]syntax is rewritten to standard Markdown and images are copied to the wiki assets directory. .canvasfiles — empty boards or boards with no extractable text are skipped; boards with text nodes are converted to Markdown (text content and file/link labels per JSON Canvas 1.0).- Encoding resilience — files that fail UTF-8 decoding are reported but do not block the import.
- Conflict-safe re-import — if a raw file already exists with different content, it is skipped by default. A dialog lets you supersede with a reason (logged to
wiki/log.md).
Open in Obsidian & export pack (#22 + #22b)
The Obsidian Vault card on Settings → Wiki → Overview complements import above with reverse open/export:
After unzip: Obsidian → Open folder as vault → Graph view shows nodes colored by page type.
Tests (Jul 2026): 14 targeted pytest (cross-platform launch + reveal + export — no Chrome MCP E2E).
vs Project mount: To keep editing on your own disk with Obsidian/Typora, use Settings → Projects → Mount sync folder. #22 is for Myrm-hosted compiled vaults — one-click open or snapshot export.
Honest limits: Cloud cannot reveal local paths; Open button hidden when Obsidian is not installed (Show in folder + Download still work); Windows
%ProgramFiles%\Obsidian\Obsidian.exe is not probed yet; no portable obsidian:// deep links.Local vault git snapshots (#23)
When version control is enabled on a wiki vault (Local/Tauri defaults it on for session archive and similar paths), Myrm keeps a real.git directory inside the vault — not a shadow-git plugin:
Tests (Jul 2026): 5 targeted pytest for vault git (
test_wiki_vault_git_mutation 2 + Harness test_vault_git 3 — no Chrome MCP E2E).
Honest limits: No in-Settings commit list UI — use
git log or Obsidian Git for deep history. Download Obsidian pack ZIP does not include .git. Cloud deployments do not promise vault git.Search imported images (Obsidian assets)
When Vision Fallback Model is configured under Settings → Models, Myrm indexes images underwiki/assets/ with vision-generated captions (FTS5 + optional vector hybrid). You can find them without a separate image-search tool:
wiki_query/knowledge_recall(corpus=wiki|all)— text questions like “where is the architecture diagram?” can return asset hits with captions and thumbnail citations in Chat Sources.- Settings → Wiki → Overview —
asset_indexbadges show indexed / pending / failed counts; if images exist but vision is not configured, an amber hint links you to Models. - Import path — Obsidian import schedules background asset indexing; compile/maintain also refreshes the asset index.
Honest limits: This is text → image search via captions, not image → image (multimodal embed). Competitors like OpenViking offer the latter; general claw agents (OpenClaw, Hermes) lack this Obsidian asset caption pipeline entirely. Without vision configured, assets are imported but not searchable — the Overview hint covers that case; Chat will not show misleading empty-caption asset sources.
URL ingestion and video subtitle extraction
When ingesting URLs into the Wiki, Myrm routes all links through the CrawlEngine:- YouTube videos — subtitles are automatically extracted (10+ languages supported). The wiki stores searchable text, not raw HTML.
- Bilibili videos — subtitle extraction via direct API, no DOM parsing needed.
- WeChat articles — multi-tier fetcher automatically handles anti-crawl protections (HTTP → browser → stealth mode progressive degradation).
- Regular web pages — CrawlEngine adaptively selects the optimal fetching strategy; JS-rendered pages are automatically upgraded to the browser engine.
- High-availability fallback — if CrawlEngine fails, the system automatically falls back to
secure_get+ Markdown conversion, ensuring ingestion is never blocked.
Document parsing and OCR
When ingesting documents into the Wiki, Myrm automatically selects the optimal parsing strategy:- Text-rich PDFs — extracted via pdfplumber with parallel processing, bookmark injection, and font-based heading detection.
- Scanned PDFs — auto-detected when text content is sparse (< 200 characters). Pages are rendered as PNG images and sent to your vision model (VLM) for understanding.
- Hybrid PDFs — text is extracted normally while embedded charts and photos are also captured and filtered through the smart image ablation filter (removes UI noise, logos, decorative elements).
- Images — local PaddleOCR engine supports Chinese, Japanese, Korean, and English with no cloud dependency. Results include confidence scores and bounding boxes.
- Office files — native parsers for DOCX, XLSX, PPTX without external dependencies like MarkItDown.
Security
Wiki ingestion is protected by path traversal defense and persistence-layer content scanning:- Filename sanitization — any directory components in LLM-provided filenames are stripped (
Path(filename).name), preventing an injected tool call from targeting paths like../../../etc/cron.d/evil.md. - Boundary validation —
safe_join_path()validates that resolved paths stay within the wiki raw directory, blocking absolute paths, null byte injection, symlink escapes, and../traversal. - Pre-write scan —
publish_rawand compiled publish run credential / injection checks before bytes hit disk (see Archive security governance above).
Compared to DIY wiki skills
Related
- Memory system — episodic/semantic memory vs compiled Wiki articles
- Competitor comparison — migration and positioning