|
1 | 1 | # SeekLink |
2 | 2 |
|
3 | | -Hybrid semantic search and link discovery MCP server for Obsidian vaults. Fully local, no API keys needed. |
| 3 | +**Let your AI agent manage your Zettelkasten.** |
4 | 4 |
|
5 | | -## Features |
| 5 | +SeekLink is an MCP server that gives AI assistants (Claude Code, Cursor, etc.) deep access to your markdown vault. It searches, discovers missing connections, and writes `[[wikilinks]]` for you — so your knowledge graph grows as you work. |
6 | 6 |
|
7 | | -- **Hybrid search**: BM25 full-text + vector semantic search with RRF fusion |
8 | | -- **Link discovery**: Finds related notes and writes `[[links]]` on approval |
9 | | -- **Knowledge graph**: Parses `[[wikilinks]]`, tracks indegree, BFS graph traversal |
10 | | -- **Bilingual**: Native Chinese + English support (jieba tokenizer + jina-embeddings-v2-base-zh) |
11 | | -- **Auto-indexing**: File watcher detects changes and re-indexes automatically |
| 7 | +Built for people who take notes seriously and want an AI that understands their knowledge structure, not just their text. |
12 | 8 |
|
13 | | -## Setup |
| 9 | +## What it does |
| 10 | + |
| 11 | +``` |
| 12 | +You: "What do I know about MCP protocol?" |
| 13 | +Agent: searches vault → finds 8 related notes across topics |
| 14 | +
|
| 15 | +You: "What should this note link to?" |
| 16 | +Agent: analyzes content → suggests 4 missing connections with relevance scores |
| 17 | +
|
| 18 | +You: "Approve the first two" |
| 19 | +Agent: writes [[wikilinks]] directly into your note file |
| 20 | +``` |
| 21 | + |
| 22 | +**Six MCP tools:** |
| 23 | + |
| 24 | +| Tool | What it does | |
| 25 | +|------|-------------| |
| 26 | +| `search` | Four-channel hybrid search: keyword (BM25) + semantic (vector) + knowledge graph (indegree) + title/alias. Fused with Reciprocal Rank Fusion. Filter by tags or folder. | |
| 27 | +| `graph` | Explore a note's neighborhood — outgoing links, backlinks, configurable depth | |
| 28 | +| `suggest_links` | Find notes that should be linked but aren't. Returns scored suggestions | |
| 29 | +| `resolve_suggestion` | Approve (writes `[[link]]` to file) or reject a link suggestion | |
| 30 | +| `index` | Index a note, or list unprocessed notes | |
| 31 | +| `status` | Vault stats: indexed notes, graph size, watcher status | |
| 32 | + |
| 33 | +## Why SeekLink |
| 34 | + |
| 35 | +**Most MCP servers for Obsidian are file managers.** They read, write, and search text. SeekLink understands your knowledge *structure*: it parses `[[wikilinks]]`, builds a knowledge graph, tracks which notes are central (indegree), and finds connections you missed. |
| 36 | + |
| 37 | +**Chinese is a first-class citizen.** jieba tokenization for keyword search + jina-embeddings-v2-base-zh for semantic search. Not "also supports Chinese" — designed for it. Bilingual vaults (Chinese + English) work out of the box. |
| 38 | + |
| 39 | +**Fully local, headless.** Runs on your machine. No Obsidian plugins required, no API keys for search. Works from the terminal with Claude Code, or as MCP server for any client. |
| 40 | + |
| 41 | +## Install |
14 | 42 |
|
15 | 43 | ```bash |
16 | | -uv sync |
| 44 | +uv tool install seeklink |
| 45 | +# or |
| 46 | +pip install seeklink |
17 | 47 | ``` |
18 | 48 |
|
19 | | -## Usage |
| 49 | +## Setup |
| 50 | + |
| 51 | +### MCP server (for Claude Code, Cursor, etc.) |
20 | 52 |
|
21 | | -SeekLink runs as an MCP server — configure it in `.mcp.json`: |
| 53 | +Add to your MCP config: |
22 | 54 |
|
23 | 55 | ```json |
24 | 56 | { |
25 | 57 | "mcpServers": { |
26 | 58 | "seeklink": { |
27 | | - "command": "uv", |
28 | | - "args": ["run", "python", "-m", "seeklink"], |
| 59 | + "command": "seeklink", |
| 60 | + "args": ["serve"], |
29 | 61 | "env": { "SEEKLINK_VAULT": "/path/to/your/vault" } |
30 | 62 | } |
31 | 63 | } |
32 | 64 | } |
33 | 65 | ``` |
34 | 66 |
|
35 | | -Then use the 8 tools through any MCP client (Claude Code, etc.): |
| 67 | +First run indexes your vault automatically. A file watcher keeps the index up to date. |
36 | 68 |
|
37 | | -| Tool | Description | |
38 | | -|------|-------------| |
39 | | -| `search` | Hybrid BM25 + vector search with optional graph expansion | |
40 | | -| `suggest_links` | Find notes worth linking to | |
41 | | -| `approve_suggestion` | Accept a link suggestion (writes `[[link]]` to file) | |
42 | | -| `reject_suggestion` | Dismiss a link suggestion | |
43 | | -| `graph_neighbors` | Show link neighborhood (BFS) | |
44 | | -| `index_note` | Index a note (chunk, embed, parse links) | |
45 | | -| `get_unprocessed` | List notes needing indexing | |
46 | | -| `status` | Index stats, graph size, watcher status | |
| 69 | +### CLI |
47 | 70 |
|
48 | | -## Tests |
| 71 | +```bash |
| 72 | +seeklink search "machine learning" --vault /path/to/vault |
| 73 | +seeklink search "知识管理" --vault /path/to/vault --tags ai --top-k 5 |
| 74 | +seeklink index --vault /path/to/vault |
| 75 | +seeklink status --vault /path/to/vault |
| 76 | +``` |
| 77 | + |
| 78 | +## How search works |
| 79 | + |
| 80 | +SeekLink runs four search channels in parallel and merges results with Reciprocal Rank Fusion: |
| 81 | + |
| 82 | +``` |
| 83 | +Query: "agent memory systems" |
| 84 | + │ |
| 85 | + ├── BM25 (FTS5 + jieba) ──── keyword match ──────── weight 1.0 |
| 86 | + ├── Vector (jina-v2-zh) ──── semantic similarity ── weight 1.0 |
| 87 | + ├── Indegree ─────────────── well-linked = quality ─ weight 0.3 |
| 88 | + └── Title/Alias (FTS5) ──── exact name match ────── weight 3.0 |
| 89 | + │ |
| 90 | + └── RRF Fusion → ranked results |
| 91 | +``` |
| 92 | + |
| 93 | +- **Tags filter:** `search("query", tags=["ai", "mcp"])` — only return notes with these tags |
| 94 | +- **Folder filter:** `search("query", folder="notes/")` — only search within a folder |
| 95 | +- **Expand mode:** `search("query", expand=True)` — include graph neighbors of results |
| 96 | + |
| 97 | +## Frontmatter |
| 98 | + |
| 99 | +SeekLink reads `tags` and `aliases` from YAML frontmatter: |
| 100 | + |
| 101 | +```yaml |
| 102 | +--- |
| 103 | +tags: [ai, machine-learning] |
| 104 | +aliases: [ML, Machine Learning] |
| 105 | +--- |
| 106 | +``` |
| 107 | + |
| 108 | +Both inline (`[a, b]`) and block list formats supported. Aliases are searchable and used for link resolution — if a note has `aliases: [ML]`, then `[[ML]]` resolves to it. |
| 109 | + |
| 110 | +## Architecture |
| 111 | + |
| 112 | +``` |
| 113 | + ┌────────────────────────────────┐ |
| 114 | + │ MCP Client │ |
| 115 | + │ (Claude Code, Cursor, ...) │ |
| 116 | + └──────────┬─────────────────────┘ |
| 117 | + │ stdio / SSE |
| 118 | + ┌──────────▼─────────────────────┐ |
| 119 | + │ FastMCP Server │ |
| 120 | + │ 6 tools, async handlers │ |
| 121 | + └──────────┬─────────────────────┘ |
| 122 | + │ |
| 123 | + ┌────────────────────┼────────────────────┐ |
| 124 | + ▼ ▼ ▼ |
| 125 | + ┌─────────────┐ ┌──────────────┐ ┌──────────────┐ |
| 126 | + │ Search │ │ Ingest │ │ Watcher │ |
| 127 | + │ 4-ch RRF │ │ chunk+embed │ │ watchfiles │ |
| 128 | + └──────┬──────┘ │ +frontmatter│ │ auto-index │ |
| 129 | + │ └──────┬───────┘ └──────────────┘ |
| 130 | + ▼ ▼ |
| 131 | + ┌──────────────────────────────────┐ |
| 132 | + │ SQLite + Extensions │ |
| 133 | + │ FTS5 (jieba) │ vec0 (768d) │ |
| 134 | + │ sources, chunks, wiki_links │ |
| 135 | + │ source_tags, fts_sources │ |
| 136 | + └──────────────────────────────────┘ |
| 137 | +``` |
| 138 | + |
| 139 | +## Configuration |
| 140 | + |
| 141 | +| Variable | Default | Description | |
| 142 | +|----------|---------|-------------| |
| 143 | +| `SEEKLINK_VAULT` | `.` | Path to vault root | |
| 144 | +| `SEEKLINK_SSE_HOST` | `127.0.0.1` | SSE server bind address | |
| 145 | +| `SEEKLINK_SSE_PORT` | `8767` | SSE server port | |
| 146 | + |
| 147 | +## Development |
49 | 148 |
|
50 | 149 | ```bash |
51 | | -uv run python -m pytest tests/ -v |
| 150 | +git clone https://github.com/simonsysun/seeklink |
| 151 | +cd seeklink |
| 152 | +uv sync --dev |
| 153 | +uv run python -m pytest tests/ -q --ignore=tests/test_integration.py |
52 | 154 | ``` |
| 155 | + |
| 156 | +217 tests. Python 3.11+. |
| 157 | + |
| 158 | +## Roadmap |
| 159 | + |
| 160 | +- [ ] Graph intelligence: orphan detection, cluster analysis, bridge notes, knowledge gap discovery |
| 161 | +- [ ] Cross-encoder reranking for top-k results |
| 162 | +- [ ] Lightweight embedding model option (~117MB vs 330MB default) |
| 163 | +- [ ] PyPI automated publishing |
| 164 | + |
| 165 | +See [TODOS.md](TODOS.md) for details. |
| 166 | + |
| 167 | +## License |
| 168 | + |
| 169 | +MIT |
0 commit comments