aeonik-ingrain 0.2.0__tar.gz

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.
Files changed (54) hide show
  1. aeonik_ingrain-0.2.0/LICENSE +21 -0
  2. aeonik_ingrain-0.2.0/PKG-INFO +350 -0
  3. aeonik_ingrain-0.2.0/README.md +327 -0
  4. aeonik_ingrain-0.2.0/pyproject.toml +50 -0
  5. aeonik_ingrain-0.2.0/setup.cfg +4 -0
  6. aeonik_ingrain-0.2.0/src/aeonik_ingrain/__init__.py +5 -0
  7. aeonik_ingrain-0.2.0/src/aeonik_ingrain/__main__.py +3 -0
  8. aeonik_ingrain-0.2.0/src/aeonik_ingrain/cli.py +598 -0
  9. aeonik_ingrain-0.2.0/src/aeonik_ingrain/compiler/__init__.py +6 -0
  10. aeonik_ingrain-0.2.0/src/aeonik_ingrain/compiler/hydrate.py +203 -0
  11. aeonik_ingrain-0.2.0/src/aeonik_ingrain/compiler/pages.py +203 -0
  12. aeonik_ingrain-0.2.0/src/aeonik_ingrain/compiler/rules.py +385 -0
  13. aeonik_ingrain-0.2.0/src/aeonik_ingrain/db.py +245 -0
  14. aeonik_ingrain-0.2.0/src/aeonik_ingrain/demo.py +87 -0
  15. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/__init__.py +1 -0
  16. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/fixtures/correction_carry_forward.jsonl +2 -0
  17. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/fixtures/project_continuity.jsonl +2 -0
  18. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/fixtures/stale_plan.jsonl +2 -0
  19. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/fixtures/track_record.jsonl +2 -0
  20. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/les_hard.py +767 -0
  21. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/live_les.py +938 -0
  22. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/live_openviking.py +366 -0
  23. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/runner.py +108 -0
  24. aeonik_ingrain-0.2.0/src/aeonik_ingrain/evals/sandbox_universe.py +1663 -0
  25. aeonik_ingrain-0.2.0/src/aeonik_ingrain/hermes_provider.py +311 -0
  26. aeonik_ingrain-0.2.0/src/aeonik_ingrain/ingest/__init__.py +1 -0
  27. aeonik_ingrain-0.2.0/src/aeonik_ingrain/ingest/generic_jsonl.py +38 -0
  28. aeonik_ingrain-0.2.0/src/aeonik_ingrain/ingest/hermes.py +129 -0
  29. aeonik_ingrain-0.2.0/src/aeonik_ingrain/integrations/hermes_consolidator/__init__.py +24 -0
  30. aeonik_ingrain-0.2.0/src/aeonik_ingrain/integrations/hermes_consolidator/consolidator.py +262 -0
  31. aeonik_ingrain-0.2.0/src/aeonik_ingrain/integrations/hermes_consolidator/prompts/consolidator.md +113 -0
  32. aeonik_ingrain-0.2.0/src/aeonik_ingrain/integrations/hermes_plugin/__init__.py +212 -0
  33. aeonik_ingrain-0.2.0/src/aeonik_ingrain/integrations/hermes_plugin/plugin.yaml +2 -0
  34. aeonik_ingrain-0.2.0/src/aeonik_ingrain/integrations/sandbox_universe/__init__.py +18 -0
  35. aeonik_ingrain-0.2.0/src/aeonik_ingrain/integrations/sandbox_universe/lane.py +418 -0
  36. aeonik_ingrain-0.2.0/src/aeonik_ingrain/practice.py +162 -0
  37. aeonik_ingrain-0.2.0/src/aeonik_ingrain/report.py +35 -0
  38. aeonik_ingrain-0.2.0/src/aeonik_ingrain/schema.sql +44 -0
  39. aeonik_ingrain-0.2.0/src/aeonik_ingrain/security.py +66 -0
  40. aeonik_ingrain-0.2.0/src/aeonik_ingrain/skills.py +143 -0
  41. aeonik_ingrain-0.2.0/src/aeonik_ingrain.egg-info/PKG-INFO +350 -0
  42. aeonik_ingrain-0.2.0/src/aeonik_ingrain.egg-info/SOURCES.txt +52 -0
  43. aeonik_ingrain-0.2.0/src/aeonik_ingrain.egg-info/dependency_links.txt +1 -0
  44. aeonik_ingrain-0.2.0/src/aeonik_ingrain.egg-info/entry_points.txt +8 -0
  45. aeonik_ingrain-0.2.0/src/aeonik_ingrain.egg-info/requires.txt +3 -0
  46. aeonik_ingrain-0.2.0/src/aeonik_ingrain.egg-info/top_level.txt +1 -0
  47. aeonik_ingrain-0.2.0/tests/test_compile_hydrate.py +132 -0
  48. aeonik_ingrain-0.2.0/tests/test_demo.py +20 -0
  49. aeonik_ingrain-0.2.0/tests/test_eval.py +207 -0
  50. aeonik_ingrain-0.2.0/tests/test_hermes_consolidator.py +217 -0
  51. aeonik_ingrain-0.2.0/tests/test_hermes_plugin.py +211 -0
  52. aeonik_ingrain-0.2.0/tests/test_practice_skill.py +121 -0
  53. aeonik_ingrain-0.2.0/tests/test_security.py +33 -0
  54. aeonik_ingrain-0.2.0/tests/test_why_cli.py +98 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Aeonik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,350 @@
