lodestar-brain 0.1.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 (65) hide show
  1. lodestar_brain-0.1.0/.gitattributes +6 -0
  2. lodestar_brain-0.1.0/.github/workflows/ci.yml +48 -0
  3. lodestar_brain-0.1.0/.gitignore +26 -0
  4. lodestar_brain-0.1.0/CHANGELOG.md +37 -0
  5. lodestar_brain-0.1.0/CONTRIBUTING.md +39 -0
  6. lodestar_brain-0.1.0/LICENSE +202 -0
  7. lodestar_brain-0.1.0/NOTICE +14 -0
  8. lodestar_brain-0.1.0/PKG-INFO +142 -0
  9. lodestar_brain-0.1.0/README.md +111 -0
  10. lodestar_brain-0.1.0/lodestar.example.yaml +30 -0
  11. lodestar_brain-0.1.0/pyproject.toml +59 -0
  12. lodestar_brain-0.1.0/src/lodestar_brain/__init__.py +66 -0
  13. lodestar_brain-0.1.0/src/lodestar_brain/cli.py +287 -0
  14. lodestar_brain-0.1.0/src/lodestar_brain/config.py +220 -0
  15. lodestar_brain-0.1.0/src/lodestar_brain/corpus.py +248 -0
  16. lodestar_brain-0.1.0/src/lodestar_brain/graph.py +312 -0
  17. lodestar_brain-0.1.0/src/lodestar_brain/insight.py +149 -0
  18. lodestar_brain-0.1.0/src/lodestar_brain/pipeline.py +66 -0
  19. lodestar_brain-0.1.0/src/lodestar_brain/retrieval.py +161 -0
  20. lodestar_brain-0.1.0/src/lodestar_brain/roadmap.py +394 -0
  21. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/algorithms/algorithm-0.md +8 -0
  22. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/algorithms/algorithm-1.md +8 -0
  23. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/algorithms/algorithm-2.md +8 -0
  24. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/algorithms/algorithm-3.md +8 -0
  25. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/algorithms/algorithm-4.md +8 -0
  26. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/algorithms/algorithm-5.md +6 -0
  27. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/algorithms/algorithm-6.md +6 -0
  28. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/algorithms/algorithm-7.md +6 -0
  29. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/cooking/cooking-0.md +6 -0
  30. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/cooking/cooking-1.md +6 -0
  31. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/cooking/cooking-2.md +6 -0
  32. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/cooking/orphan-recipe-0.md +6 -0
  33. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/cooking/orphan-recipe-1.md +6 -0
  34. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/cooking/orphan-recipe-2.md +6 -0
  35. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/datastructures/data-structure-0.md +6 -0
  36. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/datastructures/data-structure-1.md +6 -0
  37. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/datastructures/data-structure-2.md +6 -0
  38. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/datastructures/data-structure-3.md +6 -0
  39. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/datastructures/data-structure-4.md +6 -0
  40. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/datastructures/data-structure-5.md +6 -0
  41. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/datastructures/data-structure-6.md +6 -0
  42. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/datastructures/data-structure-7.md +6 -0
  43. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/journal/journal-entry-0.md +6 -0
  44. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/journal/journal-entry-1.md +6 -0
  45. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/journal/journal-entry-2.md +6 -0
  46. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/optimization/optimization-0.md +6 -0
  47. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/optimization/optimization-1.md +6 -0
  48. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/optimization/optimization-2.md +6 -0
  49. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/programming/programming-0.md +6 -0
  50. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/programming/programming-1.md +6 -0
  51. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/programming/programming-2.md +6 -0
  52. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/programming/programming-3.md +6 -0
  53. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/programming/programming-4.md +6 -0
  54. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/theory/theory-0.md +7 -0
  55. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/theory/theory-1.md +6 -0
  56. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/theory/theory-2.md +6 -0
  57. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/theory/theory-3.md +6 -0
  58. lodestar_brain-0.1.0/src/lodestar_brain/sample/notes/theory/theory-4.md +8 -0
  59. lodestar_brain-0.1.0/tests/test_config.py +154 -0
  60. lodestar_brain-0.1.0/tests/test_corpus.py +194 -0
  61. lodestar_brain-0.1.0/tests/test_graph.py +162 -0
  62. lodestar_brain-0.1.0/tests/test_insight.py +138 -0
  63. lodestar_brain-0.1.0/tests/test_pipeline.py +72 -0
  64. lodestar_brain-0.1.0/tests/test_retrieval.py +137 -0
  65. lodestar_brain-0.1.0/tests/test_roadmap.py +159 -0
