ai-history
by Bluscream
README.md
# AI History Ingester Daemon & MCP Server
A cross-platform service and Model Context Protocol (MCP) server that watches, ingests, indexes, and searches past chat sessions, agent actions, implementation plans, and artifacts from local AI coding tools (Antigravity IDE, Antigravity CLI, Claude Code, Windsurf, OpenCode, Codex, ChatGPT/Claude exports).
---
## Architecture & Features
1. **Local Disk Recovery (`antigravity-local` tool)**:
- Zero-dependency on external databases. Directly scans and inspects local Antigravity brain sessions (`~/.gemini/antigravity-ide/brain` and `~/.gemini/antigravity/brain`).
- Supports `list`, `search`, `get`, `recover`, and `artifacts` actions.
- Summarizes file names, sizes, creation, and modification timestamps for artifacts before returning specific file content.
2. **Vector Database Integration (Qdrant)**:
- Indexes session transcripts, prompt steps, and agent tool executions into a Qdrant vector database (`ai_history`).
- Provides full-text and semantic search across past sessions and tool executions.
3. **Continuous Background Watcher Daemon**:
- Incremental ingestion watching `brain/` directories, keeping track of file read offsets in `~/.ai-history-ingest-offsets.json`.
4. **Lightweight Web Viewer**:
- Optional browser UI on port `3333` to inspect conversations and tool history.
---
## MCP Configuration
Add the server to your MCP configuration (e.g. `~/.gemini/antigravity-ide/mcp_config.json`, `~/.gemini/config/mcp_config.json`, or Claude Desktop config):
```json
{
"mcpServers": {
"ai-history": {
"command": "node",
"args": [
"/path/to/ai-history-mcp/dist/mcp/server.js"
],
"env": {
"QDRANT_URL": "http://192.168.2.11:6333",
"COLLECTION_NAME": "ai_history"
}
}
}
}
```
---
## Available MCP Tools
| Tool | Purpose | Key Parameters |
| :--- | :--- | :--- |
| `antigravity-local` | Direct local filesystem access to Antigravity sessions, transcripts, and artifacts (bypasses Qdrant). | `action` (`list`, `search`, `get`, `recover`, `artifacts`), `session_id`, `query`, `artifact_name`, `source` |
| `search_ai_chats` | Search chats stored in Qdrant vector database. | `query`, `provider`, `session_id`, `limit` |
| `search_ai_actions` | Search past agent tool invocations (bash, file edits, etc.) in Qdrant. | `tool_name`, `limit` |
| `get_ingestion_stats` | View Qdrant points count, indexed vectors, health status, and local storage stats. | *(none)* |
---
## Running the Ingestion Daemon
### Build
```bash
npm install
npm run build
```
### Manual / Development
```bash
npm run daemon
# or live-reloading:
npm run dev:daemon
```
### Linux (Systemd User Service)
```bash
mkdir -p ~/.config/systemd/user/
cp ai-history-daemon.service ~/.config/systemd/user/
systemctl --user daemon-reload
systemctl --user enable --now ai-history-daemon.service
```
---
## License
Released into the public domain under the [Unlicense](LICENSE).
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo issues