# Obsidian + Wiki + Library Integration

Obsidian is the human-editable knowledge layer. Agentic OS should not
replace it with another note app. The commercial path is to register an
Obsidian vault as a Library watched source, index it through the existing
SQLite/FTS5/vector pipeline, then project the results into Cockpit Wiki.

## Contract

- `agentic-mcp-wiki` stays the built-in doctrine/reference wiki.
- `agentic-mcp-library` owns user and organization knowledge search.
- `LibraryWatchObsidianVault(path, label, scan_now)` registers an
  approved vault root.
- `LibraryScan` indexes files into the same `library.db`.
- Markdown notes from an Obsidian vault receive `obsidian` and
  `vault:<name>` tags, plus frontmatter/inline tags and extracted
  `[[wikilinks]]` in `source_meta`.

## Cockpit Projection

Cockpit should show this as one Knowledge/Wiki surface:

1. Built-in Wiki: product doctrine, SDK rules, troubleshooting.
2. Obsidian Vaults: user-authored notes and project memory.
3. Library Search: hybrid keyword/vector recall across indexed content.
4. Evidence Panel: source note title, file path, tags, last scan time.

The UI should not expose a separate "Obsidian app" unless the user wants
to open the vault externally. In Agentic OS, Obsidian is a source, not a
second control plane.

## Agent Rule

For knowledge-grounded answers:

1. Search `library` first with `tag=obsidian` or the relevant
   `vault:<name>`.
2. Read the exact source file if the excerpt is insufficient.
3. Cite the note/file in the run event evidence.
4. Avoid scanning unapproved device roots.

This gives the user a familiar writing environment while keeping Agentic
OS in control of indexing, retrieval, permissions, audit, and automation.