@@ -0,0 +1,6 @@
1
+ # Normalize line endings: store text as LF in the repo, check out native.
2
+ * text=auto eol=lf
3
+
4
+ # Binary / generated artifacts — never normalize
5
+ *.whl binary
6
+ *.tar.gz binary
@@ -0,0 +1,48 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python ${{ matrix.python-version }}
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+ - name: Install
22
+ run: python -m pip install -e ".[dev]"
23
+ - name: Tests
24
+ run: python -m pytest -q
25
+ - name: Demo produces a non-empty agenda (network-free)
26
+ run: |
27
+ out="$(lodestar demo)"
28
+ echo "$out" | head -20
29
+ echo "$out" | grep -q "^# Agenda" || { echo "demo produced no agenda"; exit 1; }
30
+ echo "$out" | grep -q "Bridge" || { echo "bridge goal missing"; exit 1; }
31
+
32
+ build:
33
+ runs-on: ubuntu-latest
34
+ steps:
35
+ - uses: actions/checkout@v4
36
+ - uses: actions/setup-python@v5
37
+ with:
38
+ python-version: "3.12"
39
+ - name: Build wheel + sdist
40
+ run: |
41
+ python -m pip install build
42
+ python -m build
43
+ - name: Verify the sample vault is bundled in the wheel
44
+ run: python -c "import zipfile,glob; w=glob.glob('dist/*.whl')[0]; names=zipfile.ZipFile(w).namelist(); assert any(n.endswith('.md') and 'sample/notes' in n for n in names), 'sample not bundled'; print('sample bundled OK')"
45
+ - uses: actions/upload-artifact@v4
46
+ with:
47
+ name: dist
48
+ path: dist/*
@@ -0,0 +1,26 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.egg-info/
5
+ .eggs/
6
+ build/
7
+ dist/
8
+ .venv/
9
+ venv/
10
+ env/
11
+
12
+ # Tooling
13
+ .pytest_cache/
14
+ .mypy_cache/
15
+ .ruff_cache/
16
+ .coverage
17
+ htmlcov/
18
+
19
+ # Lodestar runtime output (default state dir)
20
+ .lodestar/
21
+
22
+ # Editors / OS
23
+ .vscode/
24
+ .idea/
25
+ .DS_Store
26
+ Thumbs.db
@@ -0,0 +1,37 @@
1
+ # Changelog
2
+
3
+ All notable changes to lodestar-brain are documented here.
4
+ The format follows [Keep a Changelog](https://keepachangelog.com/); this project
5
+ uses [Semantic Versioning](https://semver.org/).
6
+
7
+ ## [0.1.0] — 2026-06-24
8
+
9
+ First public release: the self-thinking core (L4 → L6 → L8) over any folder of
10
+ Markdown notes.
11
+
12
+ ### Added
13
+ - **Config** (`lodestar.yaml`): corpus/state dirs, retrieval backend, flat
14
+ `priority_topics`, `data_domains` / `machinery_domains` (default empty).
15
+ - **Corpus** reader: tolerant Markdown + YAML-frontmatter parsing, one wikilink
16
+ parser, one resolver (title → filename → alias → path). BOM-safe.
17
+ - **Retrieval**: a `Retriever` protocol (bring-your-own) + a zero-dependency
18
+ pure-Python `BM25Retriever` default. `lodestar search`.
19
+ - **L4 graph**: PageRank + degree hubs, label-propagation communities, broker
20
+ scoring, structural-hole bridge gaps, orphan/dead-link detection. Strips code
21
+ regions before edge-building. `lodestar graph`.
22
+ - **L6 insights**: graph-derived synthesis candidates (headline); aging-authority
23
+ and stalled-inquiry (opt-in, from `updated:` / `status:`). `lodestar insights`.
24
+ - **L8 roadmap**: a self-directed, ranked agenda (sparse-domain, bridge,
25
+ near-orphan, alignment goals), value × gap × weight scoring, optional
26
+ `priority_topics` alignment, per-goal suggested-step checklists. Writes a
27
+ unified `AGENDA.md`. `lodestar roadmap`.
28
+ - **`lodestar run`** (whole chain) and **`lodestar demo`** (bundled sample vault,
29
+ zero setup).
30
+
31
+ ### Notes
32
+ - Retrieval and execution are **bring-your-own**: the deliverable is the agenda;
33
+ a human or your own agent acts on it. There is no executor, approval gate, or
34
+ campaign state machine.
35
+ - Deferred to a later release: a typed-relationship layer (contradiction /
36
+ supersession insights), semantic/reranker retrieval adapters, and an
37
+ outcome-calibrated self-tuning rung (needs sustained usage data).
@@ -0,0 +1,39 @@
1
+ # Contributing to lodestar-brain
2
+
3
+ Thanks for your interest! lodestar-brain is small, pure-Python, and dependency-light
4
+ on purpose — contributions that keep it that way are the easiest to merge.
5
+
6
+ ## Development setup
7
+
8
+ ```bash
9
+ git clone https://github.com/Trashpanda62/lodestar-brain
10
+ cd lodestar-brain
11
+ python -m pip install -e ".[dev]"
12
+ python -m pytest # all tests should pass
13
+ lodestar demo # the bundled sample agenda
14
+ ```
15
+
16
+ ## Principles
17
+
18
+ - **Pure-Python, deterministic, offline.** The core (graph/insight/roadmap +
19
+ BM25) takes no runtime dependency beyond PyYAML and never touches the network.
20
+ New backends (embeddings, rerankers, vector DBs) belong behind the `Retriever`
21
+ protocol as optional extras, never in the core path.
22
+ - **The brain proposes; it never executes.** lodestar emits an agenda + reports.
23
+ It must never edit the user's notes, run tasks, spend money, or delete things.
24
+ - **Config-driven, not hard-coded.** No vault-specific domain names or paths in
25
+ the engines — read them from `LodestarConfig`.
26
+ - **Reports go to the state dir, never into the user's note corpus.**
27
+
28
+ ## Tests
29
+
30
+ Every behavior change needs a test. The `lodestar demo` over the bundled sample
31
+ vault is the integration contract — it must keep producing a non-empty, diverse
32
+ agenda (the CI asserts this).
33
+
34
+ ## Pull requests
35
+
36
+ Keep PRs focused. Run `pytest` and `lodestar demo` before opening. New CLI
37
+ commands or config keys should update the README and `CHANGELOG.md`.
38
+
39
+ By contributing you agree your contributions are licensed under Apache-2.0.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,14 @@
1
+ lodestar-brain
2
+ Copyright 2026 The lodestar-brain authors.
3
+
4
+ This product includes software developed by the lodestar-brain authors.
5
+
6
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
7
+ this file except in compliance with the License. You may obtain a copy of the
8
+ License in the accompanying LICENSE file or at:
9
+
10
+ http://www.apache.org/licenses/LICENSE-2.0
11
+
12
+ Lodestar-brain is the standalone, generalized extraction of the "Lodestar"
13
+ self-directing knowledge-graph engine. It carries no third-party vendored code;
14
+ its only runtime dependency is PyYAML (also Apache-2.0 licensed).
@@ -0,0 +1,142 @@
1
+ Metadata-Version: 2.4
2
+ Name: lodestar-brain
3
+ Version: 0.1.0
4
+ Summary: A self-directing second brain for your markdown notes: builds a knowledge graph and hands you a ranked agenda of what to grow, bridge, and fix next.
5
+ Project-URL: Homepage, https://github.com/Trashpanda62/lodestar-brain
6
+ Project-URL: Repository, https://github.com/Trashpanda62/lodestar-brain
7
+ Project-URL: Issues, https://github.com/Trashpanda62/lodestar-brain/issues
8
+ Author: Trashpanda62
9
+ License-Expression: Apache-2.0
10
+ License-File: LICENSE
11
+ License-File: NOTICE
12
+ Keywords: knowledge-graph,markdown,note-taking,obsidian,pkm,second-brain,zettelkasten
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: End Users/Desktop
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.9
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Programming Language :: Python :: 3.13
23
+ Classifier: Topic :: Office/Business
24
+ Classifier: Topic :: Text Processing :: Markup :: Markdown
25
+ Requires-Python: >=3.9
26
+ Requires-Dist: pyyaml>=6.0
27
+ Provides-Extra: dev
28
+ Requires-Dist: build>=1.0; extra == 'dev'
29
+ Requires-Dist: pytest>=7.0; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # lodestar-brain
33
+
34
+ **A self-directing second brain for your markdown notes.**
35
+
36
+ Point it at any folder of Markdown (an Obsidian vault, a Zettelkasten, a docs
37
+ tree) and lodestar-brain builds a knowledge graph and hands you a **ranked
38
+ agenda of what to grow, bridge, and fix next** — the sparse-but-important
39
+ topics, the structural holes between clusters, the near-orphan notes. You (or
40
+ your own LLM) act on the agenda; lodestar tells you *where to point your
41
+ attention*.
42
+
43
+ > Status: **v0.1.** The self-thinking core — graph (L4), insights (L6), and the
44
+ > self-directing roadmap (L8) — is complete and runs over any folder of Markdown.
45
+
46
+ ```bash
47
+ pip install git+https://github.com/Trashpanda62/lodestar-brain
48
+ lodestar demo # see it work on a bundled sample vault — zero setup
49
+ ```
50
+
51
+ *(Not on PyPI yet — install from source as above. A PyPI release is planned.)*
52
+
53
+ ## What it is (and isn't)
54
+
55
+ - **It is** a *self-directing* brain: it derives its own knowledge agenda from the
56
+ shape of your notes (graph centrality, cross-domain gaps, orphans) plus
57
+ optional priority topics you declare.
58
+ - **It is not** an autonomous executor. lodestar **proposes** an agenda; it never
59
+ edits your notes, runs tasks, or "maintains your vault" on its own. Execution
60
+ is bring-your-own — a human, or an agent you wire up.
61
+ - **Retrieval is bring-your-own too:** a pure-Python BM25 backend ships by
62
+ default (zero extra dependencies). Plug in your own (embeddings, a reranker, a
63
+ vector DB) by implementing the small `Retriever` protocol.
64
+
65
+ ## The ladder
66
+
67
+ lodestar-brain ships the **self-thinking** layers of a knowledge graph:
68
+
69
+ | Rung | Does | Command |
70
+ |------|------|---------|
71
+ | L4 — relate | builds the link graph: hubs, clusters, orphans, cross-domain bridge gaps | `lodestar graph` |
72
+ | L6 — notice | surfaces emergent observations (synthesis candidates, aging hubs, stalled questions) | `lodestar insights` |
73
+ | L8 — direct | derives + ranks its own agenda of what to grow/connect/fix next | `lodestar roadmap` |
74
+
75
+ *(The retrieval substrate L1–L3 is bring-your-own — a zero-dependency BM25 ships
76
+ as the default. The outcome-calibrated self-tuning rung L9 is deferred to a later
77
+ release: it needs weeks of real usage data before it does anything.)*
78
+
79
+ ## Install
80
+
81
+ ```bash
82
+ pip install git+https://github.com/Trashpanda62/lodestar-brain
83
+ ```
84
+
85
+ Pure-Python; the only runtime dependency is PyYAML. (PyPI release planned.)
86
+
87
+ ## Quickstart
88
+
89
+ **See it work first — zero config:**
90
+
91
+ ```bash
92
+ lodestar demo # runs the whole chain over a bundled sample vault
93
+ ```
94
+
95
+ **Then point it at your own notes:**
96
+
97
+ ```bash
98
+ # 1. create a config
99
+ cp lodestar.example.yaml lodestar.yaml
100
+
101
+ # 2. edit lodestar.yaml so corpus_dir points at your notes folder
102
+ # corpus_dir: /path/to/your/vault
103
+
104
+ # 3. run the whole chain → AGENDA.md in ./.lodestar/
105
+ lodestar run
106
+ ```
107
+
108
+ ```yaml
109
+ # lodestar.yaml — minimal
110
+ corpus_dir: /path/to/your/notes
111
+ priority_topics: # optional — omit for pure curiosity mode
112
+ - name: "My current focus"
113
+ domains: [project-x] # a folder name in your vault
114
+ ```
115
+
116
+ ## Commands
117
+
118
+ | Command | What it does |
119
+ |---------|--------------|
120
+ | `lodestar demo` | run the whole chain over a bundled sample vault (zero setup) |
121
+ | `lodestar info` | summarize what lodestar sees in your corpus |
122
+ | `lodestar graph` | compute the knowledge graph → `brain-map.md` |
123
+ | `lodestar insights` | surface emergent observations → `insights.md` |
124
+ | `lodestar roadmap` | derive the ranked agenda → `AGENDA.md` |
125
+ | `lodestar run` | all of the above in one pass |
126
+ | `lodestar search <q>` | BM25 search over the corpus |
127
+
128
+ Outputs go to your `state_dir` (default `./.lodestar`) — never into your notes.
129
+ The headline deliverable is **`AGENDA.md`**: a ranked, actionable list of what to
130
+ grow, connect, and fix next, with a by-hand checklist per item. You (or your own
131
+ agent) act on it — lodestar proposes, it never edits your notes.
132
+
133
+ ## Configuration
134
+
135
+ See [`lodestar.example.yaml`](lodestar.example.yaml) for the full annotated
136
+ config. Notes need **no special frontmatter** — titles fall back to filenames,
137
+ domains to the top folder. If you do use YAML frontmatter (`title`, `domain`,
138
+ `aliases`), lodestar reads it.
139
+
140
+ ## License
141
+
142
+ [Apache-2.0](LICENSE). See [NOTICE](NOTICE).
@@ -0,0 +1,111 @@
1
+ # lodestar-brain
2
+
3
+ **A self-directing second brain for your markdown notes.**
4
+
5
+ Point it at any folder of Markdown (an Obsidian vault, a Zettelkasten, a docs
6
+ tree) and lodestar-brain builds a knowledge graph and hands you a **ranked
7
+ agenda of what to grow, bridge, and fix next** — the sparse-but-important
8
+ topics, the structural holes between clusters, the near-orphan notes. You (or
9
+ your own LLM) act on the agenda; lodestar tells you *where to point your
10
+ attention*.
11
+
12
+ > Status: **v0.1.** The self-thinking core — graph (L4), insights (L6), and the
13
+ > self-directing roadmap (L8) — is complete and runs over any folder of Markdown.
14
+
15
+ ```bash
16
+ pip install git+https://github.com/Trashpanda62/lodestar-brain
17
+ lodestar demo # see it work on a bundled sample vault — zero setup
18
+ ```
19
+
20
+ *(Not on PyPI yet — install from source as above. A PyPI release is planned.)*
21
+
22
+ ## What it is (and isn't)
23
+
24
+ - **It is** a *self-directing* brain: it derives its own knowledge agenda from the
25
+ shape of your notes (graph centrality, cross-domain gaps, orphans) plus
26
+ optional priority topics you declare.
27
+ - **It is not** an autonomous executor. lodestar **proposes** an agenda; it never
28
+ edits your notes, runs tasks, or "maintains your vault" on its own. Execution
29
+ is bring-your-own — a human, or an agent you wire up.
30
+ - **Retrieval is bring-your-own too:** a pure-Python BM25 backend ships by
31
+ default (zero extra dependencies). Plug in your own (embeddings, a reranker, a
32
+ vector DB) by implementing the small `Retriever` protocol.
33
+
34
+ ## The ladder
35
+
36
+ lodestar-brain ships the **self-thinking** layers of a knowledge graph:
37
+
38
+ | Rung | Does | Command |
39
+ |------|------|---------|
40
+ | L4 — relate | builds the link graph: hubs, clusters, orphans, cross-domain bridge gaps | `lodestar graph` |
41
+ | L6 — notice | surfaces emergent observations (synthesis candidates, aging hubs, stalled questions) | `lodestar insights` |
42
+ | L8 — direct | derives + ranks its own agenda of what to grow/connect/fix next | `lodestar roadmap` |
43
+
44
+ *(The retrieval substrate L1–L3 is bring-your-own — a zero-dependency BM25 ships
45
+ as the default. The outcome-calibrated self-tuning rung L9 is deferred to a later
46
+ release: it needs weeks of real usage data before it does anything.)*
47
+
48
+ ## Install
49
+
50
+ ```bash
51
+ pip install git+https://github.com/Trashpanda62/lodestar-brain
52
+ ```
53
+
54
+ Pure-Python; the only runtime dependency is PyYAML. (PyPI release planned.)
55
+
56
+ ## Quickstart
57
+
58
+ **See it work first — zero config:**
59
+
60
+ ```bash
61
+ lodestar demo # runs the whole chain over a bundled sample vault
62
+ ```
63
+
64
+ **Then point it at your own notes:**
65
+
66
+ ```bash
67
+ # 1. create a config
68
+ cp lodestar.example.yaml lodestar.yaml
69
+
70
+ # 2. edit lodestar.yaml so corpus_dir points at your notes folder
71
+ # corpus_dir: /path/to/your/vault
72
+
73
+ # 3. run the whole chain → AGENDA.md in ./.lodestar/
74
+ lodestar run
75
+ ```
76
+
77
+ ```yaml
78
+ # lodestar.yaml — minimal
79
+ corpus_dir: /path/to/your/notes
80
+ priority_topics: # optional — omit for pure curiosity mode
81
+ - name: "My current focus"
82
+ domains: [project-x] # a folder name in your vault
83
+ ```
84
+
85
+ ## Commands
86
+
87
+ | Command | What it does |
88
+ |---------|--------------|
89
+ | `lodestar demo` | run the whole chain over a bundled sample vault (zero setup) |
90
+ | `lodestar info` | summarize what lodestar sees in your corpus |
91
+ | `lodestar graph` | compute the knowledge graph → `brain-map.md` |
92
+ | `lodestar insights` | surface emergent observations → `insights.md` |
93
+ | `lodestar roadmap` | derive the ranked agenda → `AGENDA.md` |
94
+ | `lodestar run` | all of the above in one pass |
95
+ | `lodestar search <q>` | BM25 search over the corpus |
96
+
97
+ Outputs go to your `state_dir` (default `./.lodestar`) — never into your notes.
98
+ The headline deliverable is **`AGENDA.md`**: a ranked, actionable list of what to
99
+ grow, connect, and fix next, with a by-hand checklist per item. You (or your own
100
+ agent) act on it — lodestar proposes, it never edits your notes.
101
+
102
+ ## Configuration
103
+
104
+ See [`lodestar.example.yaml`](lodestar.example.yaml) for the full annotated
105
+ config. Notes need **no special frontmatter** — titles fall back to filenames,
106
+ domains to the top folder. If you do use YAML frontmatter (`title`, `domain`,
107
+ `aliases`), lodestar reads it.
108
+
109
+ ## License
110
+
111
+ [Apache-2.0](LICENSE). See [NOTICE](NOTICE).
@@ -0,0 +1,30 @@
1
+ # lodestar-brain configuration. Copy to `lodestar.yaml` and edit.
2
+ # Relative paths resolve against the directory holding this file.
3
+
4
+ # REQUIRED: the folder of markdown notes to reason over.
5
+ corpus_dir: ./notes
6
+
7
+ # Where lodestar writes its output (graph, agenda, reports). Default: ./.lodestar
8
+ state_dir: ./.lodestar
9
+
10
+ # Retrieval backend (used by `lodestar search`).
11
+ # bm25 — pure-Python, zero dependencies (the only built-in backend)
12
+ # Bring your own (embeddings, a reranker, a vector DB) by implementing the
13
+ # lodestar_brain.retrieval.Retriever protocol.
14
+ retrieval:
15
+ backend: bm25
16
+
17
+ # OPTIONAL: priority topics steer the roadmap toward what you care about.
18
+ # Omit this whole block for pure "curiosity mode" (graph-shape only).
19
+ priority_topics:
20
+ - name: "Example Project"
21
+ domains: [project-x] # corpus folder name(s)
22
+ weight: 1.0
23
+
24
+ # Folders that hold DATA, not knowledge to grow (people records, logs, media).
25
+ # Excluded from growth goals. Default: none.
26
+ data_domains: []
27
+
28
+ # Folders that are tooling / scaffolding / meta. Excluded from goals.
29
+ # Default: none.
30
+ machinery_domains: []