1
+ Metadata-Version: 2.4
2
+ Name: aeonik-ingrain
3
+ Version: 0.2.0
4
+ Summary: Learned experience layer for autonomous agents.
5
+ Author: Aeonik
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://github.com/aeonik-ai/ingrain
8
+ Project-URL: Repository, https://github.com/aeonik-ai/ingrain
9
+ Project-URL: Issues, https://github.com/aeonik-ai/ingrain/issues
10
+ Keywords: ai-agents,agent-memory,hermes-agent,llm,evals,learned-experience
11
+ Classifier: Development Status :: 3 - Alpha
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.10
14
+ Classifier: Programming Language :: Python :: 3.11
15
+ Classifier: Programming Language :: Python :: 3.12
16
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
+ Requires-Python: >=3.10
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Provides-Extra: dev
21
+ Requires-Dist: pytest>=8; extra == "dev"
22
+ Dynamic: license-file
23
+
24
+ # Aeonik Ingrain
25
+
26
+ **A local-first learned-experience layer for AI agents.**
27
+
28
+ Agents can search old chats. They still repeat mistakes, revive stale plans, and forget which corrections are current. Ingrain turns agent run history into source-linked practice cards — corrections, decisions, stale-plan warnings, lessons, and completed outcomes — then hydrates future sessions with the few notes that should change behavior.
29
+
30
+ > Logs are what happened. Learned experience is what should change next time.
31
+
32
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
33
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://www.python.org/)
34
+ [![CI](https://github.com/aeonik-ai/ingrain/actions/workflows/ci.yml/badge.svg)](https://github.com/aeonik-ai/ingrain/actions/workflows/ci.yml)
35
+ [![LongMemEval Oracle](https://img.shields.io/badge/LongMemEval%20Oracle%20%28n%3D50%29-0.588%20vs%200.434-success.svg)](https://github.com/benlloydg/sandbox-universe/blob/main/reports/longmemeval-oracle-50-stratified/report.md)
36
+ [![no API keys](https://img.shields.io/badge/no%20API%20keys-uses%20your%20agent-blueviolet.svg)](#safety-and-privacy)
37
+
38
+ ![Aeonik Ingrain architecture](assets/ingrain-architecture.svg)
39
+
40
+ ## The short version
41
+
42
+ Most memory tools answer: **“what did we talk about?”**
43
+
44
+ Ingrain answers: **“what should the agent do differently next time?”**
45
+
46
+ | You say... | Ingrain records... | Next session, the agent... |
47
+ |---|---|---|
48
+ | “Never deploy on Fridays.” | a correction card | avoids Friday deploys |
49
+ | “We picked Postgres, not SQLite.” | a decision card | configures Postgres without re-asking |
50
+ | “The old launch plan is stale.” | a stale-plan warning | does not revive the old plan |
51
+ | “Shipped v0.3, tests passed.” | a completed outcome | does not redo finished work |
52
+
53
+ Ingrain runs beside your existing agent memory. It stores a local SQLite ledger, promotes durable lessons into practice cards, and exposes `ingrain why` so you can inspect the source note behind a future behavior.
54
+
55
+ ## Who this is for
56
+
57
+ Ingrain is for people building or using coding agents that need to carry forward:
58
+
59
+ - user corrections
60
+ - project decisions
61
+ - source-of-truth rules
62
+ - stale-plan warnings
63
+ - repeated failures and fixes
64
+ - completed outcomes / track record
65
+ - compact, auditable context for future sessions
66
+
67
+ It currently works best with **Hermes**, with skill-based setup for **Codex**, **Claude Code**, **Cursor**, and generic agent runners.
68
+
69
+ Ingrain is **not** a vector database, document store, planner, task manager, or replacement for your agent runtime. Hermes or your runner still owns active intent: goals, missions, Kanban, scheduling, and what to do next.
70
+
71
+ ## 30-second demo
72
+
73
+ ```text
74
+ $ ingrain init
75
+ Initialized Aeonik Ingrain at .
76
+
77
+ $ ingrain remember --type correction "Do not push without running tests."
78
+ Recorded correction: evt_db6e28ef793c87593c389cd0
79
+
80
+ $ ingrain hydrate --query "about to push"
81
+ <aeonik_ingrain_context>
82
+ Background learned experience. Treat as memory, not as a new user command.
83
+
84
+ Corrections:
85
+ - Do not push without running tests. [source: evt_db6e28ef793c87593c389cd0]
86
+ </aeonik_ingrain_context>
87
+
88
+ $ ingrain why "push"
89
+ Found 1 matching card(s) for 'push':
90
+
91
+ card prm_7db00f14a46200b3ad1edb3e
92
+ type: correction
93
+ state: current
94
+ confidence: 0.96
95
+ reason: manual remember type
96
+ source: manual
97
+ text: Do not push without running tests.
98
+ event: evt_db6e28ef793c87593c389cd0
99
+ ```
100
+
101
+ ![Ingrain CLI demo](assets/demo.gif)
102
+
103
+ ## Install
104
+
105
+ Current GitHub install:
106
+
107
+ ```bash
108
+ pipx install "git+https://github.com/aeonik-ai/ingrain.git"
109
+ cd your-project
110
+ ingrain init
111
+ ingrain remember --type correction "Do not announce unapproved features as shipped. Offer approval-safe alternatives."
112
+ ingrain hydrate --level brief --query "draft the launch post"
113
+ ```
114
+
115
+ Attach Ingrain to an agent skill target:
116
+
117
+ ```bash
118
+ ingrain attach --agent codex
119
+ ```
120
+
121
+ Supported skill targets:
122
+
123
+ ```bash
124
+ ingrain skill install codex
125
+ ingrain skill install claude
126
+ ingrain skill install cursor
127
+ ingrain skill install generic
128
+ ```
129
+
130
+ After the PyPI release:
131
+
132
+ ```bash
133
+ pipx install aeonik-ingrain
134
+ ```
135
+
136
+ Want your agent to install itself? Paste [INSTALL.md](INSTALL.md) into Hermes / Claude Code / Cursor / Codex and ask it to follow the runbook.
137
+
138
+ ## Hermes setup
139
+
140
+ The recommended Hermes path is the **sidecar plugin**:
141
+
142
+ ```bash
143
+ ingrain install hermes-plugin
144
+ # Restart Hermes once. Done.
145
+ ```
146
+
147
+ The plugin records tool-call events into the Ingrain ledger and runs consolidation at session end through Hermes’s own model (`hermes -z`). Hermes default memory keeps working; Ingrain adds curated learned-experience cards alongside it.
148
+
149
+ Manual / one-shot workflow:
150
+
151
+ ```bash
152
+ ingrain ingest hermes
153
+ ingrain consolidate
154
+ ingrain hydrate --query "what should I know before continuing this project?"
155
+ ```
156
+
157
+ There is also a memory-provider mode:
158
+
159
+ ```bash
160
+ ingrain install hermes
161
+ ```
162
+
163
+ Provider mode swaps Ingrain into Hermes’s `memory.provider` slot. The sidecar plugin is safer for most users because default memory remains active.
164
+
165
+ ## How it works
166
+
167
+ ```mermaid
168
+ flowchart LR
169
+ A["Agent run<br/>Hermes, Codex, Claude Code"] --> B["Ledger events<br/>what happened"]
170
+ B --> C["Promotion / consolidation<br/>what matters"]
171
+ C --> D["Practice cards<br/>source-linked lessons"]
172
+ D --> E["PRACTICE.md<br/>human-readable learned experience"]
173
+ E --> F["Hydration<br/>brief, cards, evidence"]
174
+ F --> G["Next run<br/>behavior changes"]
175
+ E --> H["ingrain why<br/>audit trail"]
176
+ ```
177
+
178
+ Local project state:
179
+
180
+ ```text
181
+ .ingrain/
182
+ mind.db
183
+ practice/
184
+ cards/
185
+ compiled/
186
+ index.md
187
+ projects.md
188
+ decisions.md
189
+ corrections.md
190
+ lessons.md
191
+ track-record.md
192
+ evals/
193
+ ./PRACTICE.md
194
+ ```
195
+
196
+ Hydration levels:
197
+
198
+ ```bash
199
+ ingrain hydrate --level brief --query "small context"
200
+ ingrain hydrate --level cards --query "normal agent context"
201
+ ingrain hydrate --level evidence --query "audit source-linked context"
202
+ ```
203
+
204
+ The hydration output is fenced as background learned experience, not a new user command.
205
+
206
+ ## Early evidence
207
+
208
+ Ingrain is an applied agent-systems artifact with early benchmark evidence against Hermes default memory. The main question is narrow:
209
+
210
+ > Can an autonomous coding agent carry forward the right learned experience without reviving stale plans, leaking invalid claims, or confusing old work with current intent?
211
+
212
+ Current v0.2 results, using the same downstream answerer (Claude Code Sonnet via `claude --print`):
213
+
214
+ | Benchmark | n | hermes-default | ingrain-llm-sidecar | Δ |
215
+ |---|---:|---:|---:|---:|
216
+ | LongMemEval Oracle (external, Wu et al. 2024) | **50** | 0.434 | **0.588** | **+0.154 / +35.6% relative** |
217
+ | CarryForward v0.1 (custom carry-forward test) | 20 | 0.882 | **0.924** | +0.042 |
218
+ | Sandbox Universe v0 (custom hard trace eval) | 10 | 0.623 | **0.673** | +0.050 |
219
+
220
+ On the LongMemEval Oracle n=50 run: **12 per-question wins, 0 per-question losses, 38 ties**.
221
+
222
+ The sidecar design preserves default memory and adds Ingrain’s learned-experience cards in the same prompt. In these runs, that improved carry-forward behavior over Hermes default memory.
223
+
224
+ Raw evidence lives in [`benlloydg/sandbox-universe`](https://github.com/benlloydg/sandbox-universe): per-question outputs, generated answers, summary JSON, and reproducibility notes. For the full story, see [docs/research-arc.md](docs/research-arc.md).
225
+
226
+ ## What this claims
227
+
228
+ - Ingrain can turn corrections, source-of-truth docs, decisions, stale-plan warnings, completed outcomes, and durable user/project facts into compact context for future agent runs.
229
+ - The LLM consolidator runs through Hermes (`hermes -z`), so it uses whatever model the user has Hermes configured against. No separate SDK key is required.
230
+ - `ingrain why <query>` makes learned experience auditable by showing source-linked cards and events.
231
+ - CLI + skill + Hermes plugin make the system usable as a set-and-forget sidecar for agent sessions.
232
+
233
+ ## What this does not claim
234
+
235
+ - Not a replacement for your agent’s planner, active goals, missions, Kanban, or scheduler.
236
+ - Not a resource-retrieval / vector-database substitute. Tools like OpenViking solve a different problem: external knowledge and document retrieval.
237
+ - Not a SOTA claim against MemGPT, Letta, Mem0, or Zep. Those head-to-head runs have not been completed.
238
+ - Not proof that every added context card is always helpful. Ingrain’s job is to make behavior-changing lessons compact, current, and auditable; users should still treat learned context as background signal.
239
+
240
+ ## Ingrain vs. OpenViking
241
+
242
+ OpenViking and Ingrain solve different problems.
243
+
244
+ | Need | Suggested tool |
245
+ |---|---|
246
+ | Search docs/resources | OpenViking |
247
+ | Browse external knowledge | OpenViking |
248
+ | Large semantic knowledge base | OpenViking |
249
+ | Remember user corrections | Ingrain |
250
+ | Avoid stale plans | Ingrain |
251
+ | Carry project decisions forward | Ingrain |
252
+ | Track completed outcomes | Ingrain |
253
+
254
+ Use OpenViking when your bottleneck is knowledge retrieval. Use Ingrain when your bottleneck is behavioral carry-forward.
255
+
256
+ Provider chaining is on the roadmap so Ingrain can handle learned experience while OpenViking handles resource retrieval.
257
+
258
+ ## Evals
259
+
260
+ `ingrain eval` runs **LES-Core**, a deterministic local smoke eval. It checks whether Ingrain can:
261
+
262
+ - recover project facts after a cold start
263
+ - carry corrections forward
264
+ - avoid stale plans
265
+ - report completed outcomes
266
+ - keep hydration compact and relevant
267
+
268
+ The default `100/100` is a local regression gate for committed launch scenarios, not an external benchmark, provider leaderboard, or claim that Ingrain has solved agent memory.
269
+
270
+ For a harder local self-eval:
271
+
272
+ ```bash
273
+ ingrain les-hard
274
+ ```
275
+
276
+ Current LES-Hard v0 result is committed under [`docs/evidence/les-hard-v0/`](docs/evidence/les-hard-v0/): `542/560` across 28 preregistered scenarios. This is an Ingrain self-eval, not a provider comparison.
277
+
278
+ For external/custom benchmark posture, see [docs/eval-standards.md](docs/eval-standards.md).
279
+
280
+ ## Safety and privacy
281
+
282
+ Ingrain is local-first.
283
+
284
+ - no hosted service required
285
+ - local SQLite storage by default
286
+ - no network calls by default
287
+ - deterministic commands make no LLM calls
288
+ - LLM consolidation uses your existing Hermes model when explicitly run or when the Hermes plugin is installed
289
+ - redacts common secrets before storage
290
+ - does not store chain-of-thought
291
+ - does not mutate Hermes goals, missions, Kanban, scheduling, or task lifecycle
292
+ - includes source event IDs in compiled pages and practice cards
293
+
294
+ ## Commands
295
+
296
+ ```bash
297
+ ingrain init
298
+ ingrain remember --type correction "Never use yellow CTAs in enterprise demos."
299
+ ingrain ingest hermes
300
+ ingrain consolidate
301
+ ingrain hydrate --query "review this launch copy"
302
+ ingrain hydrate --level evidence --query "review this launch copy"
303
+ ingrain why "yellow CTAs"
304
+ ingrain practice
305
+ ingrain skill install codex
306
+ ingrain attach --agent codex
307
+ ingrain eval
308
+ ingrain les-hard
309
+ ingrain report
310
+ ingrain doctor
311
+ ingrain install hermes-plugin
312
+ ```
313
+
314
+ ## Behavioral carry-forward test
315
+
316
+ The simplest way to test Ingrain is to correct the agent once, start a fresh session, and ask for related work.
317
+
318
+ If the correction changes behavior without replaying the transcript, learned experience is working.
319
+
320
+ We sometimes call the silly version the “banana test”: give the agent a deliberately memorable correction, then verify that it carries forward and remains auditable with `ingrain why`.
321
+
322
+ See [examples/banana-test.md](examples/banana-test.md).
323
+
324
+ ## More reading
325
+
326
+ - [docs/research-arc.md](docs/research-arc.md) — engineering arc and benchmark narrative.
327
+ - [docs/cli-skill.md](docs/cli-skill.md) — CLI + agent-skill setup detail.
328
+ - [docs/eval-standards.md](docs/eval-standards.md) — what Ingrain claims and what it does not.
329
+ - [docs/learned-experience-model.md](docs/learned-experience-model.md) — card taxonomy.
330
+ - [docs/hermes.md](docs/hermes.md) — Hermes integration notes.
331
+ - [docs/compiler-rules-explained.md](docs/compiler-rules-explained.md) — legacy deterministic compiler, kept as a no-LLM fallback.
332
+ - [docs/philosophy.md](docs/philosophy.md), [docs/visual-demo.md](docs/visual-demo.md) — short framing notes.
333
+ - [AUDIT.md](AUDIT.md) — public-readiness checklist.
334
+
335
+ ## Roadmap
336
+
337
+ - provider chaining with OpenViking retrieval providers
338
+ - Claude Code and Codex transcript adapters
339
+ - optional external memory-system lanes for comparison
340
+ - hosted Aeonik MIND backend
341
+ - team/project shared learned experience
342
+ - richer LES behavioral evals
343
+
344
+ ## Status
345
+
346
+ Experimental alpha. Useful enough to test the idea, small enough to audit, but not yet a production memory layer. Expect rough edges, narrow benchmark coverage, and fast iteration.
347
+
348
+ ---
349
+
350
+ Built by [Aeonik AI](https://github.com/aeonik-ai). Ingrain is the learned-experience infrastructure behind **Beings** — Aeonik’s digital-being product. The accompanying benchmark suite ([`benlloydg/sandbox-universe`](https://github.com/benlloydg/sandbox-universe)) is maintained independently so other memory systems can be scored on the same protocol.