kimetsu-pi 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,17 +1,59 @@
1
+ <div align="center">
2
+
3
+ <img src="https://raw.githubusercontent.com/RodCor/kimetsu/main/docs/assets/kimetsu-logo.png" alt="Kimetsu logo" width="180" />
4
+
1
5
  # kimetsu-pi
2
6
 
3
- Kimetsu brain as a Pi.dev package: persistent, cross-session memory for the Pi coding agent.
7
+ ### Memory for your Pi agent that gets sharper every run.
4
8
 
5
- ## What it is
9
+ </div>
10
+
11
+ **kimetsu-pi** brings [Kimetsu](https://kimetsu.dev) — a local-first memory brain
12
+ for coding agents — to the [Pi](https://pi.dev) coding agent.
13
+
14
+ Coding agents are brilliant and forgetful: every session starts from zero. Kimetsu
15
+ is a sidecar brain that captures the lessons your agent earns, learns which ones
16
+ actually help, and hands them back before the next task. The memory pipeline makes
17
+ **no LLM calls** — storage and retrieval are 100% local, free, and offline-capable.
18
+
19
+ Learn more at **[kimetsu.dev](https://kimetsu.dev)**.
6
20
 
7
- Pi (the Pi.dev coding agent) has no MCP support, so this package brings Kimetsu's
8
- persistent memory to Pi through Pi's own extension points instead:
21
+ ## What it is
9
22
 
10
- - **Extension** (`extensions/kimetsu.ts`) a TypeScript Pi extension that hooks into
11
- Pi lifecycle events (`session_start`, `agent_end`, `session_shutdown`) and shells out
12
- to the `kimetsu` binary to warm, load, and persist brain context around each session.
13
- - **Skill** (`skills/kimetsu-brain/SKILL.md`) — a Pi skill that teaches the agent when
14
- and how to consult and record memories during a task.
23
+ Pi has no MCP layer, so this package brings Kimetsu to Pi through Pi's own
24
+ extension points:
25
+
26
+ - **Extension** (`extensions/kimetsu.ts`) — a TypeScript Pi extension that hooks
27
+ Pi lifecycle events (`session_start`, `agent_end`, `session_shutdown`) and shells
28
+ out to the `kimetsu` binary to warm, load, and persist brain context around each
29
+ session. Each call is capped by a timeout, so a slow or hung binary never stalls
30
+ Pi. If the binary is not on `PATH`, every hook silently no-ops and Pi is
31
+ completely unaffected.
32
+ - **Skill** (`skills/kimetsu-brain/SKILL.md`) — a Pi skill that teaches the agent
33
+ when and how to consult and record memories during a task.
34
+
35
+ ## Why Kimetsu
36
+
37
+ - **Remembers what matters** — conventions, failure patterns, the exact command
38
+ that regenerates your schema. Captured once, retrieved by meaning.
39
+ - **Speaks first** — proactive session-start digests, episodic resumes, and
40
+ pre-task context, so the agent's first turn already knows your repo.
41
+ - **Learns what helps** — cited memories get promoted; stale advice decays and is
42
+ pruned.
43
+ - **Model-free retrieval** — FTS5 + local embeddings + local reranking. Zero API
44
+ cost, works offline.
45
+ - **Stays yours** — one SQLite file per project. No cloud, no vector DB, no
46
+ telemetry. Back it up with `cp`.
47
+
48
+ ## Benchmarks
49
+
50
+ | | |
51
+ |---:|---|
52
+ | **89.4%** | LoCoMo, the long-conversation memory benchmark |
53
+ | **83.0%** | LongMemEval, the public long-term-memory benchmark |
54
+ | **73.3%** | BEAM 100K memory benchmark |
55
+ | **13×** | cheaper per solved task ($0.19 vs $2.47 on a Terminal-Bench slice) |
56
+ | **~1M** | memories in ~3 GB RAM with sub-2s retrieval, one SQLite file |
15
57
 
16
58
  ## Prerequisite
17
59
 
@@ -21,11 +63,9 @@ The `kimetsu` binary must be on `PATH`. Install it with:
21
63
  npm install -g kimetsu-ai
22
64
  ```
23
65
 
24
- or via cargo, or one of the prebuilt archives — see
25
- [github.com/RodCor/kimetsu](https://github.com/RodCor/kimetsu) for all install options.
26
-
27
- If the binary is not found, the extension silently no-ops on every lifecycle hook —
28
- Pi's startup and session behavior are completely unaffected.
66
+ or via cargo or a prebuilt archive — see the
67
+ **[install guide](https://kimetsu.dev/docs/)** for all options. If the binary is
68
+ absent, the extension silently no-ops and Pi is unaffected.
29
69
 
30
70
  ## Install
31
71
 
@@ -49,10 +89,11 @@ npm test
49
89
  npm run typecheck
50
90
  ```
51
91
 
52
- ## License
92
+ ## Links
53
93
 
54
- MIT OR Apache-2.0
94
+ - **Website & docs:** [kimetsu.dev](https://kimetsu.dev)
95
+ - **Main project:** [github.com/RodCor/kimetsu](https://github.com/RodCor/kimetsu)
55
96
 
56
- ## See also
97
+ ## License
57
98
 
58
- Main project: [github.com/RodCor/kimetsu](https://github.com/RodCor/kimetsu)
99
+ MIT OR Apache-2.0
@@ -8,16 +8,32 @@ import { spawn } from "node:child_process";
8
8
 
9
9
  function kimetsuExec(args: string[]): Promise<void> {
10
10
  return new Promise((resolve) => {
11
+ let settled = false;
12
+ let timer: ReturnType<typeof setTimeout> | undefined;
13
+ const done = () => {
14
+ if (settled) return;
15
+ settled = true;
16
+ if (timer !== undefined) clearTimeout(timer);
17
+ resolve();
18
+ };
11
19
  try {
12
20
  const child = spawn("kimetsu", args, {
13
21
  stdio: "ignore",
14
22
  shell: false,
15
23
  windowsHide: true,
16
24
  });
17
- child.on("error", () => resolve()); // binary not on PATH silent no-op
18
- child.on("close", () => resolve());
25
+ // A hung binary must never stall the lifecycle hook: cap the wait and
26
+ // kill the child if it overruns. unref() so the timer alone can't keep
27
+ // the host process alive.
28
+ timer = setTimeout(() => {
29
+ child.kill();
30
+ done();
31
+ }, 10000);
32
+ if (typeof timer.unref === "function") timer.unref();
33
+ child.on("error", done); // binary not on PATH — silent no-op
34
+ child.on("close", done); // finished, or killed by the timeout above
19
35
  } catch {
20
- resolve(); // any unexpected error — silent no-op
36
+ done(); // any unexpected error — silent no-op
21
37
  }
22
38
  });
23
39
  }
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "kimetsu-pi",
3
- "version": "0.1.0",
4
- "description": "Kimetsu brain as a Pi.dev package — persistent cross-session memory for the Pi coding agent.",
5
- "keywords": ["pi-package", "pi", "kimetsu", "memory", "extension", "skill"],
6
- "homepage": "https://github.com/RodCor/kimetsu-pi#readme",
3
+ "version": "0.1.2",
4
+ "description": "Kimetsu brain as a Pi.dev package — local-first, cross-session memory for the Pi coding agent that gets sharper every run.",
5
+ "keywords": ["pi-package", "pi", "kimetsu", "memory", "brain", "rag", "mcp", "extension", "skill"],
6
+ "homepage": "https://kimetsu.dev",
7
7
  "repository": { "type": "git", "url": "git+https://github.com/RodCor/kimetsu-pi.git" },
8
8
  "license": "MIT OR Apache-2.0",
9
9
  "type": "module",
10
10
  "pi": {
11
11
  "extensions": ["./extensions"],
12
- "skills": ["./skills"]
12
+ "skills": ["./skills"],
13
+ "image": "https://raw.githubusercontent.com/RodCor/kimetsu/main/docs/assets/kimetsu-logo.png"
13
14
  },
14
15
  "files": ["extensions/", "skills/", "README.md", "LICENSE"],
15
16
  "engines": { "node": ">=16" },