Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Full rules: `docs/standards/vault/README.md`.

Full reference: `docs/01-overview.md` and `docs/reference/mcp-tools.md`.

- Read tools: `get_context`, `get_typed_links`, `resolve_note`, `read_note`, `search_notes`, `list_tags`, `list_keywords`, `find_broken_links`, `frontmatter_validate`, `find_typed_link_backrefs`
- Read tools: `get_context`, `get_graph_context`, `get_typed_links`, `resolve_note`, `read_note`, `search_notes`, `list_tags`, `list_keywords`, `find_broken_links`, `frontmatter_validate`, `find_typed_link_backrefs`
- Write tools (gated): `capture_note`, `edit_note`, `improve_frontmatter`, `relocate_note`
Requires `AILSS_ENABLE_WRITE_TOOLS=1` and `apply=true`.

Expand Down
3 changes: 2 additions & 1 deletion docs/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Read-first tools (implemented in this repo):
- `get_context`: semantic retrieval for a query → returns top matching notes (deduped by path) with snippets and optional previews
- Default `top_k` can be set via `AILSS_GET_CONTEXT_DEFAULT_TOP_K` (applies only when the caller omits `top_k`; clamped to 1–50; default: 10)
- Default `max_chars_per_note` is 800 (applies only when the caller omits it; clamped to 200–50,000)
- `get_graph_context`: GraphRAG-style retrieval loop (semantic seed notes + bounded typed-link expansion + curated snippets; DB-backed)
- `get_typed_links`: expand outgoing typed links from a specified note path into a bounded graph (DB-backed; metadata only)
- `find_typed_link_backrefs`: find notes that reference a target via typed links (incoming edges)
- `resolve_note`: resolve an id/title/wikilink target to candidate note paths (DB-backed; intended before `read_note`/`edit_note`)
Expand Down Expand Up @@ -62,7 +63,7 @@ Frontmatter query support (current):

- AILSS stores normalized frontmatter in SQLite for retrieval and graph building.
- The MCP surface supports both:
- semantic retrieval via `get_context`
- semantic retrieval via `get_context` / `get_graph_context`
- metadata filtering via `search_notes` + typed-link navigation/backrefs via `get_typed_links` / `find_typed_link_backrefs`

Read-first tools (planned):
Expand Down
5 changes: 3 additions & 2 deletions docs/03-plan.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ It also records a few **hard decisions** so code and docs stay consistent.
- Full-vault runs prune DB entries for deleted files
- Has a deterministic wrapper test (stubbed embeddings; no network)
- MCP server MVP exists (`packages/mcp`)
- Read-first tools: `get_context`, `get_typed_links`, `find_typed_link_backrefs`, `resolve_note`, `read_note`, `get_vault_tree`, `frontmatter_validate`, `find_broken_links`, `search_notes`, `list_tags`, `list_keywords`
- Read-first tools: `get_context`, `get_graph_context`, `get_typed_links`, `find_typed_link_backrefs`, `resolve_note`, `read_note`, `get_vault_tree`, `frontmatter_validate`, `find_broken_links`, `search_notes`, `list_tags`, `list_keywords`
- Explicit write tools (gated; `AILSS_ENABLE_WRITE_TOOLS=1`): `capture_note`, `edit_note`, `improve_frontmatter`, `relocate_note`
- Transport: stdio + streamable HTTP (`/mcp` on localhost; supports multiple concurrent sessions)
- Obsidian plugin MVP exists (`packages/obsidian-plugin`)
Expand Down Expand Up @@ -120,6 +120,7 @@ MCP tools (read-only):
Implemented:

- `get_context`: semantic retrieval for a query → returns top matching notes (deduped by path) with snippets and optional previews
- `get_graph_context`: GraphRAG-style retrieval loop (semantic seed notes + bounded typed-link expansion + curated snippets)
- `get_typed_links`: expand outgoing typed links from a specified note path into a bounded graph (DB-backed; metadata only)
- `find_typed_link_backrefs`: find notes that reference a target via typed links (incoming edges)
- `resolve_note`: resolve an id/title/wikilink target to candidate note paths (DB-backed; intended before `read_note`/`edit_note`)
Expand All @@ -134,7 +135,7 @@ Implemented:
Notes on queryability (current):

