loredocs 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.
loredocs-0.1.0/LICENSE ADDED
@@ -0,0 +1,92 @@
1
+ Business Source License 1.1
2
+
3
+ Parameters
4
+
5
+ Licensor: Labyrinth Analytics Consulting
6
+ Licensed Work: LoreDocs v0.1.0
7
+ The Licensed Work is (c) 2026 Labyrinth Analytics Consulting
8
+ Additional Use Grant: You may make personal, non-commercial use of the Licensed Work,
9
+ subject to the following limitation: you may create no more than
10
+ 3 vaults in total. Any use that exceeds this limit, or any
11
+ commercial use, requires a paid license from the Licensor.
12
+ Change Date: 2030-03-31
13
+ Change License: Apache License, Version 2.0
14
+
15
+ For information about alternative licensing arrangements for the Licensed Work,
16
+ please contact: info@labyrinthanalyticsconsulting.com
17
+
18
+ ---
19
+
20
+ Business Source License 1.1
21
+
22
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
23
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
24
+
25
+ Terms
26
+
27
+ The Licensor hereby grants you the right to copy, modify, create derivative
28
+ works, redistribute, and make non-production use of the Licensed Work. The
29
+ Licensor may make an Additional Use Grant, above, permitting limited production
30
+ use.
31
+
32
+ Effective on the Change Date, or the fourth anniversary of the first publicly
33
+ available distribution of a specific version of the Licensed Work under this
34
+ License, whichever comes first, the Licensor hereby grants you rights under
35
+ the terms of the Change License, and the rights granted in the paragraph
36
+ above terminate.
37
+
38
+ If your use of the Licensed Work does not comply with the requirements
39
+ currently in effect as described in this License, you must purchase a
40
+ commercial license from the Licensor, its affiliated entities, or authorized
41
+ resellers, or you must refrain from using the Licensed Work.
42
+
43
+ All copies of the original and modified Licensed Work, and derivative works
44
+ of the Licensed Work, are subject to this License. This License applies
45
+ separately for each version of the Licensed Work and the Change Date may vary
46
+ for each version of the Licensed Work released by Licensor.
47
+
48
+ You must conspicuously display this License on each original or modified copy
49
+ of the Licensed Work. If you receive a copy of the Licensed Work in
50
+ combination with other programs, as part of a larger work, or packaged by a
51
+ third party, and you receive the Licensed Work under a different license from
52
+ the one described in this License, you are required to comply with the license
53
+ applicable to you.
54
+
55
+ Any use of the Licensed Work in violation of this License will automatically
56
+ terminate your rights under this License for the current and all other
57
+ versions of the Licensed Work.
58
+
59
+ This License does not grant you any right in any trademark or logo of
60
+ Licensor or its affiliates (provided that you may use a trademark or logo of
61
+ Licensor as expressly required by this License).
62
+
63
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
64
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
65
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
66
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
67
+ TITLE.
68
+
69
+ MariaDB hereby grants you permission to use this License's text to license
70
+ your works, and to refer to it using the trademark "Business Source License",
71
+ as long as you comply with the Covenants of Licensor below.
72
+
73
+ Covenants of Licensor
74
+
75
+ In consideration of the right to use this License's text and the "Business
76
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
77
+ other recipients of the licensed work to be provided under this License:
78
+
79
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
80
+ or a license that is compatible with GPL Version 2.0 or a later version,
81
+ where "compatible" means that software provided under the Change License can
82
+ be included in a program with software provided under GPL Version 2.0 or a
83
+ later version. Licensor may specify additional Change Licenses without
84
+ limitation.
85
+
86
+ 2. To either: (a) specify an additional grant of rights to use that does not
87
+ impose any additional restriction on the right granted in this License, as
88
+ the Additional Use Grant; or (b) insert the text "None".
89
+
90
+ 3. To specify a Change Date.
91
+
92
+ 4. Not to modify this License in any other way.
@@ -0,0 +1,366 @@
1
+ Metadata-Version: 2.1
2
+ Name: loredocs
3
+ Version: 0.1.0
4
+ Summary: Knowledge management MCP server for AI projects - search, tag, version, and organize your project knowledge
5
+ Author: Labyrinth Analytics Consulting
6
+ License: Business Source License 1.1
7
+
8
+ Parameters
9
+
10
+ Licensor: Labyrinth Analytics Consulting
11
+ Licensed Work: LoreDocs v0.1.0
12
+ The Licensed Work is (c) 2026 Labyrinth Analytics Consulting
13
+ Additional Use Grant: You may make personal, non-commercial use of the Licensed Work,
14
+ subject to the following limitation: you may create no more than
15
+ 3 vaults in total. Any use that exceeds this limit, or any
16
+ commercial use, requires a paid license from the Licensor.
17
+ Change Date: 2030-03-31
18
+ Change License: Apache License, Version 2.0
19
+
20
+ For information about alternative licensing arrangements for the Licensed Work,
21
+ please contact: info@labyrinthanalyticsconsulting.com
22
+
23
+ ---
24
+
25
+ Business Source License 1.1
26
+
27
+ License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
28
+ "Business Source License" is a trademark of MariaDB Corporation Ab.
29
+
30
+ Terms
31
+
32
+ The Licensor hereby grants you the right to copy, modify, create derivative
33
+ works, redistribute, and make non-production use of the Licensed Work. The
34
+ Licensor may make an Additional Use Grant, above, permitting limited production
35
+ use.
36
+
37
+ Effective on the Change Date, or the fourth anniversary of the first publicly
38
+ available distribution of a specific version of the Licensed Work under this
39
+ License, whichever comes first, the Licensor hereby grants you rights under
40
+ the terms of the Change License, and the rights granted in the paragraph
41
+ above terminate.
42
+
43
+ If your use of the Licensed Work does not comply with the requirements
44
+ currently in effect as described in this License, you must purchase a
45
+ commercial license from the Licensor, its affiliated entities, or authorized
46
+ resellers, or you must refrain from using the Licensed Work.
47
+
48
+ All copies of the original and modified Licensed Work, and derivative works
49
+ of the Licensed Work, are subject to this License. This License applies
50
+ separately for each version of the Licensed Work and the Change Date may vary
51
+ for each version of the Licensed Work released by Licensor.
52
+
53
+ You must conspicuously display this License on each original or modified copy
54
+ of the Licensed Work. If you receive a copy of the Licensed Work in
55
+ combination with other programs, as part of a larger work, or packaged by a
56
+ third party, and you receive the Licensed Work under a different license from
57
+ the one described in this License, you are required to comply with the license
58
+ applicable to you.
59
+
60
+ Any use of the Licensed Work in violation of this License will automatically
61
+ terminate your rights under this License for the current and all other
62
+ versions of the Licensed Work.
63
+
64
+ This License does not grant you any right in any trademark or logo of
65
+ Licensor or its affiliates (provided that you may use a trademark or logo of
66
+ Licensor as expressly required by this License).
67
+
68
+ TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
69
+ AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
70
+ EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
71
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
72
+ TITLE.
73
+
74
+ MariaDB hereby grants you permission to use this License's text to license
75
+ your works, and to refer to it using the trademark "Business Source License",
76
+ as long as you comply with the Covenants of Licensor below.
77
+
78
+ Covenants of Licensor
79
+
80
+ In consideration of the right to use this License's text and the "Business
81
+ Source License" name and trademark, Licensor covenants to MariaDB, and to all
82
+ other recipients of the licensed work to be provided under this License:
83
+
84
+ 1. To specify as the Change License the GPL Version 2.0 or any later version,
85
+ or a license that is compatible with GPL Version 2.0 or a later version,
86
+ where "compatible" means that software provided under the Change License can
87
+ be included in a program with software provided under GPL Version 2.0 or a
88
+ later version. Licensor may specify additional Change Licenses without
89
+ limitation.
90
+
91
+ 2. To either: (a) specify an additional grant of rights to use that does not
92
+ impose any additional restriction on the right granted in this License, as
93
+ the Additional Use Grant; or (b) insert the text "None".
94
+
95
+ 3. To specify a Change Date.
96
+
97
+ 4. Not to modify this License in any other way.
98
+
99
+ Keywords: mcp,claude,knowledge-management,ai-tools
100
+ Classifier: Development Status :: 3 - Alpha
101
+ Classifier: Intended Audience :: Developers
102
+ Classifier: License :: Other/Proprietary License
103
+ Classifier: Programming Language :: Python :: 3
104
+ Classifier: Programming Language :: Python :: 3.10
105
+ Classifier: Programming Language :: Python :: 3.11
106
+ Classifier: Programming Language :: Python :: 3.12
107
+ Classifier: Topic :: Software Development :: Libraries
108
+ Requires-Python: >=3.10
109
+ Description-Content-Type: text/markdown
110
+ License-File: LICENSE
111
+ Requires-Dist: mcp[cli]>=1.0.0
112
+ Requires-Dist: pydantic>=2.0.0
113
+ Requires-Dist: pdfplumber>=0.10.0
114
+ Requires-Dist: python-docx>=1.0.0
115
+ Requires-Dist: openpyxl>=3.1.0
116
+ Requires-Dist: python-pptx>=0.6.21
117
+ Requires-Dist: cryptography>=41.0.0
118
+ Provides-Extra: dev
119
+ Requires-Dist: pytest>=7.0; extra == "dev"
120
+ Requires-Dist: pytest-asyncio>=0.21; extra == "dev"
121
+
122
+ # LoreDocs
123
+
124
+ Your AI project's knowledge base. Organized, searchable, version-tracked.
125
+
126
+ LoreDocs gives Claude persistent access to your project documentation -- specs, guides, architecture decisions, reference docs -- so it never loses context between sessions. Works with Claude Code and Cowork.
127
+
128
+ ## Quick Start
129
+
130
+ **Prerequisites:** [uv](https://docs.astral.sh/uv/getting-started/installation/) (fast Python package manager).
131
+
132
+ ```bash
133
+ # Install uv (one time)
134
+ curl -LsSf https://astral.sh/uv/install.sh | sh
135
+
136
+ # Clone and install
137
+ cd /path/to/loredocs
138
+ uv sync
139
+ ```
140
+
141
+ For detailed installation instructions (including Cowork plugin setup), see [INSTALL.md](INSTALL.md).
142
+
143
+ ## Using LoreDocs
144
+
145
+ ### Claude Code (Terminal)
146
+
147
+ ```bash
148
+ claude --plugin-dir /path/to/loredocs
149
+ ```
150
+
151
+ Or inside an existing session:
152
+
153
+ ```
154
+ /plugin add /path/to/loredocs
155
+ ```
156
+
157
+ Once loaded, Claude has access to all 35 LoreDocs MCP tools automatically. Ask Claude to "create a vault for this project" or "find the architecture doc" and it uses the tools on its own.
158
+
159
+ ### Cowork (Desktop App)
160
+
161
+ 1. Click **+** next to the prompt box
162
+ 2. Select **Plugins** > **Add plugin**
163
+ 3. Browse to the `loredocs` source folder
164
+
165
+ **Shared Database Access:** Cowork runs in a sandboxed VM. To access docs saved from Claude Code, ask Claude:
166
+
167
+ > "Mount my ~/.loredocs folder"
168
+
169
+ ## How It Works
170
+
171
+ LoreDocs organizes knowledge into **vaults** -- named containers for related documents. Each vault can hold specs, guides, decisions, checklists, or any text you want Claude to remember.
172
+
173
+ ```
174
+ ~/.loredocs/loredocs.db <-- SQLite database (metadata, search index)
175
+ ~/.loredocs/vaults/<vault-id>/ <-- Document files on disk
176
+ ```
177
+
178
+ **Key concepts:**
179
+
180
+ - **Vaults** group related docs by project or topic
181
+ - **Documents** are text files with metadata (tags, categories, priority, notes)
182
+ - **Version history** tracks every change to every document
183
+ - **Full-text search** via SQLite FTS5 finds anything instantly
184
+ - **Injection** loads vault content into Claude's context on demand
185
+
186
+ ## Verify Installation
187
+
188
+ After installing, verify LoreDocs is working by asking Claude:
189
+
190
+ > "Run `vault_list` and show me the results."
191
+
192
+ If you see a list of vaults (or an empty list if this is your first time), LoreDocs is connected. If you get an error about missing tools, re-run `uv sync` and reload the plugin.
193
+
194
+ ## Recommended CLAUDE.md Setup
195
+
196
+ For the best experience, add the following snippet to your `~/.claude/CLAUDE.md` (global) or your project's `CLAUDE.md`. This tells Claude how to use LoreDocs consistently across sessions.
197
+
198
+ ```markdown
199
+ ## LoreDocs (persistent project knowledge)
200
+
201
+ At session start:
202
+ 1. Call `vault_list` to see available knowledge vaults.
203
+ 2. Call `vault_inject_summary` for any vaults relevant to the current project.
204
+ 3. Use this context to understand project architecture, decisions, and reference docs.
205
+
206
+ During the session:
207
+ - If you create significant documentation, add it to LoreDocs with `vault_add_doc`.
208
+ - Tag documents for easy cross-vault discovery with `vault_tag_doc`.
209
+
210
+ At session end:
211
+ - If new docs were created or updated, ensure they are stored in LoreDocs for future sessions.
212
+ ```
213
+
214
+ **For Cowork users:** Cowork does not run hooks automatically. Add instructions to call `vault_list` and `vault_inject_summary` at session start in your project CLAUDE.md.
215
+
216
+ ## Features
217
+
218
+ - **Vault organization**: Group docs by project with linked project metadata
219
+ - **Document versioning**: Full history with rollback to any prior version
220
+ - **Tagging and categorization**: Tag docs for cross-vault discovery
221
+ - **Priority levels**: Mark docs as critical, high, normal, or low priority
222
+ - **Full-text search**: Fast keyword search across all vaults and documents
223
+ - **Context injection**: Load specific docs, tags, or vault summaries into Claude's context
224
+ - **Bulk operations**: Import directories, bulk-tag, export manifests
225
+ - **Document linking**: Connect related docs across vaults
226
+ - **Tier management**: Free/Pro/Team tiers with configurable limits
227
+ - **Local-first**: SQLite database, no cloud dependency, zero API costs
228
+
229
+ ## MCP Tools
230
+
231
+ LoreDocs provides 35 MCP tools organized by function:
232
+
233
+ ### Vault Management (6 tools)
234
+ | Tool | What it does |
235
+ |------|-------------|
236
+ | `vault_create` | Create a new vault with name and description |
237
+ | `vault_list` | List all vaults with doc counts and sizes |
238
+ | `vault_info` | Get detailed vault information |
239
+ | `vault_archive` | Archive a vault (preserves data, hides from listing) |
240
+ | `vault_delete` | Permanently delete a vault and all its documents |
241
+ | `vault_link_project` | Link a vault to a project directory |
242
+
243
+ ### Document Operations (9 tools)
244
+ | Tool | What it does |
245
+ |------|-------------|
246
+ | `vault_add_doc` | Add a new document to a vault |
247
+ | `vault_update_doc` | Update document content (creates version history) |
248
+ | `vault_remove_doc` | Remove a document from a vault |
249
+ | `vault_get_doc` | Retrieve a document with full content |
250
+ | `vault_list_docs` | List documents in a vault with filtering and sorting |
251
+ | `vault_copy_doc` | Copy a document to another vault |
252
+ | `vault_move_doc` | Move a document to another vault |
253
+ | `vault_doc_history` | View version history of a document |
254
+ | `vault_doc_restore` | Restore a document to a previous version |
255
+
256
+ ### Search and Discovery (4 tools)
257
+ | Tool | What it does |
258
+ |------|-------------|
259
+ | `vault_search` | Full-text search across all vaults |
260
+ | `vault_search_by_tag` | Find documents by tag across all vaults |
261
+ | `vault_find_related` | Discover documents related to a given doc |
262
+ | `vault_suggest` | Proactive suggestions for relevant docs to load |
263
+
264
+ ### Organization (5 tools)
265
+ | Tool | What it does |
266
+ |------|-------------|
267
+ | `vault_tag_doc` | Add tags to a document |
268
+ | `vault_bulk_tag` | Tag multiple documents at once |
269
+ | `vault_categorize` | Set document category (spec, guide, decision, etc.) |
270
+ | `vault_set_priority` | Set document priority level |
271
+ | `vault_add_note` | Add a note or annotation to a document |
272
+
273
+ ### Context Injection (3 tools)
274
+ | Tool | What it does |
275
+ |------|-------------|
276
+ | `vault_inject` | Load specific documents into Claude's context |
277
+ | `vault_inject_by_tag` | Load all documents matching a tag |
278
+ | `vault_inject_summary` | Load a vault summary with doc titles and descriptions |
279
+
280
+ ### Import/Export (3 tools)
281
+ | Tool | What it does |
282
+ |------|-------------|
283
+ | `vault_import_dir` | Import a directory of files into a vault |
284
+ | `vault_export` | Export a document to a file on disk |
285
+ | `vault_export_manifest` | Export vault metadata as a JSON manifest |
286
+
287
+ ### Document Links (2 tools)
288
+ | Tool | What it does |
289
+ |------|-------------|
290
+ | `vault_link_doc` | Create a link between two documents |
291
+ | `vault_unlink_doc` | Remove a link between documents |
292
+
293
+ ### Administration (3 tools)
294
+ | Tool | What it does |
295
+ |------|-------------|
296
+ | `vault_tier_status` | Check current tier limits and usage |
297
+ | `vault_set_tier` | Set the active tier (free, pro, team) |
298
+ | `get_license_tier` | Check current tier and license key status |
299
+
300
+ ## Works With LoreConvo
301
+
302
+ LoreDocs is the knowledge base; [LoreConvo](https://github.com/labyrinth-analytics/loreconvo) is the session memory. Together they give Claude both long-term documentation and conversation history:
303
+
304
+ - **LoreConvo** remembers what you discussed, decided, and left open
305
+ - **LoreDocs** stores the reference docs, specs, and guides Claude needs
306
+
307
+ Both use local SQLite databases and work across Claude Code and Cowork.
308
+
309
+ ## Requirements
310
+
311
+ - Python 3.10+
312
+ - macOS or Linux
313
+ - [uv](https://docs.astral.sh/uv/getting-started/installation/) package manager
314
+ - `mcp` and `pydantic` (auto-installed by `uv sync`)
315
+
316
+ ## Data Storage
317
+
318
+ Documents and metadata are stored locally in SQLite at `~/.loredocs/loredocs.db`. Document files live in `~/.loredocs/vaults/`. Override the database path with the `LOREDOCS_DB` environment variable.
319
+
320
+ ## Troubleshooting
321
+
322
+ **MCP tools not showing up in Claude Code?**
323
+ Make sure you ran `uv sync` first. The virtual environment must exist with dependencies installed.
324
+
325
+ **"No module named 'mcp'" error?**
326
+ The `.mcp.json` points to the virtual environment's Python. If you moved the folder, re-run `uv sync`.
327
+
328
+ **Cowork can't see docs saved in Code?**
329
+ Ask Claude to "mount my ~/.loredocs folder" so Cowork can access the shared database.
330
+
331
+ ## Fallback Script (Direct DB Access)
332
+
333
+ If the MCP server is unreachable (e.g., in scheduled tasks or automation scripts), `scripts/query_loredocs.py` provides the same core operations directly against the SQLite database.
334
+
335
+ ```bash
336
+ # List all vaults
337
+ python scripts/query_loredocs.py --list
338
+
339
+ # Show vault details and document manifest
340
+ python scripts/query_loredocs.py --info "My Project Docs"
341
+
342
+ # Search documents across all vaults
343
+ python scripts/query_loredocs.py --search "architecture"
344
+
345
+ # Add a document to a vault
346
+ python scripts/query_loredocs.py --add-doc \
347
+ --vault "My Project Docs" \
348
+ --name "Architecture Overview" \
349
+ --file docs/architecture.md \
350
+ --tags '["architecture", "design"]'
351
+
352
+ # Add a document from stdin
353
+ echo "# Quick Note" | python scripts/query_loredocs.py --add-doc \
354
+ --vault "My Project Docs" \
355
+ --name "Quick Note" \
356
+ --stdin
357
+ ```
358
+
359
+ The script auto-discovers the database at `~/.loredocs/loredocs.db` (or pass `--db-path` explicitly). It writes the same schema as the MCP tools, including FTS indexing and on-disk file storage.
360
+
361
+ ## License
362
+
363
+ Business Source License 1.1 (BSL 1.1) - Labyrinth Analytics Consulting
364
+
365
+ Free for personal/non-commercial use (up to 3 vaults). Commercial use requires
366
+ a paid license. Converts to Apache 2.0 on 2030-03-31. See [LICENSE](LICENSE) for details.