An economical and fuel(token) efficient AI tool, graph session memory for looong chat session
fish_bridge
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Session-scoped knowledge graph engine for AI chat context compression.**
Converts raw AI chat (40k+ tokens) into a compact typed knowledge graph (~300–800 tokens) and writes it to .github/copilot-instructions.md or CLAUDE.md — automatically included in every AI turn across all modes (ask, edit, agent). No MCP server required for the core workflow.
Install
> Don't have uv? Get it first: curl -LsSf https://astral.sh/uv/install.sh | sh (macOS/Linux) or see uv docs. It replaces pip + pipx + pyenv in one tool — no virtualenv management needed.
**Recommended — uv tool install** (installs both the fish-bridge CLI and fish-bridge-mcp MCP server on your PATH):
After install, two commands are available on your PATH:
- **fish-bridge** — the main CLI (ingest, compile, show, serve, ...)
- **fish-bridge-mcp** — the MCP server for VS Code agent mode
**MCP config only (no permanent install needed):** use uvx directly in your .vscode/mcp.json — it downloads and runs the MCP server on demand:
See the MCP server section below for the full config.
Traditional pip install (for embedding fish-bridge as a library in your own Python project)
2-minute quickstart
That's it. .github/copilot-instructions.md now contains a ~350-token compressed summary of your session, replacing raw history in every future turn.
Backends
| Backend | Install extra | Model | Quality | Cost/turn |
|---|---|---|---|---|
| local (Ollama) | *(none — requires Ollama)* | qwen2.5:7b | ~85% | $0 |
| gemini | [gemini] | gemini-2.5-flash | ~95% | ~$0.0002 |
| openai | [openai] | gpt-4.1-mini | ~93% | ~$0.0003 |
| claude | [claude] | claude-opus-4-7 | ~97% | ~$0.002 |
| hybrid | [claude] or [openai] | local+cloud | best | mixed |
Configure with:
Full CLI reference
MCP server (optional — agent mode only)
The MCP server adds real-time record_turn capture when using VS Code agent mode. It is **not required** — the file-based workflow above works in all modes without it.
Add to .vscode/mcp.json (uses uvx — no prior install needed):
If you used uv tool install fish-bridge-mcp, you can also reference the installed binary directly:
See examples/ for Claude Desktop, Cursor, and Windsurf configs.
**MCP tools**: record_turn, get_context, get_focus, mark_resolved, add_node, export_session, import_session, show_active, list_deferred
Ingest sources
| Source | Command | What it ingests |
|---|---|---|
| Copilot | ingest --source copilot | VS Code Copilot JSONL transcript (auto-discovered) |
| Paste | ingest --source paste | Any chat text — universal fallback |
| Document | merge --source document | Markdown, JSON, YAML specs and ADRs |
| Codebase | merge --source codebase | Git commits + README + HANDOVER |
| Obsidian | merge --source obsidian | Vault notes with wikilinks and frontmatter |
| Session | merge --source session | Prior .chatgraph.json export |