llm-wiki-kit 0.3.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.
- llm_wiki_kit-0.3.0/LICENSE +21 -0
- llm_wiki_kit-0.3.0/PKG-INFO +294 -0
- llm_wiki_kit-0.3.0/README.md +257 -0
- llm_wiki_kit-0.3.0/pyproject.toml +62 -0
- llm_wiki_kit-0.3.0/setup.cfg +4 -0
- llm_wiki_kit-0.3.0/src/llm_wiki_kit.egg-info/PKG-INFO +294 -0
- llm_wiki_kit-0.3.0/src/llm_wiki_kit.egg-info/SOURCES.txt +155 -0
- llm_wiki_kit-0.3.0/src/llm_wiki_kit.egg-info/dependency_links.txt +1 -0
- llm_wiki_kit-0.3.0/src/llm_wiki_kit.egg-info/entry_points.txt +2 -0
- llm_wiki_kit-0.3.0/src/llm_wiki_kit.egg-info/requires.txt +11 -0
- llm_wiki_kit-0.3.0/src/llm_wiki_kit.egg-info/top_level.txt +1 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/__init__.py +4 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/__main__.py +5 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/agents.py +233 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/audit.py +106 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/cache.py +694 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/chunking.py +166 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/cli.py +1734 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/clusters.py +376 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/codebase.py +259 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/commit.py +77 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/config.py +530 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/connect.py +197 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/covering.py +189 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/edges.py +215 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/evaluate.py +167 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/frontmatter.py +62 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/groups.py +104 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guide.py +181 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/code/lint.md +65 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/code/query.md +70 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/code/sync.md +52 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/code/work.md +53 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/ingest.md +318 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/lint.md +83 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/parts/fetch-pr.md +4 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/parts/fetch-record.md +5 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/parts/fetch-source.md +3 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/parts/pr-tickets.md +2 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/query.md +70 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/writing/ingest.md +137 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/writing/lint.md +64 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/guides/writing/query.md +59 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/hook.py +232 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/hooks/pre-commit +27 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/init.py +307 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/links.py +200 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/map/3d-force-graph.LICENSE +21 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/map/3d-force-graph.min.js +5 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/map/template.html +359 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/model.py +21 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/models.py +335 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/nav.py +490 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/originals.py +97 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/output.py +141 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/pages.py +353 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/precommit.py +76 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/agents-section.md +11 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/code-repo-section.md +10 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/code-repo-wiki.md +23 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/AGENTS.md +67 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/dot-gitignore +1 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/dot-wiki-cli.toml +185 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/raw/dot-gitkeep +0 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/analysis.md +24 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/concept.md +16 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/decision.md +27 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/dependency.md +26 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/epic.md +23 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/file.md +24 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/gotcha.md +24 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/instruction.md +20 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/module.md +27 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/pr.md +28 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/ticket.md +26 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/templates/weekly.md +14 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/code/files/wiki/open-questions.md +13 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/agents-section.md +11 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/AGENTS.md +68 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/dot-gitignore +1 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/dot-wiki-cli.toml +110 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/raw/dot-gitkeep +0 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/templates/analysis.md +21 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/templates/concept.md +16 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/templates/event.md +22 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/templates/organization.md +21 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/templates/person.md +22 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/templates/place.md +16 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/templates/source.md +28 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/research/files/wiki/open-questions.md +13 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/agents-section.md +12 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/AGENTS.md +88 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/dot-gitignore +5 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/dot-wiki-cli.toml +291 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/originals/loose/dot-gitkeep +0 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/raw/dot-gitkeep +0 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/analysis.md +19 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/chapter.md +36 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/character.md +30 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/decision.md +23 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/event.md +23 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/idea.md +27 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/item.md +19 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/location.md +20 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/lore.md +21 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/organization.md +22 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/originals/chapter.md +6 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/originals/idea.md +6 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/originals/scene.md +6 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/plotline.md +22 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/scene.md +40 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/source.md +25 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/style.md +15 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/theme.md +15 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/templates/thread.md +23 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/presets/writing/files/wiki/open-questions.md +15 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/records.py +103 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/scaffold.py +547 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/search.py +173 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/sessions.py +52 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/sources.py +179 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/suggest.py +148 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/tasks.py +359 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/validation.py +191 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/vec.py +43 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/vecmap.py +471 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/vocabulary.py +147 -0
- llm_wiki_kit-0.3.0/src/wiki_cli/weekly.py +814 -0
- llm_wiki_kit-0.3.0/tests/test_agents.py +98 -0
- llm_wiki_kit-0.3.0/tests/test_audit.py +228 -0
- llm_wiki_kit-0.3.0/tests/test_cache.py +282 -0
- llm_wiki_kit-0.3.0/tests/test_chunking.py +74 -0
- llm_wiki_kit-0.3.0/tests/test_cli.py +157 -0
- llm_wiki_kit-0.3.0/tests/test_clusters.py +416 -0
- llm_wiki_kit-0.3.0/tests/test_code.py +541 -0
- llm_wiki_kit-0.3.0/tests/test_commit.py +82 -0
- llm_wiki_kit-0.3.0/tests/test_connect.py +97 -0
- llm_wiki_kit-0.3.0/tests/test_covering.py +108 -0
- llm_wiki_kit-0.3.0/tests/test_edges.py +158 -0
- llm_wiki_kit-0.3.0/tests/test_generic.py +276 -0
- llm_wiki_kit-0.3.0/tests/test_groups.py +141 -0
- llm_wiki_kit-0.3.0/tests/test_hook.py +218 -0
- llm_wiki_kit-0.3.0/tests/test_links.py +54 -0
- llm_wiki_kit-0.3.0/tests/test_map.py +242 -0
- llm_wiki_kit-0.3.0/tests/test_models.py +35 -0
- llm_wiki_kit-0.3.0/tests/test_nav.py +309 -0
- llm_wiki_kit-0.3.0/tests/test_originals.py +172 -0
- llm_wiki_kit-0.3.0/tests/test_output.py +54 -0
- llm_wiki_kit-0.3.0/tests/test_pages.py +147 -0
- llm_wiki_kit-0.3.0/tests/test_pending.py +130 -0
- llm_wiki_kit-0.3.0/tests/test_precommit.py +102 -0
- llm_wiki_kit-0.3.0/tests/test_records.py +150 -0
- llm_wiki_kit-0.3.0/tests/test_search.py +218 -0
- llm_wiki_kit-0.3.0/tests/test_starter.py +410 -0
- llm_wiki_kit-0.3.0/tests/test_tasks.py +138 -0
- llm_wiki_kit-0.3.0/tests/test_weekly.py +239 -0
- llm_wiki_kit-0.3.0/tests/test_writing.py +80 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Griffin Hackley
|
|
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,294 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: llm-wiki-kit
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Start and run an LLM-maintained wiki with any agent: presets, workflow guides, search, typed relations and guided navigation.
|
|
5
|
+
Author: Griffin Hackley
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/GriffinHackley/LLM-WIKI
|
|
8
|
+
Project-URL: Documentation, https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/getting-started.md
|
|
9
|
+
Project-URL: Issues, https://github.com/GriffinHackley/LLM-WIKI/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/GriffinHackley/LLM-WIKI/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: wiki,llm,agents,knowledge-base,obsidian,markdown,search,claude,codex
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Documentation
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Classifier: Topic :: Text Processing :: Markup :: Markdown
|
|
22
|
+
Requires-Python: >=3.13
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
License-File: src/wiki_cli/map/3d-force-graph.LICENSE
|
|
26
|
+
Requires-Dist: PyYAML>=6
|
|
27
|
+
Requires-Dist: sqlite-vec>=0.1.9
|
|
28
|
+
Requires-Dist: fastembed==0.8.1
|
|
29
|
+
Requires-Dist: onnxruntime>=1.20
|
|
30
|
+
Requires-Dist: tokenizers>=0.20
|
|
31
|
+
Requires-Dist: numpy>=2
|
|
32
|
+
Requires-Dist: networkx>=3.2
|
|
33
|
+
Requires-Dist: umap-learn>=0.5.7
|
|
34
|
+
Provides-Extra: test
|
|
35
|
+
Requires-Dist: pytest>=8; extra == "test"
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
|
|
38
|
+
# LLM wiki starter kit (`wiki`)
|
|
39
|
+
|
|
40
|
+
Start and run an **LLM-maintained wiki** (a folder of Markdown notes that an agent
|
|
41
|
+
keeps: an Obsidian vault, a research notebook, a wiki about a codebase) with any agent
|
|
42
|
+
that can run shell commands: Claude Code, Codex, Cursor, Copilot, OpenCode and others.
|
|
43
|
+
|
|
44
|
+
- **`wiki new`** sets up a wiki from a preset: folder layout, page templates, an
|
|
45
|
+
`AGENTS.md` telling the agent how to be the librarian, and a config whose relation
|
|
46
|
+
rules match the templates. Presets: `research` (sources in, pages out), `code` (a
|
|
47
|
+
wiki in its own repo describing a code repo) and `writing` (stories you write in
|
|
48
|
+
Obsidian, and a wiki of their characters, places and plotlines).
|
|
49
|
+
- **`wiki guide`** prints the workflow an agent follows (ingest a source, answer a
|
|
50
|
+
question, audit the wiki, sync after code changes), versioned with the command so the
|
|
51
|
+
steps never go stale.
|
|
52
|
+
- **Search and navigation** find the best starting page without reading an index, show
|
|
53
|
+
where each page leads through typed relations with reasons, and read only the sections
|
|
54
|
+
needed, within a page limit.
|
|
55
|
+
|
|
56
|
+
**New here? Start with [docs/getting-started.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/getting-started.md).**
|
|
57
|
+
[docs/workflows.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/workflows.md) covers the workflows and how to customise them,
|
|
58
|
+
[docs/presets.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/presets.md) the presets, [docs/config.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/config.md) every config
|
|
59
|
+
setting. [PLAN.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/PLAN.md) is the current plan,
|
|
60
|
+
[FUTURE_IDEAS.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/FUTURE_IDEAS.md) the deferred ideas.
|
|
61
|
+
|
|
62
|
+
The `wiki` command never edits pages: agents do. What it builds for search lives in a
|
|
63
|
+
disposable SQLite cache in `<root>/.cache/`.
|
|
64
|
+
|
|
65
|
+
## Install
|
|
66
|
+
|
|
67
|
+
Requires [uv](https://docs.astral.sh/uv/getting-started/installation/), which installs
|
|
68
|
+
Python 3.13 for the tool if needed.
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
uv tool install llm-wiki-kit # once per machine; the command is `wiki`
|
|
72
|
+
wiki models download # once: about 0.2 GB
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`uv tool upgrade llm-wiki-kit` updates it. The latest code, before a release:
|
|
76
|
+
`uv tool install git+https://github.com/GriffinHackley/LLM-WIKI`. For development, from a clone:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
uv tool install --editable . # 'wiki' follows the checkout
|
|
80
|
+
python -m venv .venv && .venv/Scripts/python -m pip install -e ".[test]"
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
An earlier install named `wiki-cli` also provides `wiki`: remove it first with
|
|
84
|
+
`uv tool uninstall wiki-cli`.
|
|
85
|
+
|
|
86
|
+
## Quick start
|
|
87
|
+
|
|
88
|
+
A new research wiki:
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
wiki new my-wiki --agent claude # optional slash commands (also copilot, opencode); AGENTS.md works for any agent
|
|
92
|
+
cd my-wiki
|
|
93
|
+
# put a source in raw/, then ask your agent: "ingest raw/<file>"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
A wiki about a codebase, in its own repo beside the code, or in a folder of the code's repo:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
wiki new my-app-wiki --preset code --code ../my-app
|
|
100
|
+
# or, from the code repo: wiki new docs/wiki --preset code --code .
|
|
101
|
+
# add the lines it prints to the code repo, then work from there as usual
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
A wiki for your writing: you write ideas, scenes and chapters in `originals/` in
|
|
105
|
+
Obsidian, the agent never touches them, and keeps a wiki of the stories:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
wiki new my-stories --preset writing --agent claude
|
|
109
|
+
# open it in Obsidian (Templater, Linter, Obsidian Git), write, then ask: "ingest the storm scene"
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
An existing folder of notes (an Obsidian vault, a `docs/` folder, a wiki an agent already
|
|
113
|
+
keeps):
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
cd my-notes
|
|
117
|
+
wiki new . --agent claude # drafts a .wiki-cli.toml from your pages, adds the agent files
|
|
118
|
+
wiki index refresh # index and embed (about 2 minutes per 500 pages on CPU)
|
|
119
|
+
wiki search "how do I configure the exporter?"
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Your pages stay as they are; [getting started](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/getting-started.md#6-add-to-an-existing-wiki)
|
|
123
|
+
covers reviewing the drafted config and adopting a preset's page types.
|
|
124
|
+
|
|
125
|
+
It also works with no configuration at all: every `*.md` file under the folder is a
|
|
126
|
+
page, `raw/**/*.txt` is searchable source text, and every link is a `links-to` relation
|
|
127
|
+
whose reason is the sentence around it.
|
|
128
|
+
|
|
129
|
+
## Configure: `.wiki-cli.toml`
|
|
130
|
+
|
|
131
|
+
Commands find the root by walking up to the nearest `.wiki-cli.toml`, else use the
|
|
132
|
+
enclosing git repository, else the current folder, and say which folder they chose when
|
|
133
|
+
no config did. They refuse to treat your home folder or a drive root as a wiki. `--root`
|
|
134
|
+
or `WIKI_ROOT` overrides all of this, and `WIKI_CONFIG` points at a different config
|
|
135
|
+
file. Every setting is optional; [docs/config.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/config.md) is the full reference,
|
|
136
|
+
with each key's type and default:
|
|
137
|
+
|
|
138
|
+
```toml
|
|
139
|
+
preset = "research" # the preset `wiki new` used; picks guide variants
|
|
140
|
+
pages = ["wiki/**/*.md"] # default ["**/*.md"]
|
|
141
|
+
exclude = ["wiki/index.md"] # default none
|
|
142
|
+
raw = ["raw/**/*.txt"] # default; searched only with --include-raw
|
|
143
|
+
embed_model = "BAAI/bge-small-en-v1.5" # default; $WIKI_EMBED_MODEL overrides
|
|
144
|
+
reranker = "jinaai/jina-reranker-v1-turbo-en" # default, or "none"; $WIKI_RERANKER overrides
|
|
145
|
+
|
|
146
|
+
[types.person] # page types: guides list them, `wiki check` flags others
|
|
147
|
+
description = "A person."
|
|
148
|
+
folder = "wiki/people" # pages here get this type when frontmatter has none
|
|
149
|
+
template = "templates/person.md"
|
|
150
|
+
sections = ["Summary"] # headings and frontmatter every page of the type has,
|
|
151
|
+
fields = ["title", "type", "sources", "last_updated"] # checked by `wiki check`
|
|
152
|
+
values = { role = ["author", "subject"] } # allowed values of a field
|
|
153
|
+
hub = false # true: pages gather around it (see `wiki clusters`)
|
|
154
|
+
record = false # true: each page describes a ticket or the like, kept by key, url, synced
|
|
155
|
+
|
|
156
|
+
[records] # record types: when `wiki stale` asks for a recheck
|
|
157
|
+
recheck_days = 30 # default
|
|
158
|
+
|
|
159
|
+
[summary] # where a page's summary comes from, in order
|
|
160
|
+
fields = ["summary", "description"] # frontmatter keys (default)
|
|
161
|
+
headings = ["Summary", "Overview"] # default ["Summary"]; else the first paragraph
|
|
162
|
+
|
|
163
|
+
[page_type]
|
|
164
|
+
field = "type" # frontmatter key holding the page type (default)
|
|
165
|
+
|
|
166
|
+
[check]
|
|
167
|
+
require_frontmatter = false # default
|
|
168
|
+
summary_types = ["person"] # page types that must have a summary ("*" = all)
|
|
169
|
+
|
|
170
|
+
[suggest]
|
|
171
|
+
named_types = ["person", "organization"] # pages `suggest` matches by name (default: all)
|
|
172
|
+
|
|
173
|
+
[search]
|
|
174
|
+
results = 3 # default; pages from search, nav start and nav search (1-20)
|
|
175
|
+
|
|
176
|
+
[pending]
|
|
177
|
+
ignore = ["raw/SOURCES.md"] # files in raw/ that are not sources (default none)
|
|
178
|
+
|
|
179
|
+
[weekly] # weekly notes (`wiki weekly`); off without this table
|
|
180
|
+
folder = "weekly" # default; never indexed
|
|
181
|
+
group_by = "module" # "where the work went" by module, or "type" (default)
|
|
182
|
+
|
|
183
|
+
[groups] # --group on clusters and map: pages naming a group, and their neighbours
|
|
184
|
+
fields = ["tags"] # default; the frontmatter fields that name a page's groups
|
|
185
|
+
|
|
186
|
+
[hooks] # the pre-commit hook's extra checks, run from the root
|
|
187
|
+
pre_commit = ["python tools/check.py", { run = "python tools/lint.py", files = ["drafts/*.md"] }]
|
|
188
|
+
|
|
189
|
+
[guides]
|
|
190
|
+
dir = "guides" # the wiki's own guides, overriding built-in ones by name
|
|
191
|
+
parts = "guides/parts" # default; <name>.md is the wiki's own text for a guide step
|
|
192
|
+
|
|
193
|
+
[code] # code wikis only
|
|
194
|
+
repo = "../my-app" # the code repo, relative to the wiki; $WIKI_CODE_REPO overrides
|
|
195
|
+
origin = "https://github.com/me/my-app.git" # catches a pointer to the wrong checkout
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
In a code repo, a `.wiki-cli.toml` holding only `wiki = "../my-app-wiki"` sends every
|
|
199
|
+
command run there to the wiki.
|
|
200
|
+
|
|
201
|
+
## Relations
|
|
202
|
+
|
|
203
|
+
Typed relations come from rules in the same file. A rule gives links under a heading,
|
|
204
|
+
or the values of a frontmatter field, a type and an inverse label:
|
|
205
|
+
|
|
206
|
+
```toml
|
|
207
|
+
[[relations]]
|
|
208
|
+
heading = "Entities mentioned" # or a list of headings
|
|
209
|
+
page_type = "source" # optional, or a list
|
|
210
|
+
type = "mentions"
|
|
211
|
+
inverse = "mentioned-in"
|
|
212
|
+
|
|
213
|
+
[[relations]]
|
|
214
|
+
field = "sources" # frontmatter field holding slugs or [[links]]
|
|
215
|
+
type = "draws-on"
|
|
216
|
+
inverse = "drawn-on-by"
|
|
217
|
+
reason = "Listed in sources." # optional; without it, the sentence citing the page
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
With that rule, this list item
|
|
221
|
+
|
|
222
|
+
```markdown
|
|
223
|
+
## Entities mentioned
|
|
224
|
+
- [[charles-babbage]] — Inventor who delayed the demonstration (p. 2)
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
becomes `mentions -> charles-babbage` with reason "Inventor who delayed the
|
|
228
|
+
demonstration (p. 2)". A link in parentheses under a typed heading, such as a citation
|
|
229
|
+
`([[report]], p. 2)`, is a plain link: it supports the line rather than being its subject. Without rules, links are
|
|
230
|
+
still relations (`links-to`), and frontmatter values written as `[[links]]` count as
|
|
231
|
+
links, as in Obsidian. Built in: `embeds` (a `![[page#^block]]` embed), `refers-to-code`
|
|
232
|
+
(a `[name](code:path)` link to a file in a code wiki's code repo) and `links-to`. When a
|
|
233
|
+
page reaches one target several ways, the most specific type wins: heading-rule types in
|
|
234
|
+
file order, then `embeds`, then field-only types, then `links-to`. `wiki vocab` lists
|
|
235
|
+
the types. Changing the rules re-derives relations on the next refresh without
|
|
236
|
+
re-embedding.
|
|
237
|
+
|
|
238
|
+
## Commands
|
|
239
|
+
|
|
240
|
+
| Command | Purpose |
|
|
241
|
+
|---|---|
|
|
242
|
+
| `wiki new [folder] [--preset research\|code\|writing\|<folder>] [--code <repo>] [--agent claude\|copilot\|opencode ...] [--git-hook]` | Create a wiki from a preset; in a folder that already has pages, adopt it (draft its config, add the agent files, leave the pages alone); never overwrites |
|
|
243
|
+
| `wiki guide [<name>] [--parts]` | Print a workflow's steps for an agent; without a name, list them; `--parts` lists the steps a wiki can fill with its own text (`guides/parts/`) |
|
|
244
|
+
| `wiki search "<question>" [--limit 3] [--include-raw] [--keyword-only]` | Best pages for a question: keyword + vector search, fused and reranked |
|
|
245
|
+
| `wiki nav start \| read \| candidates \| search \| end \| log` | Guided traversal sessions (see [docs/navigation.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/navigation.md)) |
|
|
246
|
+
| `wiki list [--type T]` | Every page with its type and summary |
|
|
247
|
+
| `wiki pending [--hash <original>]` | Sources in `raw/` no page links to yet, flagging copies of sources already ingested, and originals revised since they were ingested; `--hash` prints an original's hash for its page |
|
|
248
|
+
| `wiki neighbors <slug> [--incoming] [--outgoing] [--relation T] [--limit N]` | A page's typed relations with reasons, no page bodies |
|
|
249
|
+
| `wiki suggest <slug>` | Pages a page names but does not link, shares linked pages with, or resembles |
|
|
250
|
+
| `wiki unwritten [--limit N]` | Link targets with no page, most-linked first |
|
|
251
|
+
| `wiki orphans` | Pages nothing relates to |
|
|
252
|
+
| `wiki clusters [--all] [--min-size 4] [--resolution 1.0] [--group G]` | Groups of pages that link each other densely (Louvain communities) with no hub page most of them link to, and no split of them into parts that each have one: leads for pages worth writing. Wikis of 30 pages or more. `--group`: only one group's pages ([groups]); `--ungrouped`: the pages in no group |
|
|
253
|
+
| `wiki map [--query "<question>"] [--nav <session>\|last\|all] [--chunks] [--group G] [--method auto\|umap\|pca] [--color-by type\|cluster\|age\|visits] [--open]` | A 3D map of the pages' embeddings as one HTML page in `.cache/` (works offline): points coloured by type, link cluster or age, relations as lines; a question placed among the pages with lines to its search results; nav sessions drawn as paths to step through. UMAP by default; if UMAP cannot be used it says so and uses PCA. `--group`: only one group's pages, laid out on their own |
|
|
254
|
+
| `wiki stale` | Pages whose covered code changed since they were verified, and record pages (tickets) due for a recheck |
|
|
255
|
+
| `wiki covering <path>` | A code file's notes: the pages covering it, most specific first, and the gotchas and decisions affecting them (`--session` shows each file once per agent session) |
|
|
256
|
+
| `wiki connect <code-repo> --agent <name>` | Set up a code repo for the work loop: write the wiki's files there (pointer, `WIKI.md`, skills, hook files) and print the lines to add by hand; `--check` reports what is missing |
|
|
257
|
+
| `wiki task start\|takeover\|cancel\|status` | The one open task on the code, held by one agent session: the agent hooks refuse edits to the code and the wiki outside it |
|
|
258
|
+
| `wiki commit "<message>"` | Commit the wiki's changes, everything but the originals folder, waiting while another git process (Obsidian Git) holds the index |
|
|
259
|
+
| `wiki finish -m <message>` | End the open task: commit the files it edited in the code repo, set `verified:` on the pages it checked, and commit the wiki |
|
|
260
|
+
| `wiki weekly [--week 2026-W40 \| current]` | With `[weekly]`: a note per finished week of work (pages added and changed, where the work went, sources, open questions, health, code) and a timeline, from git; `current` shows this week so far |
|
|
261
|
+
| `wiki precommit` | What the pre-commit hook checks: sources in `raw/` unchanged, last week's note, no `wiki check --all` errors, the wiki's `[hooks] pre_commit` commands |
|
|
262
|
+
| `wiki check <slug> \| --all [--verify-cache] [--strict] [--no-warnings] [--summary-ok]` | Frontmatter, summaries, types and their required sections and fields, uncited sources, ambiguous and unwritten links, stale summaries, code links, hub pages that several separate clusters gather around, file pages filed under a broader module than the one covering them |
|
|
263
|
+
| `wiki check <source-slug> --ingested` | Whether an ingest is complete: original linked, discussed pages named and citing it, all clean and committed |
|
|
264
|
+
| `wiki index refresh \| rebuild [--no-embed] \| status` | Manage the cache and embeddings |
|
|
265
|
+
| `wiki init [--write] [--preset <name>]` | Survey an existing folder and draft a `.wiki-cli.toml` (never overwrites); `--preset` adds the preset's page types, relation rules and weekly notes, or prints just those for a wiki that has a config |
|
|
266
|
+
| `wiki models list \| download` | Supported models; `download` is the only command that downloads |
|
|
267
|
+
| `wiki eval sample \| run` | Search-quality evaluation (see [docs/evaluation.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/evaluation.md)) |
|
|
268
|
+
| `wiki vocab` | Relation types, their inverses, and where each comes from |
|
|
269
|
+
|
|
270
|
+
All commands accept `--format json` (compact, deterministic); commands on a wiki accept
|
|
271
|
+
`--root` and `--cache`. Exit codes: 0 success, 1 validation failures, 2 usage or runtime
|
|
272
|
+
errors.
|
|
273
|
+
|
|
274
|
+
## Models
|
|
275
|
+
|
|
276
|
+
`--embed-model` / `WIKI_EMBED_MODEL` and `--reranker` / `WIKI_RERANKER` override
|
|
277
|
+
`.wiki-cli.toml`. Models load from `~/.cache/wiki-cli/models/` only; run
|
|
278
|
+
`wiki models download` once. Without a downloaded model, search falls back to
|
|
279
|
+
keyword-only and says so. [docs/model-selection.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/model-selection.md) explains the
|
|
280
|
+
defaults.
|
|
281
|
+
|
|
282
|
+
## Tests and benchmark
|
|
283
|
+
|
|
284
|
+
```bash
|
|
285
|
+
.venv/Scripts/python -m pytest
|
|
286
|
+
.venv/Scripts/python benchmarks/bench_synthetic.py --pages 30000 --relations 100000
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
The tests use fake models and download nothing. GitHub Actions runs them on Windows,
|
|
290
|
+
macOS and Linux.
|
|
291
|
+
|
|
292
|
+
## License
|
|
293
|
+
|
|
294
|
+
MIT; see [LICENSE](https://github.com/GriffinHackley/LLM-WIKI/blob/main/LICENSE).
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
# LLM wiki starter kit (`wiki`)
|
|
2
|
+
|
|
3
|
+
Start and run an **LLM-maintained wiki** (a folder of Markdown notes that an agent
|
|
4
|
+
keeps: an Obsidian vault, a research notebook, a wiki about a codebase) with any agent
|
|
5
|
+
that can run shell commands: Claude Code, Codex, Cursor, Copilot, OpenCode and others.
|
|
6
|
+
|
|
7
|
+
- **`wiki new`** sets up a wiki from a preset: folder layout, page templates, an
|
|
8
|
+
`AGENTS.md` telling the agent how to be the librarian, and a config whose relation
|
|
9
|
+
rules match the templates. Presets: `research` (sources in, pages out), `code` (a
|
|
10
|
+
wiki in its own repo describing a code repo) and `writing` (stories you write in
|
|
11
|
+
Obsidian, and a wiki of their characters, places and plotlines).
|
|
12
|
+
- **`wiki guide`** prints the workflow an agent follows (ingest a source, answer a
|
|
13
|
+
question, audit the wiki, sync after code changes), versioned with the command so the
|
|
14
|
+
steps never go stale.
|
|
15
|
+
- **Search and navigation** find the best starting page without reading an index, show
|
|
16
|
+
where each page leads through typed relations with reasons, and read only the sections
|
|
17
|
+
needed, within a page limit.
|
|
18
|
+
|
|
19
|
+
**New here? Start with [docs/getting-started.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/getting-started.md).**
|
|
20
|
+
[docs/workflows.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/workflows.md) covers the workflows and how to customise them,
|
|
21
|
+
[docs/presets.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/presets.md) the presets, [docs/config.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/config.md) every config
|
|
22
|
+
setting. [PLAN.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/PLAN.md) is the current plan,
|
|
23
|
+
[FUTURE_IDEAS.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/FUTURE_IDEAS.md) the deferred ideas.
|
|
24
|
+
|
|
25
|
+
The `wiki` command never edits pages: agents do. What it builds for search lives in a
|
|
26
|
+
disposable SQLite cache in `<root>/.cache/`.
|
|
27
|
+
|
|
28
|
+
## Install
|
|
29
|
+
|
|
30
|
+
Requires [uv](https://docs.astral.sh/uv/getting-started/installation/), which installs
|
|
31
|
+
Python 3.13 for the tool if needed.
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv tool install llm-wiki-kit # once per machine; the command is `wiki`
|
|
35
|
+
wiki models download # once: about 0.2 GB
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
`uv tool upgrade llm-wiki-kit` updates it. The latest code, before a release:
|
|
39
|
+
`uv tool install git+https://github.com/GriffinHackley/LLM-WIKI`. For development, from a clone:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
uv tool install --editable . # 'wiki' follows the checkout
|
|
43
|
+
python -m venv .venv && .venv/Scripts/python -m pip install -e ".[test]"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
An earlier install named `wiki-cli` also provides `wiki`: remove it first with
|
|
47
|
+
`uv tool uninstall wiki-cli`.
|
|
48
|
+
|
|
49
|
+
## Quick start
|
|
50
|
+
|
|
51
|
+
A new research wiki:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
wiki new my-wiki --agent claude # optional slash commands (also copilot, opencode); AGENTS.md works for any agent
|
|
55
|
+
cd my-wiki
|
|
56
|
+
# put a source in raw/, then ask your agent: "ingest raw/<file>"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
A wiki about a codebase, in its own repo beside the code, or in a folder of the code's repo:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
wiki new my-app-wiki --preset code --code ../my-app
|
|
63
|
+
# or, from the code repo: wiki new docs/wiki --preset code --code .
|
|
64
|
+
# add the lines it prints to the code repo, then work from there as usual
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
A wiki for your writing: you write ideas, scenes and chapters in `originals/` in
|
|
68
|
+
Obsidian, the agent never touches them, and keeps a wiki of the stories:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
wiki new my-stories --preset writing --agent claude
|
|
72
|
+
# open it in Obsidian (Templater, Linter, Obsidian Git), write, then ask: "ingest the storm scene"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
An existing folder of notes (an Obsidian vault, a `docs/` folder, a wiki an agent already
|
|
76
|
+
keeps):
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
cd my-notes
|
|
80
|
+
wiki new . --agent claude # drafts a .wiki-cli.toml from your pages, adds the agent files
|
|
81
|
+
wiki index refresh # index and embed (about 2 minutes per 500 pages on CPU)
|
|
82
|
+
wiki search "how do I configure the exporter?"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Your pages stay as they are; [getting started](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/getting-started.md#6-add-to-an-existing-wiki)
|
|
86
|
+
covers reviewing the drafted config and adopting a preset's page types.
|
|
87
|
+
|
|
88
|
+
It also works with no configuration at all: every `*.md` file under the folder is a
|
|
89
|
+
page, `raw/**/*.txt` is searchable source text, and every link is a `links-to` relation
|
|
90
|
+
whose reason is the sentence around it.
|
|
91
|
+
|
|
92
|
+
## Configure: `.wiki-cli.toml`
|
|
93
|
+
|
|
94
|
+
Commands find the root by walking up to the nearest `.wiki-cli.toml`, else use the
|
|
95
|
+
enclosing git repository, else the current folder, and say which folder they chose when
|
|
96
|
+
no config did. They refuse to treat your home folder or a drive root as a wiki. `--root`
|
|
97
|
+
or `WIKI_ROOT` overrides all of this, and `WIKI_CONFIG` points at a different config
|
|
98
|
+
file. Every setting is optional; [docs/config.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/config.md) is the full reference,
|
|
99
|
+
with each key's type and default:
|
|
100
|
+
|
|
101
|
+
```toml
|
|
102
|
+
preset = "research" # the preset `wiki new` used; picks guide variants
|
|
103
|
+
pages = ["wiki/**/*.md"] # default ["**/*.md"]
|
|
104
|
+
exclude = ["wiki/index.md"] # default none
|
|
105
|
+
raw = ["raw/**/*.txt"] # default; searched only with --include-raw
|
|
106
|
+
embed_model = "BAAI/bge-small-en-v1.5" # default; $WIKI_EMBED_MODEL overrides
|
|
107
|
+
reranker = "jinaai/jina-reranker-v1-turbo-en" # default, or "none"; $WIKI_RERANKER overrides
|
|
108
|
+
|
|
109
|
+
[types.person] # page types: guides list them, `wiki check` flags others
|
|
110
|
+
description = "A person."
|
|
111
|
+
folder = "wiki/people" # pages here get this type when frontmatter has none
|
|
112
|
+
template = "templates/person.md"
|
|
113
|
+
sections = ["Summary"] # headings and frontmatter every page of the type has,
|
|
114
|
+
fields = ["title", "type", "sources", "last_updated"] # checked by `wiki check`
|
|
115
|
+
values = { role = ["author", "subject"] } # allowed values of a field
|
|
116
|
+
hub = false # true: pages gather around it (see `wiki clusters`)
|
|
117
|
+
record = false # true: each page describes a ticket or the like, kept by key, url, synced
|
|
118
|
+
|
|
119
|
+
[records] # record types: when `wiki stale` asks for a recheck
|
|
120
|
+
recheck_days = 30 # default
|
|
121
|
+
|
|
122
|
+
[summary] # where a page's summary comes from, in order
|
|
123
|
+
fields = ["summary", "description"] # frontmatter keys (default)
|
|
124
|
+
headings = ["Summary", "Overview"] # default ["Summary"]; else the first paragraph
|
|
125
|
+
|
|
126
|
+
[page_type]
|
|
127
|
+
field = "type" # frontmatter key holding the page type (default)
|
|
128
|
+
|
|
129
|
+
[check]
|
|
130
|
+
require_frontmatter = false # default
|
|
131
|
+
summary_types = ["person"] # page types that must have a summary ("*" = all)
|
|
132
|
+
|
|
133
|
+
[suggest]
|
|
134
|
+
named_types = ["person", "organization"] # pages `suggest` matches by name (default: all)
|
|
135
|
+
|
|
136
|
+
[search]
|
|
137
|
+
results = 3 # default; pages from search, nav start and nav search (1-20)
|
|
138
|
+
|
|
139
|
+
[pending]
|
|
140
|
+
ignore = ["raw/SOURCES.md"] # files in raw/ that are not sources (default none)
|
|
141
|
+
|
|
142
|
+
[weekly] # weekly notes (`wiki weekly`); off without this table
|
|
143
|
+
folder = "weekly" # default; never indexed
|
|
144
|
+
group_by = "module" # "where the work went" by module, or "type" (default)
|
|
145
|
+
|
|
146
|
+
[groups] # --group on clusters and map: pages naming a group, and their neighbours
|
|
147
|
+
fields = ["tags"] # default; the frontmatter fields that name a page's groups
|
|
148
|
+
|
|
149
|
+
[hooks] # the pre-commit hook's extra checks, run from the root
|
|
150
|
+
pre_commit = ["python tools/check.py", { run = "python tools/lint.py", files = ["drafts/*.md"] }]
|
|
151
|
+
|
|
152
|
+
[guides]
|
|
153
|
+
dir = "guides" # the wiki's own guides, overriding built-in ones by name
|
|
154
|
+
parts = "guides/parts" # default; <name>.md is the wiki's own text for a guide step
|
|
155
|
+
|
|
156
|
+
[code] # code wikis only
|
|
157
|
+
repo = "../my-app" # the code repo, relative to the wiki; $WIKI_CODE_REPO overrides
|
|
158
|
+
origin = "https://github.com/me/my-app.git" # catches a pointer to the wrong checkout
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
In a code repo, a `.wiki-cli.toml` holding only `wiki = "../my-app-wiki"` sends every
|
|
162
|
+
command run there to the wiki.
|
|
163
|
+
|
|
164
|
+
## Relations
|
|
165
|
+
|
|
166
|
+
Typed relations come from rules in the same file. A rule gives links under a heading,
|
|
167
|
+
or the values of a frontmatter field, a type and an inverse label:
|
|
168
|
+
|
|
169
|
+
```toml
|
|
170
|
+
[[relations]]
|
|
171
|
+
heading = "Entities mentioned" # or a list of headings
|
|
172
|
+
page_type = "source" # optional, or a list
|
|
173
|
+
type = "mentions"
|
|
174
|
+
inverse = "mentioned-in"
|
|
175
|
+
|
|
176
|
+
[[relations]]
|
|
177
|
+
field = "sources" # frontmatter field holding slugs or [[links]]
|
|
178
|
+
type = "draws-on"
|
|
179
|
+
inverse = "drawn-on-by"
|
|
180
|
+
reason = "Listed in sources." # optional; without it, the sentence citing the page
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
With that rule, this list item
|
|
184
|
+
|
|
185
|
+
```markdown
|
|
186
|
+
## Entities mentioned
|
|
187
|
+
- [[charles-babbage]] — Inventor who delayed the demonstration (p. 2)
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
becomes `mentions -> charles-babbage` with reason "Inventor who delayed the
|
|
191
|
+
demonstration (p. 2)". A link in parentheses under a typed heading, such as a citation
|
|
192
|
+
`([[report]], p. 2)`, is a plain link: it supports the line rather than being its subject. Without rules, links are
|
|
193
|
+
still relations (`links-to`), and frontmatter values written as `[[links]]` count as
|
|
194
|
+
links, as in Obsidian. Built in: `embeds` (a `![[page#^block]]` embed), `refers-to-code`
|
|
195
|
+
(a `[name](code:path)` link to a file in a code wiki's code repo) and `links-to`. When a
|
|
196
|
+
page reaches one target several ways, the most specific type wins: heading-rule types in
|
|
197
|
+
file order, then `embeds`, then field-only types, then `links-to`. `wiki vocab` lists
|
|
198
|
+
the types. Changing the rules re-derives relations on the next refresh without
|
|
199
|
+
re-embedding.
|
|
200
|
+
|
|
201
|
+
## Commands
|
|
202
|
+
|
|
203
|
+
| Command | Purpose |
|
|
204
|
+
|---|---|
|
|
205
|
+
| `wiki new [folder] [--preset research\|code\|writing\|<folder>] [--code <repo>] [--agent claude\|copilot\|opencode ...] [--git-hook]` | Create a wiki from a preset; in a folder that already has pages, adopt it (draft its config, add the agent files, leave the pages alone); never overwrites |
|
|
206
|
+
| `wiki guide [<name>] [--parts]` | Print a workflow's steps for an agent; without a name, list them; `--parts` lists the steps a wiki can fill with its own text (`guides/parts/`) |
|
|
207
|
+
| `wiki search "<question>" [--limit 3] [--include-raw] [--keyword-only]` | Best pages for a question: keyword + vector search, fused and reranked |
|
|
208
|
+
| `wiki nav start \| read \| candidates \| search \| end \| log` | Guided traversal sessions (see [docs/navigation.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/navigation.md)) |
|
|
209
|
+
| `wiki list [--type T]` | Every page with its type and summary |
|
|
210
|
+
| `wiki pending [--hash <original>]` | Sources in `raw/` no page links to yet, flagging copies of sources already ingested, and originals revised since they were ingested; `--hash` prints an original's hash for its page |
|
|
211
|
+
| `wiki neighbors <slug> [--incoming] [--outgoing] [--relation T] [--limit N]` | A page's typed relations with reasons, no page bodies |
|
|
212
|
+
| `wiki suggest <slug>` | Pages a page names but does not link, shares linked pages with, or resembles |
|
|
213
|
+
| `wiki unwritten [--limit N]` | Link targets with no page, most-linked first |
|
|
214
|
+
| `wiki orphans` | Pages nothing relates to |
|
|
215
|
+
| `wiki clusters [--all] [--min-size 4] [--resolution 1.0] [--group G]` | Groups of pages that link each other densely (Louvain communities) with no hub page most of them link to, and no split of them into parts that each have one: leads for pages worth writing. Wikis of 30 pages or more. `--group`: only one group's pages ([groups]); `--ungrouped`: the pages in no group |
|
|
216
|
+
| `wiki map [--query "<question>"] [--nav <session>\|last\|all] [--chunks] [--group G] [--method auto\|umap\|pca] [--color-by type\|cluster\|age\|visits] [--open]` | A 3D map of the pages' embeddings as one HTML page in `.cache/` (works offline): points coloured by type, link cluster or age, relations as lines; a question placed among the pages with lines to its search results; nav sessions drawn as paths to step through. UMAP by default; if UMAP cannot be used it says so and uses PCA. `--group`: only one group's pages, laid out on their own |
|
|
217
|
+
| `wiki stale` | Pages whose covered code changed since they were verified, and record pages (tickets) due for a recheck |
|
|
218
|
+
| `wiki covering <path>` | A code file's notes: the pages covering it, most specific first, and the gotchas and decisions affecting them (`--session` shows each file once per agent session) |
|
|
219
|
+
| `wiki connect <code-repo> --agent <name>` | Set up a code repo for the work loop: write the wiki's files there (pointer, `WIKI.md`, skills, hook files) and print the lines to add by hand; `--check` reports what is missing |
|
|
220
|
+
| `wiki task start\|takeover\|cancel\|status` | The one open task on the code, held by one agent session: the agent hooks refuse edits to the code and the wiki outside it |
|
|
221
|
+
| `wiki commit "<message>"` | Commit the wiki's changes, everything but the originals folder, waiting while another git process (Obsidian Git) holds the index |
|
|
222
|
+
| `wiki finish -m <message>` | End the open task: commit the files it edited in the code repo, set `verified:` on the pages it checked, and commit the wiki |
|
|
223
|
+
| `wiki weekly [--week 2026-W40 \| current]` | With `[weekly]`: a note per finished week of work (pages added and changed, where the work went, sources, open questions, health, code) and a timeline, from git; `current` shows this week so far |
|
|
224
|
+
| `wiki precommit` | What the pre-commit hook checks: sources in `raw/` unchanged, last week's note, no `wiki check --all` errors, the wiki's `[hooks] pre_commit` commands |
|
|
225
|
+
| `wiki check <slug> \| --all [--verify-cache] [--strict] [--no-warnings] [--summary-ok]` | Frontmatter, summaries, types and their required sections and fields, uncited sources, ambiguous and unwritten links, stale summaries, code links, hub pages that several separate clusters gather around, file pages filed under a broader module than the one covering them |
|
|
226
|
+
| `wiki check <source-slug> --ingested` | Whether an ingest is complete: original linked, discussed pages named and citing it, all clean and committed |
|
|
227
|
+
| `wiki index refresh \| rebuild [--no-embed] \| status` | Manage the cache and embeddings |
|
|
228
|
+
| `wiki init [--write] [--preset <name>]` | Survey an existing folder and draft a `.wiki-cli.toml` (never overwrites); `--preset` adds the preset's page types, relation rules and weekly notes, or prints just those for a wiki that has a config |
|
|
229
|
+
| `wiki models list \| download` | Supported models; `download` is the only command that downloads |
|
|
230
|
+
| `wiki eval sample \| run` | Search-quality evaluation (see [docs/evaluation.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/evaluation.md)) |
|
|
231
|
+
| `wiki vocab` | Relation types, their inverses, and where each comes from |
|
|
232
|
+
|
|
233
|
+
All commands accept `--format json` (compact, deterministic); commands on a wiki accept
|
|
234
|
+
`--root` and `--cache`. Exit codes: 0 success, 1 validation failures, 2 usage or runtime
|
|
235
|
+
errors.
|
|
236
|
+
|
|
237
|
+
## Models
|
|
238
|
+
|
|
239
|
+
`--embed-model` / `WIKI_EMBED_MODEL` and `--reranker` / `WIKI_RERANKER` override
|
|
240
|
+
`.wiki-cli.toml`. Models load from `~/.cache/wiki-cli/models/` only; run
|
|
241
|
+
`wiki models download` once. Without a downloaded model, search falls back to
|
|
242
|
+
keyword-only and says so. [docs/model-selection.md](https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/model-selection.md) explains the
|
|
243
|
+
defaults.
|
|
244
|
+
|
|
245
|
+
## Tests and benchmark
|
|
246
|
+
|
|
247
|
+
```bash
|
|
248
|
+
.venv/Scripts/python -m pytest
|
|
249
|
+
.venv/Scripts/python benchmarks/bench_synthetic.py --pages 30000 --relations 100000
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
The tests use fake models and download nothing. GitHub Actions runs them on Windows,
|
|
253
|
+
macOS and Linux.
|
|
254
|
+
|
|
255
|
+
## License
|
|
256
|
+
|
|
257
|
+
MIT; see [LICENSE](https://github.com/GriffinHackley/LLM-WIKI/blob/main/LICENSE).
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=77"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "llm-wiki-kit"
|
|
7
|
+
dynamic = ["version"]
|
|
8
|
+
description = "Start and run an LLM-maintained wiki with any agent: presets, workflow guides, search, typed relations and guided navigation."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.13"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE", "src/wiki_cli/map/3d-force-graph.LICENSE"]
|
|
13
|
+
authors = [{ name = "Griffin Hackley" }]
|
|
14
|
+
keywords = ["wiki", "llm", "agents", "knowledge-base", "obsidian", "markdown", "search", "claude", "codex"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 4 - Beta",
|
|
17
|
+
"Environment :: Console",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Intended Audience :: Science/Research",
|
|
20
|
+
"Operating System :: OS Independent",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.13",
|
|
23
|
+
"Topic :: Documentation",
|
|
24
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
25
|
+
"Topic :: Text Processing :: Markup :: Markdown",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"PyYAML>=6",
|
|
29
|
+
"sqlite-vec>=0.1.9",
|
|
30
|
+
# Pinned: fastembed versions pin which model files are downloaded. It is used only to
|
|
31
|
+
# download; models.py runs the files with onnxruntime and tokenizers, matching 0.8.1.
|
|
32
|
+
"fastembed==0.8.1",
|
|
33
|
+
"onnxruntime>=1.20",
|
|
34
|
+
"tokenizers>=0.20",
|
|
35
|
+
"numpy>=2",
|
|
36
|
+
"networkx>=3.2", # Louvain communities for wiki clusters
|
|
37
|
+
"umap-learn>=0.5.7", # 3D layout for wiki map; imported only by that command
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.optional-dependencies]
|
|
41
|
+
test = ["pytest>=8"]
|
|
42
|
+
|
|
43
|
+
[project.urls]
|
|
44
|
+
Homepage = "https://github.com/GriffinHackley/LLM-WIKI"
|
|
45
|
+
Documentation = "https://github.com/GriffinHackley/LLM-WIKI/blob/main/docs/getting-started.md"
|
|
46
|
+
Issues = "https://github.com/GriffinHackley/LLM-WIKI/issues"
|
|
47
|
+
Changelog = "https://github.com/GriffinHackley/LLM-WIKI/blob/main/CHANGELOG.md"
|
|
48
|
+
|
|
49
|
+
[project.scripts]
|
|
50
|
+
wiki = "wiki_cli.cli:main"
|
|
51
|
+
|
|
52
|
+
[tool.setuptools.dynamic]
|
|
53
|
+
version = { attr = "wiki_cli.__version__" }
|
|
54
|
+
|
|
55
|
+
[tool.setuptools.packages.find]
|
|
56
|
+
where = ["src"]
|
|
57
|
+
|
|
58
|
+
[tool.setuptools.package-data]
|
|
59
|
+
wiki_cli = ["guides/**/*.md", "presets/**/*", "hooks/*", "map/*"]
|
|
60
|
+
|
|
61
|
+
[tool.pytest.ini_options]
|
|
62
|
+
testpaths = ["tests"]
|