agent-knowledge-cli 0.1.2__tar.gz → 0.2.2__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.
- agent_knowledge_cli-0.2.2/PKG-INFO +397 -0
- agent_knowledge_cli-0.2.2/README.md +373 -0
- agent_knowledge_cli-0.2.2/assets/commands/system-update.md +70 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/bootstrap-memory-tree.sh +4 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/compact-memory.sh +26 -0
- agent_knowledge_cli-0.2.2/assets/skills/SKILLS.md +118 -0
- agent_knowledge_cli-0.2.2/assets/skills/branch-note-convention/SKILL.md +158 -0
- agent_knowledge_cli-0.2.2/assets/skills/clean-web-import/SKILL.md +143 -0
- agent_knowledge_cli-0.2.2/assets/skills/evidence-handling/SKILL.md +174 -0
- agent_knowledge_cli-0.2.2/assets/skills/obsidian-compatible-writing/SKILL.md +160 -0
- agent_knowledge_cli-0.2.2/assets/skills/ontology-inference/SKILL.md +177 -0
- agent_knowledge_cli-0.2.2/assets/skills/project-memory-writing/SKILL.md +174 -0
- agent_knowledge_cli-0.2.2/assets/templates/hooks/hooks.json.template +26 -0
- agent_knowledge_cli-0.2.2/assets/templates/integrations/claude/CLAUDE.md +47 -0
- agent_knowledge_cli-0.2.2/assets/templates/integrations/codex/AGENTS.md +47 -0
- agent_knowledge_cli-0.2.2/assets/templates/integrations/cursor/commands/memory-update.md +13 -0
- agent_knowledge_cli-0.2.2/assets/templates/integrations/cursor/commands/system-update.md +10 -0
- agent_knowledge_cli-0.2.2/assets/templates/integrations/cursor/hooks.json +26 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/AGENTS.md +28 -4
- agent_knowledge_cli-0.2.2/assets/templates/project/agent-knowledge/Evidence/captures/README.md +31 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/src/agent_knowledge/__init__.py +1 -1
- agent_knowledge_cli-0.2.2/src/agent_knowledge/cli.py +964 -0
- agent_knowledge_cli-0.2.2/src/agent_knowledge/runtime/canvas.py +201 -0
- agent_knowledge_cli-0.2.2/src/agent_knowledge/runtime/capture.py +127 -0
- agent_knowledge_cli-0.2.2/src/agent_knowledge/runtime/history.py +643 -0
- agent_knowledge_cli-0.2.2/src/agent_knowledge/runtime/importer.py +308 -0
- agent_knowledge_cli-0.2.2/src/agent_knowledge/runtime/index.py +232 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/src/agent_knowledge/runtime/integrations.py +48 -5
- agent_knowledge_cli-0.2.2/src/agent_knowledge/runtime/refresh.py +502 -0
- agent_knowledge_cli-0.2.2/src/agent_knowledge/runtime/site.py +1759 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/src/agent_knowledge/runtime/sync.py +96 -4
- agent_knowledge_cli-0.2.2/src/agent_knowledge/runtime/viewer.py +372 -0
- agent_knowledge_cli-0.2.2/tests/test_cli.py +1695 -0
- agent_knowledge_cli-0.2.2/tests/test_packaging.py +219 -0
- agent_knowledge_cli-0.1.2/PKG-INFO +0 -155
- agent_knowledge_cli-0.1.2/README.md +0 -131
- agent_knowledge_cli-0.1.2/assets/templates/hooks/hooks.json.template +0 -11
- agent_knowledge_cli-0.1.2/assets/templates/integrations/claude/CLAUDE.md +0 -7
- agent_knowledge_cli-0.1.2/assets/templates/integrations/codex/AGENTS.md +0 -7
- agent_knowledge_cli-0.1.2/assets/templates/integrations/cursor/hooks.json +0 -11
- agent_knowledge_cli-0.1.2/src/agent_knowledge/cli.py +0 -457
- agent_knowledge_cli-0.1.2/tests/test_cli.py +0 -317
- agent_knowledge_cli-0.1.2/tests/test_packaging.py +0 -87
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/.gitignore +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/LICENSE +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/claude/global.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/claude/project-template.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/claude/scripts/install.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/commands/doctor.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/commands/global-knowledge-sync.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/commands/graphify-sync.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/commands/knowledge-sync.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/commands/ship.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules/generate-architecture-doc.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules/history-backfill.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules/memory-bootstrap.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules/memory-writeback.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules/shared-memory.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules/workflow-orchestration.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules-global/action-first.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules-global/no-icons-emojis.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/rules-global/no-unsolicited-docs.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/doctor.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/global-knowledge-sync.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/graphify-sync.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/import-agent-history.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/install-project-links.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/lib/knowledge-common.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/measure-token-savings.py +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/ship.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/update-knowledge.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/scripts/validate-knowledge.sh +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills/decision-recording/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills/history-backfill/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills/memory-compaction/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills/memory-management/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills/project-ontology-bootstrap/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills/session-management/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills-cursor/create-rule/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills-cursor/create-skill/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills-cursor/create-subagent/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills-cursor/migrate-to-skills/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills-cursor/shell/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/skills-cursor/update-cursor-settings/SKILL.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/dashboards/project-overview.template.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/dashboards/session-rollup.template.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/integrations/cursor/agent-knowledge.mdc +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/memory/MEMORY.root.template.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/memory/branch.template.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/memory/decision.template.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/memory/profile.hybrid.yaml +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/memory/profile.ml-platform.yaml +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/memory/profile.robotics.yaml +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/memory/profile.web-app.yaml +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/portfolio/.obsidian/README.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/portfolio/.obsidian/app.json +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/portfolio/.obsidian/core-plugins.json +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/.agent-project.yaml +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/.agentknowledgeignore +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/.obsidian/README.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/.obsidian/app.json +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/.obsidian/core-plugins.json +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/Evidence/README.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/Evidence/imports/README.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/Evidence/raw/README.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/Memory/MEMORY.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/Memory/decisions/decisions.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/Outputs/README.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/STATUS.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/Sessions/README.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/agent-knowledge/Templates/README.md +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/assets/templates/project/gitignore.agent-knowledge +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/pyproject.toml +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/src/agent_knowledge/__main__.py +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/src/agent_knowledge/assets/__init__.py +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/src/agent_knowledge/runtime/__init__.py +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/src/agent_knowledge/runtime/paths.py +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/src/agent_knowledge/runtime/shell.py +0 -0
- {agent_knowledge_cli-0.1.2 → agent_knowledge_cli-0.2.2}/tests/__init__.py +0 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agent-knowledge-cli
|
|
3
|
+
Version: 0.2.2
|
|
4
|
+
Summary: Adaptive, file-based project knowledge for AI coding agents
|
|
5
|
+
Author: agent-knowledge contributors
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Classifier: Development Status :: 3 - Alpha
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: MacOS
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Topic :: Software Development :: Documentation
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Requires-Dist: click>=8.0
|
|
18
|
+
Provides-Extra: dev
|
|
19
|
+
Requires-Dist: build; extra == 'dev'
|
|
20
|
+
Requires-Dist: pytest>=7.0; extra == 'dev'
|
|
21
|
+
Provides-Extra: tokens
|
|
22
|
+
Requires-Dist: tiktoken; extra == 'tokens'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# agent-knowledge
|
|
26
|
+
|
|
27
|
+
Persistent, file-based project memory for AI coding agents.
|
|
28
|
+
|
|
29
|
+
One command gives any project a knowledge vault that agents read on startup,
|
|
30
|
+
maintain during work, and carry across sessions -- no database, no server,
|
|
31
|
+
just markdown files and a CLI.
|
|
32
|
+
|
|
33
|
+
## Install
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
pip install agent-knowledge-cli
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This installs the `agent-knowledge` command. PyPI package name is `agent-knowledge-cli`;
|
|
40
|
+
the CLI command and all documentation refer to it as `agent-knowledge`.
|
|
41
|
+
|
|
42
|
+
## Quick Start
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
pip install agent-knowledge-cli
|
|
46
|
+
cd your-project
|
|
47
|
+
agent-knowledge init
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Open Cursor in the repo — the agent picks up from there automatically.
|
|
51
|
+
|
|
52
|
+
`init` installs everything needed in the project:
|
|
53
|
+
- infers the project slug from the directory name
|
|
54
|
+
- creates an external knowledge vault at `~/agent-os/projects/<slug>/`
|
|
55
|
+
- symlinks `./agent-knowledge` into the repo as the local handle
|
|
56
|
+
- installs `.cursor/rules/agent-knowledge.mdc` — always-on memory contract
|
|
57
|
+
- installs `.cursor/hooks.json` — session lifecycle (start, stop, compaction)
|
|
58
|
+
- installs `.cursor/commands/memory-update.md` and `system-update.md` — slash commands
|
|
59
|
+
- detects Claude and Codex and installs their bridge files if present
|
|
60
|
+
- bootstraps the memory tree and marks onboarding as `pending`
|
|
61
|
+
- backfills lightweight history from git (if existing repo)
|
|
62
|
+
|
|
63
|
+
## How It Works
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
your-project/
|
|
67
|
+
.agent-project.yaml # project config
|
|
68
|
+
AGENTS.md # instructions agents read on startup
|
|
69
|
+
agent-knowledge/ # symlink -> ~/agent-os/projects/<slug>/
|
|
70
|
+
STATUS.md # onboarding state + sync timestamps
|
|
71
|
+
Memory/ # curated, durable knowledge (source of truth)
|
|
72
|
+
MEMORY.md
|
|
73
|
+
stack.md
|
|
74
|
+
decisions/
|
|
75
|
+
decisions.md
|
|
76
|
+
Evidence/ # imported or extracted material (not canonical)
|
|
77
|
+
raw/
|
|
78
|
+
imports/
|
|
79
|
+
captures/ # automatic event stream
|
|
80
|
+
Outputs/ # generated views (never canonical)
|
|
81
|
+
knowledge-index.json
|
|
82
|
+
knowledge-index.md
|
|
83
|
+
knowledge-export.html
|
|
84
|
+
Sessions/ # ephemeral session state
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Knowledge lives **outside** the repo so it persists across branches, tools,
|
|
88
|
+
and clones. The symlink gives every tool a stable `./agent-knowledge` path.
|
|
89
|
+
|
|
90
|
+
### Architecture boundaries
|
|
91
|
+
|
|
92
|
+
| Folder | Role | Canonical? |
|
|
93
|
+
|--------|------|-----------|
|
|
94
|
+
| `Memory/` | Curated, durable facts -- source of truth | Yes |
|
|
95
|
+
| `Evidence/` | Imported/extracted material, event stream | No |
|
|
96
|
+
| `Outputs/` | Generated views, indexes, HTML export | No |
|
|
97
|
+
| `Sessions/` | Ephemeral session state, prune aggressively | No |
|
|
98
|
+
|
|
99
|
+
Evidence is never auto-promoted into Memory. Outputs are never treated as truth.
|
|
100
|
+
Only agents and humans deliberately write to Memory.
|
|
101
|
+
|
|
102
|
+
### Automatic capture
|
|
103
|
+
|
|
104
|
+
Every sync and update event is automatically recorded in `Evidence/captures/`
|
|
105
|
+
as a small structured YAML file. This gives a lightweight history of what
|
|
106
|
+
changed and when -- without a database or background service.
|
|
107
|
+
|
|
108
|
+
Captures are evidence, not memory. They accumulate quietly and can be pruned
|
|
109
|
+
with `agent-knowledge compact`.
|
|
110
|
+
|
|
111
|
+
### Progressive retrieval
|
|
112
|
+
|
|
113
|
+
The knowledge index (`Outputs/knowledge-index.json` and `.md`) is regenerated
|
|
114
|
+
on every sync. It provides a compact catalog of all notes so agents can:
|
|
115
|
+
|
|
116
|
+
1. Load the index first (cheap, a few KB)
|
|
117
|
+
2. Identify relevant branches from the shortlist
|
|
118
|
+
3. Load only the full note content they actually need
|
|
119
|
+
|
|
120
|
+
Use `agent-knowledge search <query>` to run a quick Layer 2 shortlist query
|
|
121
|
+
from the command line or a hook.
|
|
122
|
+
|
|
123
|
+
#
|
|
124
|
+
## Commands
|
|
125
|
+
|
|
126
|
+
| Command | What it does |
|
|
127
|
+
|---------|-------------|
|
|
128
|
+
| `init` | Set up a project (zero-arg, auto-detects everything) |
|
|
129
|
+
| `sync` | Memory sync + session rollup + git evidence + capture + index |
|
|
130
|
+
| `doctor` | Validate setup and report health |
|
|
131
|
+
| `update` | Sync project changes into the knowledge tree |
|
|
132
|
+
| `import` | Import repo history into Evidence/ |
|
|
133
|
+
| `ship` | Validate, sync, commit, push |
|
|
134
|
+
| `bootstrap` | Create or repair the memory tree |
|
|
135
|
+
| `setup` | Install global Cursor rules and skills |
|
|
136
|
+
| `global-sync` | Import safe local tooling config |
|
|
137
|
+
| `graphify-sync` | Import graph/discovery artifacts |
|
|
138
|
+
| `compact` | Prune stale memory and old captures |
|
|
139
|
+
| `index` | Regenerate the knowledge index in Outputs/ |
|
|
140
|
+
| `search <query>` | Search the knowledge index (Memory-first) |
|
|
141
|
+
| `export-html` | Build polished static site in Outputs/site/ |
|
|
142
|
+
| `view` | Build site and open it in the browser |
|
|
143
|
+
| `clean-import <url>` | Import a URL or HTML file as cleaned evidence |
|
|
144
|
+
| `refresh-system` | Refresh integration files to the current framework version |
|
|
145
|
+
| `export-canvas` | Export vault as an Obsidian Canvas file (optional) |
|
|
146
|
+
| `backfill-history` | Backfill lightweight project history from git |
|
|
147
|
+
| `measure-tokens` | Estimate context token savings |
|
|
148
|
+
|
|
149
|
+
All write commands support `--dry-run`. Use `--json` for machine-readable output.
|
|
150
|
+
|
|
151
|
+
## Static site export with graph
|
|
152
|
+
|
|
153
|
+
Build a polished standalone site from your knowledge vault — no Obsidian required:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
agent-knowledge export-html
|
|
157
|
+
# produces: agent-knowledge/Outputs/site/index.html
|
|
158
|
+
# agent-knowledge/Outputs/site/data/knowledge.json
|
|
159
|
+
# agent-knowledge/Outputs/site/data/graph.json
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
Or generate and open immediately:
|
|
163
|
+
|
|
164
|
+
```
|
|
165
|
+
agent-knowledge view
|
|
166
|
+
# or
|
|
167
|
+
agent-knowledge export-html --open
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
The generated site includes:
|
|
171
|
+
- **Overview page** — project summary, branch cards, recent changes, key decisions, open questions
|
|
172
|
+
- **Branch tree** — sidebar navigation across all Memory/ branches with leaf drill-down
|
|
173
|
+
- **Note detail view** — rendered markdown with metadata panel and related notes
|
|
174
|
+
- **Evidence view** — all imported material, clearly marked non-canonical
|
|
175
|
+
- **Graph view** — interactive force-directed graph of all knowledge nodes and relationships
|
|
176
|
+
- **Structured data** — `knowledge.json` and `graph.json` machine-readable models of the vault
|
|
177
|
+
|
|
178
|
+
**Graph view** is a secondary exploration aid, not the primary navigation. The tree explorer and note detail view are the main interfaces. The graph shows:
|
|
179
|
+
- Branches, leaf notes, decisions, evidence, and outputs as distinct node types
|
|
180
|
+
- Structural edges (solid) and inferred relationships (dashed)
|
|
181
|
+
- Color-coded node types with visual distinction between canonical (Memory) and non-canonical (Evidence/Outputs) content
|
|
182
|
+
- Interactive zoom/pan, click-to-select with info panel, filter by node type and canonical status, and text search
|
|
183
|
+
|
|
184
|
+
The graph is built from `graph.json`, which is derived from `knowledge.json`. Neither file is canonical truth.
|
|
185
|
+
|
|
186
|
+
Memory/ notes are always primary. Evidence and Outputs items are clearly marked non-canonical. The site is a generated presentation layer — the vault remains the source of truth.
|
|
187
|
+
|
|
188
|
+
The site is a single `index.html` with all data embedded as JS variables, so it opens correctly via `file://` without any server.
|
|
189
|
+
|
|
190
|
+
## Skills
|
|
191
|
+
|
|
192
|
+
agent-knowledge ships a set of focused, composable agent skills. Install them globally:
|
|
193
|
+
|
|
194
|
+
```
|
|
195
|
+
agent-knowledge setup
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Skills installed to `~/.cursor/skills/`:
|
|
199
|
+
|
|
200
|
+
| Skill | Purpose |
|
|
201
|
+
|-------|---------|
|
|
202
|
+
| `memory-management` | Session-start: tree structure, reading, writeback |
|
|
203
|
+
| `project-memory-writing` | How to write high-quality memory notes |
|
|
204
|
+
| `branch-note-convention` | Naming and structure convention |
|
|
205
|
+
| `ontology-inference` | Infer project ontology from the repo |
|
|
206
|
+
| `decision-recording` | Record architectural decisions as ADRs |
|
|
207
|
+
| `evidence-handling` | Evidence rules and promotion process |
|
|
208
|
+
| `clean-web-import` | Import web content cleanly |
|
|
209
|
+
| `obsidian-compatible-writing` | Optional Obsidian-friendly authoring |
|
|
210
|
+
| `session-management` | Session tracking and handoffs |
|
|
211
|
+
| `memory-compaction` | Prune stale notes |
|
|
212
|
+
| `project-ontology-bootstrap` | Bootstrap a new memory tree |
|
|
213
|
+
|
|
214
|
+
Skills are plain markdown files and work with any skill-compatible agent
|
|
215
|
+
(Cursor, Claude Code, Codex). See `assets/skills/SKILLS.md` for details.
|
|
216
|
+
|
|
217
|
+
## Clean web import
|
|
218
|
+
|
|
219
|
+
Import a web page as cleaned, non-canonical evidence:
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
agent-knowledge clean-import https://docs.example.com/api-reference
|
|
223
|
+
# produces: agent-knowledge/Evidence/imports/2025-01-15-api-reference.md
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Strips navigation, ads, scripts, and boilerplate. Writes clean markdown with
|
|
227
|
+
YAML frontmatter marking it as non-canonical. Verify facts before promoting
|
|
228
|
+
any content to Memory/.
|
|
229
|
+
|
|
230
|
+
## Obsidian (optional)
|
|
231
|
+
|
|
232
|
+
Obsidian is an **optional** viewer/editor. agent-knowledge is not Obsidian-centric.
|
|
233
|
+
|
|
234
|
+
Open `~/agent-os/projects/<slug>/` as an Obsidian vault for backlinks and graph view.
|
|
235
|
+
|
|
236
|
+

|
|
237
|
+
|
|
238
|
+
For an optional spatial canvas of the knowledge graph:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
agent-knowledge export-canvas
|
|
242
|
+
# produces: agent-knowledge/Outputs/knowledge-export.canvas
|
|
243
|
+
# open in Obsidian with Core plugins > Canvas
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
All Obsidian-specific features are optional. The system works fully without Obsidian.
|
|
247
|
+
|
|
248
|
+
## Cursor-first runtime
|
|
249
|
+
|
|
250
|
+
Cursor is the primary supported runtime path. The project carries everything
|
|
251
|
+
it needs — opening the repo in Cursor is enough to get automatic behavior:
|
|
252
|
+
|
|
253
|
+
| What is installed | What it does |
|
|
254
|
+
|------------------|-------------|
|
|
255
|
+
| `.cursor/rules/agent-knowledge.mdc` | Always-on rule: loads memory context on every session |
|
|
256
|
+
| `.cursor/hooks.json` | Lifecycle hooks: sync on start, update on write, sync on stop and pre-compact |
|
|
257
|
+
| `.cursor/commands/memory-update.md` | `/memory-update` slash command |
|
|
258
|
+
| `.cursor/commands/system-update.md` | `/system-update` slash command |
|
|
259
|
+
|
|
260
|
+
### Session lifecycle
|
|
261
|
+
|
|
262
|
+
When you open the project in Cursor, the hooks fire automatically:
|
|
263
|
+
|
|
264
|
+
- **session-start** — runs `agent-knowledge sync` to load fresh vault state
|
|
265
|
+
- **post-write** — runs `agent-knowledge update` after each file save
|
|
266
|
+
- **stop** — runs `agent-knowledge sync` at end of each task
|
|
267
|
+
- **preCompact** — runs `agent-knowledge sync` before context compaction
|
|
268
|
+
|
|
269
|
+
The rule ensures the agent reads `STATUS.md` and `Memory/MEMORY.md` at the
|
|
270
|
+
start of every session, with no manual prompting required.
|
|
271
|
+
|
|
272
|
+
### Slash commands
|
|
273
|
+
|
|
274
|
+
Inside any Cursor session in this project:
|
|
275
|
+
|
|
276
|
+
- `/memory-update` — triggers a guided memory update flow: sync, review session work, write stable facts to `Memory/`, summarize
|
|
277
|
+
- `/system-update` — refreshes the project's integration files to the latest framework version
|
|
278
|
+
|
|
279
|
+
These are project-local commands. They work because `init` installed them in `.cursor/commands/`.
|
|
280
|
+
|
|
281
|
+
### Checking integration health
|
|
282
|
+
|
|
283
|
+
```bash
|
|
284
|
+
agent-knowledge doctor
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
Reports whether rules, hooks, and commands are all installed and current. If any
|
|
288
|
+
integration file is stale, `doctor` suggests `agent-knowledge refresh-system`.
|
|
289
|
+
|
|
290
|
+
## Multi-Tool Support
|
|
291
|
+
|
|
292
|
+
`init` always installs Cursor integration. Claude and Codex are installed when detected:
|
|
293
|
+
|
|
294
|
+
| Tool | Bridge files | When installed |
|
|
295
|
+
|------|-------------|---------------|
|
|
296
|
+
| Cursor | `.cursor/rules/` + `.cursor/hooks.json` + `.cursor/commands/` | Always |
|
|
297
|
+
| Claude | `CLAUDE.md` | When `.claude/` directory is detected |
|
|
298
|
+
| Codex | `.codex/AGENTS.md` | When `.codex/` directory is detected |
|
|
299
|
+
|
|
300
|
+
Multiple tools in the same repo work together.
|
|
301
|
+
|
|
302
|
+
## Custom Knowledge Home
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
export AGENT_KNOWLEDGE_HOME=~/my-knowledge
|
|
306
|
+
agent-knowledge init
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
## Project history
|
|
310
|
+
|
|
311
|
+
`init` automatically backfills a lightweight history layer when run on an existing repo.
|
|
312
|
+
You can also run it explicitly at any time:
|
|
313
|
+
|
|
314
|
+
```bash
|
|
315
|
+
agent-knowledge backfill-history
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
This creates `History/` inside the vault with:
|
|
319
|
+
|
|
320
|
+
- `events.ndjson` — compact append-only event log (one JSON object per line)
|
|
321
|
+
- `history.md` — human-readable entrypoint with recent milestones
|
|
322
|
+
- `timeline/` — sparse milestone notes for significant events (init, releases)
|
|
323
|
+
|
|
324
|
+
History records **what happened** over time — releases, detected integrations, sync
|
|
325
|
+
events. It is not a git replacement and not a second source of truth. Current truth
|
|
326
|
+
lives in `Memory/`.
|
|
327
|
+
|
|
328
|
+
| Layer | Role |
|
|
329
|
+
|-------|------|
|
|
330
|
+
| `Memory/` | What is true now (curated, authoritative) |
|
|
331
|
+
| `History/` | What happened over time (lightweight diary) |
|
|
332
|
+
| `Evidence/` | Imported/extracted material (non-canonical) |
|
|
333
|
+
| `Outputs/` | Generated helper artifacts |
|
|
334
|
+
| `Sessions/` | Temporary working state |
|
|
335
|
+
|
|
336
|
+
History is idempotent. Run `backfill-history --dry-run` to preview without writing.
|
|
337
|
+
`doctor` warns when `History/` is missing.
|
|
338
|
+
|
|
339
|
+
## Keeping up to date
|
|
340
|
+
|
|
341
|
+
When a new version of agent-knowledge is installed, refresh the project integration:
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
pip install -U agent-knowledge-cli
|
|
345
|
+
agent-knowledge refresh-system
|
|
346
|
+
```
|
|
347
|
+
|
|
348
|
+
`refresh-system` updates all integration bridge files — Cursor hooks, rules, commands, `AGENTS.md` header, `CLAUDE.md`, Codex config — and version markers in `STATUS.md` and `.agent-project.yaml`. It never touches `Memory/`, `Evidence/`, `Sessions/`, or any curated project knowledge.
|
|
349
|
+
|
|
350
|
+
Run `--dry-run` to preview changes without writing:
|
|
351
|
+
|
|
352
|
+
```bash
|
|
353
|
+
agent-knowledge refresh-system --dry-run
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
`doctor` also warns when the project integration is behind the installed version.
|
|
357
|
+
|
|
358
|
+
## Troubleshooting
|
|
359
|
+
|
|
360
|
+
```bash
|
|
361
|
+
agent-knowledge doctor # validate setup and report health
|
|
362
|
+
agent-knowledge doctor --json # machine-readable health check
|
|
363
|
+
agent-knowledge validate # check knowledge layout and links
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
Common issues:
|
|
367
|
+
- `./agent-knowledge` missing: run `agent-knowledge init`
|
|
368
|
+
- Onboarding still pending: paste the init prompt into your agent
|
|
369
|
+
- Stale index: run `agent-knowledge index` or `agent-knowledge sync`
|
|
370
|
+
- Large notes: run `agent-knowledge compact`
|
|
371
|
+
|
|
372
|
+
## Platform Support
|
|
373
|
+
|
|
374
|
+
- **macOS** and **Linux** are fully supported.
|
|
375
|
+
- **Windows** is not currently supported (relies on `bash` and POSIX shell scripts).
|
|
376
|
+
- Python 3.9+ is required.
|
|
377
|
+
|
|
378
|
+
## Package naming
|
|
379
|
+
|
|
380
|
+
| What | Value |
|
|
381
|
+
|------|-------|
|
|
382
|
+
| PyPI package | `agent-knowledge-cli` |
|
|
383
|
+
| CLI command | `agent-knowledge` |
|
|
384
|
+
| Python import | `agent_knowledge` |
|
|
385
|
+
|
|
386
|
+
Install: `pip install agent-knowledge-cli`
|
|
387
|
+
Command: `agent-knowledge --help`
|
|
388
|
+
|
|
389
|
+
## Development
|
|
390
|
+
|
|
391
|
+
```bash
|
|
392
|
+
git clone <repo-url>
|
|
393
|
+
cd agent-knowledge
|
|
394
|
+
python3 -m venv .venv && source .venv/bin/activate
|
|
395
|
+
pip install -e ".[dev]"
|
|
396
|
+
python -m pytest tests/ -q
|
|
397
|
+
```
|