agent-whisker
by Tomatamatom1
README.md
# agent-whisker
English · [简体中文](README.zh-CN.md)
`agent-whisker` is a local document library and session store for coding agents. It indexes Markdown, plain text, PDFs, DOCX files, and local agent session transcripts on your machine. Agents and operators query passages, physical PDF pages, and conversation turns through the CLI or a read-only stdio MCP server, with optional read-time passage reranking and page-level field extraction.
## Quick start
On Linux, follow the [manual setup](packages/cli/README.md#linux) instead of running the installer commands below.
From a source checkout (Node runs TypeScript directly; keep the checkout in place because the installed launcher points to it):
```sh
git clone https://github.com/Tomatamatom1/agent-whisker.git
cd agent-whisker
pnpm install
node packages/cli/src/main.ts install --dry-run
node packages/cli/src/main.ts install --apply all
```
From npm (or from a [locally packed tarball](packages/cli/README.md#the-npm-package) with `npm install -g <tarball>`):
```sh
npm install -g agent-whisker
agent-whisker install --dry-run
agent-whisker install --apply all
agent-whisker doctor
```
The current release is `0.2.0`, published to npm as `agent-whisker`. Runtime requires Node `>=24.22.1 <25` or `>=26.13.0 <27` (with `~/.local/bin` on `PATH` on macOS). Markdown and plain text import directly. PDF text import requires Poppler's `pdftotext` (`qpdf` adds PDF bookmarks and page slicing), and DOCX import requires Pandoc `>=2.15`.
CI runs checks on macOS, Ubuntu, and Windows. `agent-whisker install` configures launchers, background sync, and agent programs on macOS and Windows; on Linux, the CLI, stdio MCP server, and foreground `service run` work directly. See [Windows setup](packages/cli/README.md#windows).
## Use cases
- **Document retrieval.** Import runbooks, papers, and standards with `agent-whisker ingest <path>`, rank passages with `search`, scan literal strings with `grep -F`, and open matched sections or PDF pages with `read`.
- **Agent session history.** Sync and search transcripts across local coding agents (`sessions sync`, `sessions search`), or inspect surrounding turns with `sessions read`.
- **Read-only MCP retrieval.** Expose seven stdio tools (`library_search`, `library_read`, `library_catalog`, `library_grep`, `session_search`, `session_read`, `session_grep`) to coding agents, plus `library_extract` when an extraction endpoint is configured.
- **Task verification.** Record user expectations, observed command runs (`taskstate run --for <E> -- <command>`), and completion claims separately with `taskstate` so a reviewer on another model can verify the runs after merge.
## Properties
- **Append-only truth, rebuildable indexes.** Under `~/.agent-whisker`, `truth/` holds the append-only journal, versioned document text, and retained sessions. The SQLite FTS5 indexes in `derived/` can be rebuilt with `agent-whisker index repair`.
- **Local lexical search.** Retrieval uses Node's built-in `node:sqlite` and `jieba-wasm` for CJK word segmentation. The npm tarball bundles `jieba-wasm` and `yaml` for offline installation.
- **Session retention and redaction.** Synced session entries remain readable after a host program deletes its own log, and known secret-token patterns are redacted on retention.
- **Versioned sources.** Re-ingesting an edited file or passing `--doc <id>` writes a new version of that document, and `read --version <hash>` pins the exact version returned by a search.
- **Read-time passage filtering.** Setting `AGENT_WHISKER_RERANK_URL` and `AGENT_WHISKER_RERANK_MODEL` (append `#choice` for local `llama-server` group comparison) scores `open`-tier library candidates at read time; on `confident: false`, `hits` is `[]` and weak candidates appear only as locators in `more`.
- **On-demand field extraction.** Setting `AGENT_WHISKER_EXTRACT_URL` enables `agent-whisker extract` and MCP `library_extract` over 1–4 selected PDF pages or images (`open` documents for remote endpoints; `personal` allowed on loopback).
The [architecture guide](docs/architecture.md) states where each of these mechanisms stops.
## How it works
[](docs/architecture.md)
Runtime data flow across a coding agent, `~/.agent-whisker`, optional read-time HTTP endpoints, and standalone `taskstate`. See the [architecture guide](docs/architecture.md).
## Supported agents
`agent-whisker install --apply all` sets up every installed program listed in `AGENT_WHISKER_AGENTS`, registering the MCP server, session collection, context pointers, and `taskstate` integration (any other MCP client can run `agent-whisker mcp` over stdio):
| Program | Install steps | Hooks, skills, and subagents |
| --- | --- | --- |
| Claude Code | `mcp-claude`, `claude-plugin` | `SessionStart` and `UserPromptSubmit` pointers, `taskstate` hooks/skill, `review` and `recall` subagents ([guide](packages/claude-plugin/README.md)) |
| Codex | `mcp-codex`, `codex-plugin` | `SessionStart` and `UserPromptSubmit` pointers and `taskstate` hooks once trusted via `/hooks` ([guide](packages/claude-plugin/README.md)) |
| `pi` | `mcp-pi`, `pi-package` | System-prompt guidance and start pointer, `/agent-whisker`, `agent_whisker_wait`, `taskstate` hooks/skill ([guide](packages/pi-extension/README.md)) |
| Antigravity | `mcp-antigravity`, `antigravity-plugin` | Always-on rule, `SessionStart` and `PreInvocation` hooks, `taskstate` skill, `review` subagent ([guide](packages/antigravity-plugin/README.md)) |
| DeepSeek Harness | `mcp-dsh`, `dsh-plugin`, `dsh-skill` | Root-session start pointer and `taskstate` context/skill ([guide](packages/dsh-plugin/README.md)) |
Optional host integrations route MCP entries through Magpie (`install --apply mcp --via magpie`) and connect Herdr (`install --apply herdr-plugin,herdr-mod`; see [Herdr guide](packages/herdr-plugin/README.md)).
## Task verification
`taskstate` is an append-only task ledger under `~/.local/state/agent-whisker-task` injected into main sessions and subagents by the host hooks. It keeps four record types separate: user outcomes (`expect`), observed command runs (`run`, capturing exit code, git commit, dirty-tree status, and optional `--target` file hashes), agent handoffs (`claim`), and post-merge audit verdicts (`conclude` and `gap`).
```sh
taskstate open "Fix upload retry cap" # opens T1 and attaches this session
taskstate expect "Cap upload retries at 3" --core # records E1 before implementation
taskstate run --for E1 --expect-fail -- pnpm test # records failing baseline check (red)
# ... implement the fix ...
taskstate run --for E1 -- pnpm test # records passing check on clean commit (green)
taskstate claim "Retry cap enforced; see run log" --for E1
taskstate facts # summarizes runs and verification status
```
Use `taskstate hold` to carry an active task across directories or `taskstate park` to set an umbrella task aside. After changes merge, invoke the `review` subagent (preferably on a different model than the implementer) to inspect recorded logs and diffs before running `taskstate close <T>`. See [Task state and review](packages/claude-plugin/README.md).
## Examples
Import documents, search passages, and trace decisions across agent sessions:
```sh
agent-whisker ingest ./runbooks
agent-whisker search "upload retry budget"
agent-whisker grep -F "UPLOAD_RETRY_LIMIT"
agent-whisker sessions sync
agent-whisker sessions search "upload retry budget" --project --group session
```
Browse tasks, the library, sessions, agent setup and `doctor` in one terminal screen (an interactive terminal is required; every write asks first and shows the exact command it runs, see [Terminal interface](packages/cli/README.md#terminal-interface)):
```sh
agent-whisker tui
agent-whisker tui --page sessions
```
Query the read-only MCP server (`tools/call` payloads):
```json
{"name":"library_search","arguments":{"queries":["upload retry budget","UPLOAD_RETRY_LIMIT"]}}
```
```json
{"name":"session_search","arguments":{"queries":["upload retry budget"],"project":true}}
```
Optional read-time filtering (`System One: Decide`) and 1–4 page extraction (`Clairic-Flash`):
```sh
export AGENT_WHISKER_RERANK_URL='http://127.0.0.1:8788/v1/systemone#choice'
export AGENT_WHISKER_RERANK_MODEL='vllm-d3-lite'
agent-whisker search "upload retry budget"
export AGENT_WHISKER_EXTRACT_URL='http://127.0.0.1:18093/v1/systemone'
agent-whisker extract "$DOC_ID" --pages 1,2 --fields '{"invoice_total":{"type":"number"}}' --source-only
```
## Evaluation and boundaries
Retrieval benchmarks ran on Apple Silicon with Node `26.13.1` and SQLite FTS5 (tokenizer revision `t3`), scoring retrieved evidence directly. On LongMemEval-S (500 questions, ~50 sessions per isolated store, 470 questions with ground-truth evidence), `strict@5` requires *all* evidence sessions in the top five results and `hit@5` requires at least one.
| Benchmark | Read path | Result |
| --- | --- | --- |
| LongMemEval-S | Lexical session search (`store.searchSessions`) | 82.3% `strict@5` (387/470); 95.3% `hit@5`; p50 ≈6–11 ms |
| ADEBENCH `sets/quick` | Lexical only (`rerank=off`) | 38.7 / 55 Core |
| ADEBENCH `sets/quick` | Lexical + System One: Decide on read | 42.1 / 55 Core |
| ADEBENCH `sets/public2` (36 questions) | Lexical + System One: Decide on read | 43.5 / 55 Core |
On ADEBENCH `v0.2.17`, the external adapter imported fixtures via the CLI and queried `agent-whisker mcp` over stdio (9,234 bytes for the seven default tools in `tools/list`; median lookup 5 ms on sessions and 16 ms on documents).
Scope boundaries: MCP is read-only (imports and maintenance run through the CLI or background sync service); importing a separate file with a newer value keeps both documents searchable as written (ADEBENCH `updates`: 3.3/10); PDF import reads existing text layers up to 256 MiB per PDF (64 MiB for non-PDF sources and extracted text) without automatic OCR.
## Packages
Nine workspace packages live under `packages/`:
- **Runtime DAG (`cli` → `{mcp, service, core}`, `{mcp, service}` → `core`).** `core` owns storage, FTS5 indexing, `jieba-wasm` tokenization, reranking, and page extraction; `mcp` serves the read-only stdio server; `service` runs background indexing and session sync; `cli` provides the `agent-whisker` command and installer.
- **Host plugins (`claude-plugin`, `pi-extension`, `antigravity-plugin`, `dsh-plugin`, `herdr-plugin`).** None depends on a workspace package; each invokes `agent-whisker` and standalone `taskstate` as subprocesses. See the [package topology](docs/architecture.md#package-topology).
## By role
- Connecting agent programs: [CLI guide](packages/cli/README.md), then [Agent programs](packages/cli/README.md#agent-programs)
- Importing folders and excluding paths: [Ingest](packages/cli/README.md#ingest), then [Core guide](packages/core/README.md)
- Registering an MCP client manually: [MCP guide](packages/mcp/README.md#manual-registration)
- Recording checks for post-merge review: [Task state and review](packages/claude-plugin/README.md)
- Operating and repairing the store: [Architecture](docs/architecture.md), then [Background service](packages/service/README.md)
- Contributing changes: [Documentation map](docs/README.md), [Roadmap](docs/roadmap.md), and [AGENTS.md](AGENTS.md)
## Releases
[`main`](https://github.com/Tomatamatom1/agent-whisker/commits/main/) is the development branch. `node scripts/package.ts pack <directory>` builds a self-contained npm tarball from tracked files, and `v*.*.*` release tags publish to npm through GitHub Actions. The first release, `0.1.0` (tag `v0.1.0`), is on npm as `agent-whisker`.
## License
`agent-whisker` is licensed under the [MIT License](LICENSE). The npm package bundles `jieba-wasm` (MIT) and `yaml` (ISC) and retains their upstream license notices.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues