← Back to Home

Knowledge Base & RAG

How EnvoyMesh stores documents, retrieves relevant snippets, and assembles LLM prompts for chat drafts, knowledge queries, and Envoy AI.

Core Principles

  1. Vault is the Foundation — The EnvoyMesh vault is a local-first file store with RAG indexing. It works standalone — no plugins required.
  2. Sensitivity is Per-Item — Folders organize content. Sensitivity labels control access. The same folder can contain public and private items.
  3. Plugins are Optional Guests — EnvoyMesh owns the vault. Plugins read/write content folders but never touch internal metadata.
  4. Public Knowledge is Genuinely Public — Public items are discoverable and queryable by all EnvoyMesh peers.

Vault Core

CapabilityDescription
Import filesAny file type: MD, PDF, Word, images, etc.
Create notesNative Markdown editor (no plugin needed)
RAG indexingVector + lexical + hybrid modes
Embedding searchConfigurable embedding provider; Envoy Local Qwen sidecar on home node (default on desktop)
Sensitivity labelsPublic / friends / private per item
Publish/shareToggle items public for mesh-wide discovery
Knowledge queriesPeers can query public items via knowledge.query

Envoy Local Embeddings & Recovery

Knowledge indexing uses a local embedding sidecar on your home node (Qwen3-Embedding via llama-server on port 18791). No cloud API key is required for the default desktop setup.

If a chunk is too large or the embed sidecar wedges, reindex recovers automatically — shrinking oversized text, restarting the embed process, and skipping only documents that still fail so the rest of your vault stays searchable. After upgrading from an older release, run Knowledge → Reindex once to rebuild older chunks under safer size limits.

Sensitivity Levels

ItemOwnerBondedStrangerAgent
Public items✅✅✅✅
Friends items✅✅❌✅
Private items✅❌❌✅

Obsidian Integration

Add Obsidian-style knowledge management to the vault without requiring users to switch apps. Users who already use Obsidian can point the plugin at their vault. Users who don't can use the native vault features.

How It Works

  1. Vault directory is shared — EnvoyMesh vault root is also the Obsidian vault
  2. Frontmatter parsing extracts metadata → enriches vault index
  3. Link graph built from [[wiki-links]] → exposed to agent
  4. File watcher monitors changes → triggers re-index

Frontmatter Integration

Obsidian notes can declare sensitivity in frontmatter:

---
title: LLM Benchmarks 2025
tags: [ai, llm, benchmarks]
aliases: [AI Model Comparison]
published: true
date: 2025-06-15
---
Frontmatter FieldMaps To
published: true/falseSensitivity override
tags: [...]Enriches vault index metadata
aliases: [...]Alternative titles for search
date:Creation date for sorting

Public Knowledge Mesh

Public vault items are discoverable and queryable by all EnvoyMesh peers, not just bonded contacts.

Access Control

Peer TypeCan QueryItems Returned
Owner✅Public + friends + private
Bonded contact✅Public + friends
Stranger✅Public only
Unknown❌None

Rate Limiting

Peer TypeRate Limit
Bonded contactStandard (per-contact)
StrangerStrict (e.g. 5 queries/minute, 50/hour)
UnknownRejected

RAG Pipeline

LLM prompts are assembled from multiple context sources:

┌─────────────────────────────────────────────────────────────────┐
│                        LLM prompt (one call)                       │
├─────────────────────────────────────────────────────────────────┤
│ 1. Agent identity (agent-identity.md)                           │
│ 2. AI identity mode (invisible / transparent / defensive)       │
│ 3. Rules / status / bond permissions                            │
│ 4. Relationship + human profile context                         │
│ 5. Recent chat messages + RAG hits from older chat              │
│ 6. Vault knowledge snippets (RAG)                               │
│ 7. External MCP knowledge (if configured)                       │
│ 8. User query or inbound message                                │
└─────────────────────────────────────────────────────────────────┘

Supported File Formats

Native text (read directly): .txt, .md, .json, .csv

Extracted text (parsed at index time): .pdf, .docx, .doc, .pptx, .ppt, .xlsx, .xls, .html, .htm, .rtf

Operations

Add Documents

  1. Import files: Library tab → Import (or drag & drop)
  2. Create notes: Notes section → New note (native Markdown editor)
  3. Files are indexed incrementally — no restart needed

Share Public Knowledge

  1. Library tab → select item → toggle Published
  2. Public items are advertised to the mesh for discovery
  3. Any peer can query your public items (rate-limited for strangers)