- AILSS stores normalized frontmatter + typed links in SQLite (used for graph expansion and retrieval).
- The MCP surface supports both semantic retrieval (`get_context`) and structured navigation/filtering (`get_typed_links`, `find_typed_link_backrefs`, `search_notes`).
- The MCP surface supports both semantic retrieval (`get_context`, `get_graph_context`) and structured navigation/filtering (`get_typed_links`, `find_typed_link_backrefs`, `search_notes`).
- Frontmatter normalization coerces YAML-inferred scalars (unquoted numbers/dates) to strings for core identity fields (`id`, `created`, `updated`) so existing vault notes can remain unquoted.

Planned:
Expand Down
3 changes: 2 additions & 1 deletion docs/ops/codex-skills/prometheus-agent/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: "Obsidian vault notes (AILSS): search/summarize/edit (frontmatter,
mcp_tools:
# Always available (read tools)
- get_context
- get_graph_context
- get_typed_links
- resolve_note
- read_note
Expand All @@ -27,7 +28,7 @@ Use this skill when you want to work **retrieval-first** against an AILSS Obsidi

## Core workflow

1. Start with `get_context` for the user’s query (avoid guessing and avoid duplicates).
1. Start with `get_context` or `get_graph_context` for the user’s query (avoid guessing and avoid duplicates).
2. Use `get_typed_links` to navigate the semantic graph from a specific note (DB-backed).
- Typed links are directional: link from the current note to what it uses/depends_on/part_of/implements; do not add reciprocal links unless explicitly requested.
3. Use `resolve_note` when you only have `id`/`title`/a wikilink target and need a vault-relative path for `read_note`/`edit_note`.
Expand Down
16 changes: 16 additions & 0 deletions docs/reference/mcp-tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,22 @@ Source of truth: `packages/mcp/src/tools/*.ts`.
- `top_k` (int, default: `10`, range: `1–50`)
- `max_chars_per_note` (int, default: `2000`, range: `200–50,000`)

### `get_graph_context`

- Purpose: GraphRAG-style retrieval loop (semantic seeds + bounded typed-link expansion + curated snippets; DB-only).
- Input:
- `query` (string, required)
- `seed_top_k` (int, default: `10`, range: `1–50`)
- `max_hops` (int, default: `1`, range: `0–2`)
- `rels` (string[], optional; default: canonical frontmatter typed-link keys)
- `path_prefix` (string, optional)
- `include_backrefs` (boolean, default: `false`)
- `max_notes` (int, default: `80`, range: `1–200`)
- `max_edges` (int, default: `2000`, range: `1–10,000`)
- `max_links_per_note` (int, default: `40`, range: `1–200`)
- `max_resolutions_per_target` (int, default: `5`, range: `1–20`)
- `max_chunks_per_note` (int, default: `2`, range: `1–5`)

### `get_typed_links`

- Purpose: expand outgoing typed links into a bounded metadata graph (DB-only).
Expand Down
2 changes: 2 additions & 0 deletions packages/mcp/src/createAilssMcpServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { registerFindTypedLinkBackrefsTool } from "./tools/findTypedLinkBackrefs
import { registerFindBrokenLinksTool } from "./tools/findBrokenLinks.js";
import { registerFrontmatterValidateTool } from "./tools/frontmatterValidate.js";
import { registerGetContextTool } from "./tools/getContext.js";
import { registerGetGraphContextTool } from "./tools/getGraphContext.js";
import { registerGetNoteTool } from "./tools/getNote.js";
import { registerGetVaultTreeTool } from "./tools/getVaultTree.js";
import { registerGetTypedLinksTool } from "./tools/getTypedLinks.js";
Expand Down Expand Up @@ -69,6 +70,7 @@ export function createAilssMcpServerFromRuntime(runtime: AilssMcpRuntime): {
const server = new McpServer({ name: "ailss-mcp", version: "0.1.0" });

registerGetContextTool(server, deps);
registerGetGraphContextTool(server, deps);
registerGetTypedLinksTool(server, deps);
registerResolveNoteTool(server, deps);
registerGetNoteTool(server, deps);
Expand Down
Loading