
Aidex
io.github.CSCSoftware由 GitHub 帳號 CSCSoftware 發布v1.8.0更新於 Oct 24, 2026
Persistent code indexing for AI assistants. 50x less context than grep. 11 languages.
概覽
為程式助理提供持久化的本機程式碼索引,支援識別字搜尋、簽章查看、專案概觀、跨專案搜尋、筆記、任務、日誌與螢幕截圖。
- 可以做什麼
- AiDex 使用 Tree-sitter 解析將專案索引到本機 SQLite 資料庫,並提供工具進行精確、包含或語意的識別字搜尋,以及在不讀取整個檔案的情況下取得檔案簽章。它也提供專案概觀與檔案樹、跨專案與全域搜尋、工作階段筆記、任務清單、可接收任意程式 HTTP 日誌的日誌接收器,以及可縮放與減色以節省 token 的螢幕截圖。瀏覽器檢視器可顯示檔案樹、任務與即時日誌。
- 適用情境
- 適合助理反覆用 grep 或讀取大型檔案來尋找定義的情況,也適合希望搜尋結果能跨工作階段保留並涵蓋多個專案時。若希望助理記錄工作階段筆記、管理任務清單,或讀取執行中應用程式的日誌與螢幕截圖,也可考慮使用。
- 執行需求
- 以本機程序執行,從 npm 套件 aidex-mcp 安裝,需要 Node.js 20 或更新版本。未宣告帳號、API 金鑰或環境變數。索引儲存在本機 .aidex 目錄,全域資料儲存在使用者層級資料庫。選用的嵌入與 LLM 功能在檢視器設定中配置。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Aidex,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
AiDex
[npm version] [MIT License] [Node.js 20+] [MCP Server] [GitHub Discussions]
The persistent brain for AI coding agents.
AiDex is an MCP server that gives AI coding assistants a memory, semantic search, and live telemetry — local-first, model-agnostic. Works with any MCP-compatible AI assistant: Claude Code, Claude Desktop, Cursor, Windsurf, Gemini CLI, VS Code Copilot, and more.
Three Pillars
🧠 Memory — Tasks, notes, and session-notes survive every chat. Auto-logged history, scheduled tasks, cross-session continuity. Your AI knows tomorrow what mattered today.
🔍 Search — Three modes: exact (identifier), semantic (concept), hybrid (RRF fusion of both). Embeds code, docs, and workspace items into one ranking. Cross-project — every repo in one query. Optional LLM layer translates non-English queries and reranks results.
🌐 Telemetry — LogHub receives live logs from any app via HTTP (no SDK). The AI watches what your code actually does, not just what it says. Live-streamed in the Viewer.
And yes — it's still 50× more token-efficient than grep.
What's Inside — 33 Tools in One Server
14 languages — C#, TypeScript, JavaScript, Rust, Python, C, C++, Java, Go, PHP, Ruby, HCL/Terraform, Kotlin, Swift — plus Astro frontmatter
Quick Examples — see it in action
Table of Contents
- What's Inside
- Semantic Search & LLM Layer 🆕
- The Problem
- The Solution
- Why Not Just Grep?
- How It Works
- Features
- Supported Languages
- Quick Start
- Available Tools
- Time-based Filtering
- Project Structure
- Session Notes
- Task Backlog
- Global Search
- AI Guidelines
- Log Hub
- Debug Dashboard
- Screenshots — LLM-Optimized
- Interactive Viewer
- CLI Usage
- Performance
- Technology
- Contributing
- License
Semantic Search & LLM Layer
v2.0 added semantic search via locally-run embeddings — your AI can find a function even when it doesn't know the exact identifier.
Three modes — pick the right tool for the question
What gets embedded
- Code — every method and type, three-tier chunking (signature + doc-comment + weighted identifier bag)
- Docs — Markdown sections (README, CHANGELOG, docs/, plan files), split at heading boundaries
- Workspace — tasks, task logs, session notes, archived note history
One ranking, all kinds. A query like "how to write logs from external programs" surfaces the README's ## Log Hub section first, then the log method in commands/log.ts, then any related task.
Setup
Or use the Settings tab in the Viewer (aidex_settings({ path: ".", open: true })) — toggles for embeddings, LLM provider, model, and the privacy switch.
Optional LLM layer
When an Anthropic / OpenAI / OpenRouter / Ollama / HuggingFace API key is configured, AiDex can:
- Translate non-English queries → "wie speichere ich Logs lokal" finds the right code
- Expand vague queries into 2-4 concrete subqueries (RRF-merged)
- Rerank top-N retrieval candidates
Privacy switch llm_send_code defaults to off — only your literal query and metadata (paths, names, anchors) are sent. Code bodies stay local. Per-project, easy to verify in Settings.
Local-first: works fully offline with pure embeddings. The LLM layer is opt-in, never required.
The Problem
Every time your AI assistant searches for code, it:
- Greps through thousands of files → hundreds of results flood the context
- Reads file after file to understand the structure → more context consumed
- Forgets everything when the session ends → repeat from scratch
A single "Where is X defined?" question can eat 2,000+ tokens. Do that 10 times and you've burned half your context on navigation alone.
The Solution
Index once, query forever:
Result: 50-80% less context used for code navigation.
Why Not Just Grep?
The real cost of grep: Every grep result includes surrounding context. Search for User in a large project and you'll get hundreds of hits - comments, strings, partial matches. Your AI reads through all of them, burning context tokens on noise.
AiDex indexes identifiers: It uses Tree-sitter to actually parse your code. When you search for User, you get the class definition, the method parameters, the variable declarations - not every comment that mentions "user".
How It Works
-
Index your project once (~1 second per 1000 files)
-
AI searches the index instead of grepping
-
Get file overviews without reading entire files
The index lives in .aidex/index.db (SQLite) - fast, portable, no external dependencies.
Features
- Tree-sitter Parsing: Real code parsing, not regex — indexes identifiers, ignores keywords and noise
- ~50 Tokens per Search: vs 2000+ with grep — your AI keeps its context for actual work
- Persistent Index: Survives between sessions — no re-scanning, no re-reading
- Incremental Updates: Re-index single files after changes, not the whole project
- Time-based Filtering: Find what changed in the last hour, day, or week
- Auto-Cleanup: Excluded files (e.g., build outputs) are automatically removed from index
- Zero Dependencies: SQLite with WAL mode — single file, fast, portable
Supported Languages
Quick Start
Prerequisites
- Node.js ≥ 20 (check with
node --version)- macOS:
brew install nodeornvm install 20 && nvm use 20 - Linux: use your package manager or nvm
- Windows: nodejs.org
- If you use
nvm, the repo ships a.nvmrc—nvm usepicks the right version automatically.
- macOS:
1. Install
That's it. Setup runs automatically after install — it detects your installed AI clients (Claude Code, Claude Desktop, Cursor, Windsurf, Gemini CLI, VS Code Copilot) and registers AiDex as an MCP server. It also adds usage instructions to your AI's config (~/.claude/CLAUDE.md, ~/.gemini/GEMINI.md).
To re-run setup manually: aidex setup | To unregister: aidex unsetup | To skip auto-setup: AIDEX_NO_SETUP=1 npm install -g aidex-mcp
2. Or register manually with your AI assistant
For Claude Code (~/.claude/settings.json or ~/.claude.json):
For Claude Desktop (%APPDATA%/Claude/claude_desktop_config.json on Windows):
Note: Both
aidexandaidex-mcpwork as command names.
Important: The server name in your config determines the MCP tool prefix. Use
"aidex"as shown above — this gives you tool names likeaidex_query,aidex_signature, etc. Using a different name (e.g.,"codegraph") would change the prefix accordingly.
For Gemini CLI (~/.gemini/settings.json):
For VS Code Copilot (run MCP: Open User Configuration in Command Palette):
For other MCP clients: See your client's documentation for MCP server configuration.
3. Make your AI actually use it
Add to your AI's instructions (e.g., ~/.claude/CLAUDE.md for Claude Code, or the equivalent for your AI client). This tells the AI when and how to use AiDex instead of grepping:
Do I want to search code? ├── .aidex/ exists → STOP! Use AiDex instead ├── .aidex/ missing → run aidex_init (don't ask), THEN use AiDex └── Config/Logs/Text → Grep/Read is fine
aidex_note({ path: ".", note: "Test the fix after restart" }) # Write aidex_note({ path: ".", note: "Also check edge cases", append: true }) # Append aidex_note({ path: "." }) # Read aidex_note({ path: ".", search: "parser" }) # Search history aidex_note({ path: ".", clear: true }) # Clear
aidex_task({ path: ".", action: "create", title: "Fix bug", priority: 1, tags: "bug" }) aidex_task({ path: ".", action: "update", id: 1, status: "done" }) aidex_task({ path: ".", action: "log", id: 1, note: "Root cause found" }) aidex_tasks({ path: ".", status: "active" })
Scheduled & recurring tasks
aidex_task({ path: ".", action: "create", title: "Check PR status", due: "3d", interval: "3d", task_action: "gh pr list" })
aidex_global_init({ path: "/path/to/all/repos" }) # Scan & register aidex_global_init({ path: "...", index_unindexed: true }) # + auto-index small projects aidex_global_query({ term: "TransparentWindow", mode: "contains" }) # Search everywhere aidex_global_signatures({ term: "Render", kind: "method" }) # Find methods everywhere aidex_global_status({ sort: "recent" }) # List all projects
aidex_screenshot() # Full screen aidex_screenshot({ mode: "active_window" }) # Active window aidex_screenshot({ mode: "window", window_title: "VS Code" }) # Specific window aidex_screenshot({ scale: 0.5, colors: 2 }) # B&W, half size (ideal for LLM) aidex_screenshot({ colors: 16 }) # 16 colors (UI readable) aidex_windows({ filter: "chrome" }) # Find window titles
4. Index your project
Ask your AI: "Index this project with AiDex"
Or manually in the AI chat:
Available Tools
Time-based Filtering
Track what changed recently with modified_since and modified_before:
Supported formats:
- Relative:
30m(minutes),2h(hours),1d(days),1w(weeks) - ISO date:
2026-01-27or2026-01-27T14:30:00
Perfect for questions like "What did I change in the last hour?"
Project Structure
AiDex indexes ALL files in your project (not just code), letting you query the structure:
File types: code, config, doc, asset, test, other, dir
Use modified_since to find files changed in this session - perfect for "What did I edit?"
Session Notes
Leave reminders for the next session - no more losing context between chats:
Note History (v1.10): Old notes are automatically archived when overwritten or cleared. Browse and search past notes:
Note Summaries (v1.15): Provide a summary when writing/clearing a note — the archived note gets this one-sentence description. History then shows summaries instead of truncated text:
Use cases:
- Before ending a session: "Remember to test X next time"
- AI auto-reminder: Save what to verify after a restart
- Handover notes: Context for the next session without editing config files
- Search past sessions: "What did we do about the parser?"
Notes are stored in the SQLite database (.aidex/index.db) and persist indefinitely.
Task Backlog
Keep your project tasks right next to your code index - no Jira, no Trello, no context switching:
Scheduled & Recurring Tasks
Tasks can have due dates and repeat intervals. Overdue tasks are reported at every session start across ALL projects:
Due formats: Relative ("30m", "2h", "3d", "1w") or ISO date ("2026-04-10")
At every aidex_session call, the Task Scheduler checks ~/.aidex/global.db for due tasks across all projects — even if you're working on a different project. Recurring tasks automatically advance their due date after each trigger.
Features:
- Summaries: One-sentence table-of-contents per task — scan the backlog without reading full details
- Priorities: 🔴 high, 🟡 medium, ⚪ low
- Statuses:
backlog → active → done | cancelled - Tags: Categorize tasks (
bug,feature,docs, etc.) - History log: Every status change is auto-logged, plus manual notes
- Scheduling: Due dates, recurring intervals, actions, auto-execute across all projects
- Viewer integration: Tasks tab in the browser viewer with live updates
- Persistent: Tasks survive between sessions, stored in
.aidex/index.db
Your AI assistant can create tasks while working ("found a bug in the parser, add it to the backlog"), track progress, and pick up where you left off next session.
Global Search
Search across ALL your indexed projects at once. Perfect for "Have I ever written a transparent window?" or "Where did I use that algorithm?"
Setup
This scans your project directory, registers all AiDex-indexed projects in a global database (~/.aidex/global.db), and reports any unindexed projects it finds by detecting project markers (.csproj, package.json, Cargo.toml, etc.).
With index_unindexed: true, it also auto-indexes all discovered projects with ≤500 code files. Larger projects are listed separately for user decision. Add show_progress: true to open a live progress UI in your browser (http://localhost:3334).
Search
How it works
- Uses SQLite
ATTACH DATABASEto query project databases directly — no data copying - Results are cached in memory (5-minute TTL) for fast repeated queries
- Projects are batched (8 at a time) to respect SQLite's attachment limit
- Each project keeps its own
.aidex/index.dbas the single source of truth - Auto-deduplication: Parent projects that contain sub-projects are automatically skipped (e.g.,
MyApp/is removed whenMyApp/Frontend/andMyApp/Backend/exist as separate indexed projects)
Management
AI Guidelines
Store persistent coding conventions, review checklists, and AI instructions in a single place — shared across all projects.
Use cases:
- Code review checklist: Tell your AI exactly what to look for every time
- Coding conventions: Store team style rules once, reference them in any project
- Release checklist: Step-by-step process for shipping
- Project-agnostic instructions: No more pasting the same context into every session
Guidelines are stored in ~/.aidex/global.db — available across all your projects without aidex_init. Ask your AI: "Load the review guideline and apply it to this file."
Log Hub — Universal Logging
Turn any program into a log source for your AI assistant. Your app sends logs via HTTP POST, the AI queries them via MCP, and you see them live in the Viewer — zero dependencies, zero setup in your code.
How it works
Quick start
- AI starts the Log Hub:
aidex_log({ action: "init" }) - AI opens the Viewer:
aidex_viewer({ path: "." })— Logs tab shows live stream - Add one line to your program:
HTTP API
Fields: level (debug/info/warn/error), source (app name), message (text, required), data (optional JSON), timestamp (optional, ms)
Features
- Ring Buffer: Fixed-size in-memory FIFO (default 10,000 entries) — oldest entries overwritten
- Zero-cost: No server, no buffer, no resources until
initis called - Persistence: Optional SQLite storage with 7-day auto-cleanup (
persist: true) - Consume pattern:
querywithconsume: trueremoves returned entries — ideal for polling - Viewer integration: Logs tab with WebSocket live-stream, level/source/text filters, auto-scroll
- Fire & forget: Just POST and go — if the server isn't running, the POST silently fails
Control API — let the AI drive your app
Logs and dashboard widgets flow app → AI. The Control API is the return channel: AI → app. It turns the Log Hub into a tiny, zero-dependency command bus — so an AI assistant can drive any running program without you writing a server.
The AI sets a command; your app polls for it, runs it, and posts the result back:
control_set { id, value }— the AI (or a Viewer slider/switch) sets a control slot.GET /control— your app reads all current control values.POST /control— your app writes back results / acknowledgements.POST /control/press { id }— registers one press of abuttoncontrol. The hub owns the counter, so presses from several open dashboards add up instead of overwriting each other.control_get— the AI reads what the app reported.POST /control/subscribe(optional) — push instead of polling, see below.
Push instead of poll. If your app runs its own HTTP server, it can subscribe once with { "port": 8080 } (the hub calls back the sender's address, path defaults to /control) or a full { "url": "http://192.168.1.50:8080/control" }, optionally limited to { "ids": [...] }. From then on every change is POSTed to that URL right away, as the same flat { id: value } map GET /control returns. No idle requests, no latency until the next poll. The hub never blocks on your app (1.5 s timeout, one request in flight, changes in between are merged so the latest value always arrives last), only calls private-network IP addresses, and drops the subscription after 3 failed deliveries — re-subscribing is idempotent, do it whenever you like. POST /control/unsubscribe { url } removes it. Push is an addition, not a replacement: keep a slow poll (~30 s) as a safety net; button counters make a missed push harmless.
A
buttonvalue is a press counter, not a flag — your app polls at its own pace, so compare against the last count you saw rather than testing for "pressed". Any backwards jump means the hub restarted or the panel was cleared: adopt the value, don't read it as a million presses.
Two slots by convention give you full request/response: a *_cmd slot the AI writes, a *_result slot the app writes, and an *_ack counter so each command runs exactly once (bump the command id every time; the app skips any id it has already handled).
That's the whole protocol. A client needs nothing but an HTTP library you already have.
Real example — an AI controlling Autodesk Fusion 360
A ~30-line Fusion 360 add-in (urllib only, no SDK) polls GET /control, executes the command on Fusion's main thread, and posts the result back. With nothing else, an AI assistant drove Fusion to parametrically design a complete 3D enclosure — sketches, extrusions, screw-boss domes with heat-set inserts, USB-C cut-outs, reset/button holes — verifying every step by reading back the actual face geometry.
The pattern is universal: anything that can POST and GET — Blender, a CNC controller, a game, a home-automation hub — becomes AI-steerable with a few lines and no bespoke server. Two safety rules carry over from that build:
- Single-thread GUI APIs: the poll loop must never touch the app API directly. Fire an event and run the command on the main thread (the official Fusion pattern; the same holds for any non-thread-safe UI/COM API).
- Idempotency: track the last handled
idand ack it — polling means you'll see the same command repeatedly, so skip what you've already done.
Debug Dashboard
The scrolling log stream is great for what happened when — but useless for fast, repeating values (audio levels, buffer fill, FPS, sensor readings). The Debug Dashboard is the opposite: a fixed-slot panel where each value has a permanent spot and overwrites in place instead of scrolling away. Live in the Viewer's Live tab, styled like a hardware monitor (MSI Afterburner / HWiNFO).
It rides on the same Log Hub server — no extra setup. Your program sends widget updates via HTTP POST; sending the same id again updates that widget.
Widget types
Send a widget
Fields: id (required), type (label/progress/gauge/plot/slider/number/toggle/button, required on first send), value (number, status string, or number array for a full plot frame), group, label, unit, min, max, warn, crit, color, order.
Endpoints: POST /panel (one), POST /panels (batch), POST /panel/clear ({id} for one, empty for all).
Lifecycle
- The server keeps the last state per
id, so a freshly-opened or reloaded Viewer shows the whole dashboard immediately. - Cards with no update for ~3 s grey out as "stale".
- Clear is a full reset: it empties the store. A source only reappears if it sends widgets with their
typeagain (plain value-only updates to a cleared id are ignored). - Backpressure-guarded — a slow browser can't make the server's send-queue grow without bound.
Try it — the built-in demo
A ready-to-run showcase animates all widget types (audio waveform, GPU gauges drifting through their zones, a signal generator cycling sine → sawtooth → triangle → square, latency spikes):
Or use the ▷ Demo button on the Live tab — it copies the run command to your clipboard; paste it into a terminal. (The browser can't spawn a process itself.) It sits in the toolbar even while the dashboard is still empty, since it's how you get your first widgets. scripts/demo-dashboard.ps1 is a one-command launcher that checks the Log Hub first.
Running it twice starts two instances that fight over the same widgets (visible flicker) — stop the old one (Ctrl+C) before starting another.
Screenshots — LLM-Optimized
Take screenshots and reduce them up to 95% for LLM context. A typical screenshot goes from ~100 KB to ~5 KB — that's thousands of tokens saved per image.
Why this matters
Most screenshots in AI context are for reading text — error messages, logs, UI labels. You don't need 16 million colors for that.
Usage
Optimization parameters
Recommended strategy for AI assistants
The tool description tells LLMs to optimize automatically:
- Start aggressive:
scale: 0.5, colors: 2(smallest possible) - If unreadable: retry with
colors: 16(adds shading for UI elements) - If still unclear: try
scale: 0.75or full color - Remember: cache what works per window/app for the rest of the session
This way the AI learns the right settings per app without wasting tokens on oversized images.
Features
- 5 capture modes: Fullscreen, active window, specific window (by title), interactive region selection, coordinate-based rectangle
- Cross-platform: Windows (PowerShell + System.Drawing), macOS (sips + ImageMagick), Linux (ImageMagick)
- Multi-monitor: Select which monitor to capture
- Delay: Wait N seconds before capturing (e.g., to open a menu first)
- Size reporting: Shows original → optimized size and percentage saved
- Auto-path: Default saves to temp directory with fixed filename
- No index required: Works standalone, no
.aidex/needed
Interactive Viewer
Explore your indexed project visually in the browser:
Opens http://localhost:3333 with:
- Interactive file tree - Click to expand directories
- File signatures - Click any file to see its types and methods
- Live reload - Changes detected automatically while you code
- Git status icons - See which files are modified, staged, or untracked
- Search tab - Semantic / exact / hybrid search across code, docs, tasks & notes, with the optional LLM layer (translate + rerank)
- Live tab - Live Debug Dashboard: fixed-slot widgets (plots, gauges, progress) plus interactive sliders, switches and buttons that drive a running program back through the
/controlchannel - Logs tab - Live log stream from Log Hub with filters (level, source, text search)
- Tasks tab - View and manage your task backlog
- Settings tab - Configure embeddings & the LLM provider (privacy switch defaults to off)
Debug Dashboard — live, two-way
The Live tab is a live dashboard with fixed slots: send the same id again and the value updates in place instead of scrolling away. Interactive slider/number/toggle/button widgets flow back to the source (HTTP /control, or aidex_log control_set so the AI can tune a running program too). A button carries a press counter, not a flag, so a source polling at its own pace never misses a click. Full guide: docs/loghub-panel-dashboard.md.
[The Live Dashboard — plots, gauges and the four interactive control types side by side]
The Controls group holds one of each interactive type: a slider, two toggles, and a button with its press counter beside it. Scrolled further down, several sources share the same dashboard — the hub knows nothing about what any value means, so a synth firmware and a demo script coexist without either being aware of the other:
[Further down the same dashboard — gauges, plots and controls from several sources at once]
The sliders react in real time — watch the GIF:
[Tuning sliders drive the live waveform plots]
The rest of the Viewer
[AiDex Viewer - Semantic & hybrid search]
[AiDex Viewer - Settings (embeddings & LLM)]
[AiDex Viewer - Code signatures]
Close with aidex_viewer({ path: ".", action: "close" })
CLI Usage
aidex-mcpworks as an alias foraidex.
Performance
Technology
- Parser: Tree-sitter - Real parsing, not regex
- Database: SQLite with WAL mode - Fast, single file, zero config
- Protocol: MCP - Works with any compatible AI
Project Structure
Community
GitHub Discussions — Ask questions, share your setup, suggest ideas.
Contributing
See CONTRIBUTING.md for full details. Quick summary:
- Bug? → Open an issue
- Idea? → Start a Discussion
- New language? → Add a keyword file in
src/parser/languages/and open a PR
License
MIT License - see LICENSE
Authors
Uwe Chalas & Claude
來源:README.md,提交 6d33b31
工具
0版本歷史
1- v1.8.0最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分