basic-memory 0.8.0__py3-none-any.whl → 0.10.0__py3-none-any.whl

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.

Potentially problematic release.


This version of basic-memory might be problematic. Click here for more details.

Files changed (76) hide show
  1. basic_memory/__init__.py +1 -1
  2. basic_memory/alembic/migrations.py +4 -9
  3. basic_memory/alembic/versions/cc7172b46608_update_search_index_schema.py +106 -0
  4. basic_memory/api/app.py +9 -6
  5. basic_memory/api/routers/__init__.py +2 -1
  6. basic_memory/api/routers/knowledge_router.py +30 -4
  7. basic_memory/api/routers/memory_router.py +3 -2
  8. basic_memory/api/routers/project_info_router.py +274 -0
  9. basic_memory/api/routers/search_router.py +22 -4
  10. basic_memory/cli/app.py +54 -3
  11. basic_memory/cli/commands/__init__.py +15 -2
  12. basic_memory/cli/commands/db.py +9 -13
  13. basic_memory/cli/commands/import_chatgpt.py +31 -36
  14. basic_memory/cli/commands/import_claude_conversations.py +32 -35
  15. basic_memory/cli/commands/import_claude_projects.py +34 -37
  16. basic_memory/cli/commands/import_memory_json.py +26 -28
  17. basic_memory/cli/commands/mcp.py +7 -1
  18. basic_memory/cli/commands/project.py +119 -0
  19. basic_memory/cli/commands/project_info.py +167 -0
  20. basic_memory/cli/commands/status.py +7 -9
  21. basic_memory/cli/commands/sync.py +54 -9
  22. basic_memory/cli/commands/{tools.py → tool.py} +92 -19
  23. basic_memory/cli/main.py +40 -1
  24. basic_memory/config.py +157 -10
  25. basic_memory/db.py +19 -4
  26. basic_memory/deps.py +10 -3
  27. basic_memory/file_utils.py +34 -18
  28. basic_memory/markdown/markdown_processor.py +1 -1
  29. basic_memory/markdown/utils.py +5 -0
  30. basic_memory/mcp/main.py +1 -2
  31. basic_memory/mcp/prompts/__init__.py +6 -2
  32. basic_memory/mcp/prompts/ai_assistant_guide.py +9 -10
  33. basic_memory/mcp/prompts/continue_conversation.py +65 -126
  34. basic_memory/mcp/prompts/recent_activity.py +55 -13
  35. basic_memory/mcp/prompts/search.py +72 -17
  36. basic_memory/mcp/prompts/utils.py +139 -82
  37. basic_memory/mcp/server.py +1 -1
  38. basic_memory/mcp/tools/__init__.py +11 -22
  39. basic_memory/mcp/tools/build_context.py +85 -0
  40. basic_memory/mcp/tools/canvas.py +17 -19
  41. basic_memory/mcp/tools/delete_note.py +28 -0
  42. basic_memory/mcp/tools/project_info.py +51 -0
  43. basic_memory/mcp/tools/{resource.py → read_content.py} +42 -5
  44. basic_memory/mcp/tools/read_note.py +190 -0
  45. basic_memory/mcp/tools/recent_activity.py +100 -0
  46. basic_memory/mcp/tools/search.py +56 -17
  47. basic_memory/mcp/tools/utils.py +245 -17
  48. basic_memory/mcp/tools/write_note.py +124 -0
  49. basic_memory/models/search.py +2 -1
  50. basic_memory/repository/entity_repository.py +3 -2
  51. basic_memory/repository/project_info_repository.py +9 -0
  52. basic_memory/repository/repository.py +23 -6
  53. basic_memory/repository/search_repository.py +33 -10
  54. basic_memory/schemas/__init__.py +12 -0
  55. basic_memory/schemas/memory.py +3 -2
  56. basic_memory/schemas/project_info.py +96 -0
  57. basic_memory/schemas/search.py +27 -32
  58. basic_memory/services/context_service.py +3 -3
  59. basic_memory/services/entity_service.py +8 -2
  60. basic_memory/services/file_service.py +107 -57
  61. basic_memory/services/link_resolver.py +5 -45
  62. basic_memory/services/search_service.py +45 -16
  63. basic_memory/sync/sync_service.py +274 -39
  64. basic_memory/sync/watch_service.py +174 -34
  65. basic_memory/utils.py +40 -40
  66. basic_memory-0.10.0.dist-info/METADATA +386 -0
  67. basic_memory-0.10.0.dist-info/RECORD +99 -0
  68. basic_memory/mcp/prompts/json_canvas_spec.py +0 -25
  69. basic_memory/mcp/tools/knowledge.py +0 -68
  70. basic_memory/mcp/tools/memory.py +0 -177
  71. basic_memory/mcp/tools/notes.py +0 -201
  72. basic_memory-0.8.0.dist-info/METADATA +0 -379
  73. basic_memory-0.8.0.dist-info/RECORD +0 -91
  74. {basic_memory-0.8.0.dist-info → basic_memory-0.10.0.dist-info}/WHEEL +0 -0
  75. {basic_memory-0.8.0.dist-info → basic_memory-0.10.0.dist-info}/entry_points.txt +0 -0
  76. {basic_memory-0.8.0.dist-info → basic_memory-0.10.0.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,386 @@
1
+ Metadata-Version: 2.4
2
+ Name: basic-memory
3
+ Version: 0.10.0
4
+ Summary: Local-first knowledge management combining Zettelkasten with knowledge graphs
5
+ Project-URL: Homepage, https://github.com/basicmachines-co/basic-memory
6
+ Project-URL: Repository, https://github.com/basicmachines-co/basic-memory
7
+ Project-URL: Documentation, https://github.com/basicmachines-co/basic-memory#readme
8
+ Author-email: Basic Machines <hello@basic-machines.co>
9
+ License: AGPL-3.0-or-later
10
+ License-File: LICENSE
11
+ Requires-Python: >=3.12.1
12
+ Requires-Dist: aiosqlite>=0.20.0
13
+ Requires-Dist: alembic>=1.14.1
14
+ Requires-Dist: dateparser>=1.2.0
15
+ Requires-Dist: fastapi[standard]>=0.115.8
16
+ Requires-Dist: greenlet>=3.1.1
17
+ Requires-Dist: icecream>=2.1.3
18
+ Requires-Dist: loguru>=0.7.3
19
+ Requires-Dist: markdown-it-py>=3.0.0
20
+ Requires-Dist: mcp>=1.2.0
21
+ Requires-Dist: pillow>=11.1.0
22
+ Requires-Dist: pydantic-settings>=2.6.1
23
+ Requires-Dist: pydantic[email,timezone]>=2.10.3
24
+ Requires-Dist: pyright>=1.1.390
25
+ Requires-Dist: python-frontmatter>=1.1.0
26
+ Requires-Dist: pyyaml>=6.0.1
27
+ Requires-Dist: qasync>=0.27.1
28
+ Requires-Dist: rich>=13.9.4
29
+ Requires-Dist: sqlalchemy>=2.0.0
30
+ Requires-Dist: typer>=0.9.0
31
+ Requires-Dist: unidecode>=1.3.8
32
+ Requires-Dist: watchfiles>=1.0.4
33
+ Description-Content-Type: text/markdown
34
+
35
+ [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
36
+ [![PyPI version](https://badge.fury.io/py/basic-memory.svg)](https://badge.fury.io/py/basic-memory)
37
+ [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
38
+ [![Tests](https://github.com/basicmachines-co/basic-memory/workflows/Tests/badge.svg)](https://github.com/basicmachines-co/basic-memory/actions)
39
+ [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
40
+ [![smithery badge](https://smithery.ai/badge/@basicmachines-co/basic-memory)](https://smithery.ai/server/@basicmachines-co/basic-memory)
41
+
42
+ # Basic Memory
43
+
44
+ Basic Memory lets you build persistent knowledge through natural conversations with Large Language Models (LLMs) like
45
+ Claude, while keeping everything in simple Markdown files on your computer. It uses the Model Context Protocol (MCP) to
46
+ enable any compatible LLM to read and write to your local knowledge base.
47
+
48
+ - Website: http://basicmachines.co
49
+ - Documentation: http://memory.basicmachines.co
50
+
51
+ ## Pick up your conversation right where you left off
52
+
53
+ - AI assistants can load context from local files in a new conversation
54
+ - Notes are saved locally as Markdown files in real time
55
+ - No project knowledge or special prompting required
56
+
57
+ https://github.com/user-attachments/assets/a55d8238-8dd0-454a-be4c-8860dbbd0ddc
58
+
59
+ ## Quick Start
60
+
61
+ ```bash
62
+ # Install with uv (recommended)
63
+ uv tool install basic-memory
64
+
65
+ # Configure Claude Desktop (edit ~/Library/Application Support/Claude/claude_desktop_config.json)
66
+ # Add this to your config:
67
+ {
68
+ "mcpServers": {
69
+ "basic-memory": {
70
+ "command": "uvx",
71
+ "args": [
72
+ "basic-memory",
73
+ "mcp"
74
+ ]
75
+ }
76
+ }
77
+ }
78
+ # Now in Claude Desktop, you can:
79
+ # - Write notes with "Create a note about coffee brewing methods"
80
+ # - Read notes with "What do I know about pour over coffee?"
81
+ # - Search with "Find information about Ethiopian beans"
82
+
83
+ ```
84
+
85
+ You can view shared context via files in `~/basic-memory` (default directory location).
86
+
87
+ ### Alternative Installation via Smithery
88
+
89
+ You can use [Smithery](https://smithery.ai/server/@basicmachines-co/basic-memory) to automatically configure Basic
90
+ Memory for Claude Desktop:
91
+
92
+ ```bash
93
+ npx -y @smithery/cli install @basicmachines-co/basic-memory --client claude
94
+ ```
95
+
96
+ This installs and configures Basic Memory without requiring manual edits to the Claude Desktop configuration file. The
97
+ Smithery server hosts the MCP server component, while your data remains stored locally as Markdown files.
98
+
99
+ ### Glama.ai
100
+
101
+ <a href="https://glama.ai/mcp/servers/o90kttu9ym">
102
+ <img width="380" height="200" src="https://glama.ai/mcp/servers/o90kttu9ym/badge" alt="basic-memory MCP server" />
103
+ </a>
104
+
105
+ ## Why Basic Memory?
106
+
107
+ Most LLM interactions are ephemeral - you ask a question, get an answer, and everything is forgotten. Each conversation
108
+ starts fresh, without the context or knowledge from previous ones. Current workarounds have limitations:
109
+
110
+ - Chat histories capture conversations but aren't structured knowledge
111
+ - RAG systems can query documents but don't let LLMs write back
112
+ - Vector databases require complex setups and often live in the cloud
113
+ - Knowledge graphs typically need specialized tools to maintain
114
+
115
+ Basic Memory addresses these problems with a simple approach: structured Markdown files that both humans and LLMs can
116
+ read
117
+ and write to. The key advantages:
118
+
119
+ - **Local-first:** All knowledge stays in files you control
120
+ - **Bi-directional:** Both you and the LLM read and write to the same files
121
+ - **Structured yet simple:** Uses familiar Markdown with semantic patterns
122
+ - **Traversable knowledge graph:** LLMs can follow links between topics
123
+ - **Standard formats:** Works with existing editors like Obsidian
124
+ - **Lightweight infrastructure:** Just local files indexed in a local SQLite database
125
+
126
+ With Basic Memory, you can:
127
+
128
+ - Have conversations that build on previous knowledge
129
+ - Create structured notes during natural conversations
130
+ - Have conversations with LLMs that remember what you've discussed before
131
+ - Navigate your knowledge graph semantically
132
+ - Keep everything local and under your control
133
+ - Use familiar tools like Obsidian to view and edit notes
134
+ - Build a personal knowledge base that grows over time
135
+
136
+ ## How It Works in Practice
137
+
138
+ Let's say you're exploring coffee brewing methods and want to capture your knowledge. Here's how it works:
139
+
140
+ 1. Start by chatting normally:
141
+
142
+ ```
143
+ I've been experimenting with different coffee brewing methods. Key things I've learned:
144
+
145
+ - Pour over gives more clarity in flavor than French press
146
+ - Water temperature is critical - around 205°F seems best
147
+ - Freshly ground beans make a huge difference
148
+ ```
149
+
150
+ ... continue conversation.
151
+
152
+ 2. Ask the LLM to help structure this knowledge:
153
+
154
+ ```
155
+ "Let's write a note about coffee brewing methods."
156
+ ```
157
+
158
+ LLM creates a new Markdown file on your system (which you can see instantly in Obsidian or your editor):
159
+
160
+ ```markdown
161
+ ---
162
+ title: Coffee Brewing Methods
163
+ permalink: coffee-brewing-methods
164
+ tags:
165
+ - coffee
166
+ - brewing
167
+ ---
168
+
169
+ # Coffee Brewing Methods
170
+
171
+ ## Observations
172
+
173
+ - [method] Pour over provides more clarity and highlights subtle flavors
174
+ - [technique] Water temperature at 205°F (96°C) extracts optimal compounds
175
+ - [principle] Freshly ground beans preserve aromatics and flavor
176
+
177
+ ## Relations
178
+
179
+ - relates_to [[Coffee Bean Origins]]
180
+ - requires [[Proper Grinding Technique]]
181
+ - affects [[Flavor Extraction]]
182
+ ```
183
+
184
+ The note embeds semantic content and links to other topics via simple Markdown formatting.
185
+
186
+ 3. You see this file on your computer in real time in the current project directory (default `~/$HOME/basic-memory`).
187
+
188
+ - Realtime sync can be enabled via running `basic-memory sync --watch`
189
+
190
+ 4. In a chat with the LLM, you can reference a topic:
191
+
192
+ ```
193
+ Look at `coffee-brewing-methods` for context about pour over coffee
194
+ ```
195
+
196
+ The LLM can now build rich context from the knowledge graph. For example:
197
+
198
+ ```
199
+ Following relation 'relates_to [[Coffee Bean Origins]]':
200
+ - Found information about Ethiopian Yirgacheffe
201
+ - Notes on Colombian beans' nutty profile
202
+ - Altitude effects on bean characteristics
203
+
204
+ Following relation 'requires [[Proper Grinding Technique]]':
205
+ - Burr vs. blade grinder comparisons
206
+ - Grind size recommendations for different methods
207
+ - Impact of consistent particle size on extraction
208
+ ```
209
+
210
+ Each related document can lead to more context, building a rich semantic understanding of your knowledge base.
211
+
212
+ This creates a two-way flow where:
213
+
214
+ - Humans write and edit Markdown files
215
+ - LLMs read and write through the MCP protocol
216
+ - Sync keeps everything consistent
217
+ - All knowledge stays in local files.
218
+
219
+ ## Technical Implementation
220
+
221
+ Under the hood, Basic Memory:
222
+
223
+ 1. Stores everything in Markdown files
224
+ 2. Uses a SQLite database for searching and indexing
225
+ 3. Extracts semantic meaning from simple Markdown patterns
226
+ - Files become `Entity` objects
227
+ - Each `Entity` can have `Observations`, or facts associated with it
228
+ - `Relations` connect entities together to form the knowledge graph
229
+ 4. Maintains the local knowledge graph derived from the files
230
+ 5. Provides bidirectional synchronization between files and the knowledge graph
231
+ 6. Implements the Model Context Protocol (MCP) for AI integration
232
+ 7. Exposes tools that let AI assistants traverse and manipulate the knowledge graph
233
+ 8. Uses memory:// URLs to reference entities across tools and conversations
234
+
235
+ The file format is just Markdown with some simple markup:
236
+
237
+ Each Markdown file has:
238
+
239
+ ### Frontmatter
240
+
241
+ ```markdown
242
+ title: <Entity title>
243
+ type: <The type of Entity> (e.g. note)
244
+ permalink: <a uri slug>
245
+
246
+ - <optional metadata> (such as tags)
247
+ ```
248
+
249
+ ### Observations
250
+
251
+ Observations are facts about a topic.
252
+ They can be added by creating a Markdown list with a special format that can reference a `category`, `tags` using a
253
+ "#" character, and an optional `context`.
254
+
255
+ Observation Markdown format:
256
+
257
+ ```markdown
258
+ - [category] content #tag (optional context)
259
+ ```
260
+
261
+ Examples of observations:
262
+
263
+ ```markdown
264
+ - [method] Pour over extracts more floral notes than French press
265
+ - [tip] Grind size should be medium-fine for pour over #brewing
266
+ - [preference] Ethiopian beans have bright, fruity flavors (especially from Yirgacheffe)
267
+ - [fact] Lighter roasts generally contain more caffeine than dark roasts
268
+ - [experiment] Tried 1:15 coffee-to-water ratio with good results
269
+ - [resource] James Hoffman's V60 technique on YouTube is excellent
270
+ - [question] Does water temperature affect extraction of different compounds differently?
271
+ - [note] My favorite local shop uses a 30-second bloom time
272
+ ```
273
+
274
+ ### Relations
275
+
276
+ Relations are links to other topics. They define how entities connect in the knowledge graph.
277
+
278
+ Markdown format:
279
+
280
+ ```markdown
281
+ - relation_type [[WikiLink]] (optional context)
282
+ ```
283
+
284
+ Examples of relations:
285
+
286
+ ```markdown
287
+ - pairs_well_with [[Chocolate Desserts]]
288
+ - grown_in [[Ethiopia]]
289
+ - contrasts_with [[Tea Brewing Methods]]
290
+ - requires [[Burr Grinder]]
291
+ - improves_with [[Fresh Beans]]
292
+ - relates_to [[Morning Routine]]
293
+ - inspired_by [[Japanese Coffee Culture]]
294
+ - documented_in [[Coffee Journal]]
295
+ ```
296
+
297
+ ## Using with Claude Desktop
298
+
299
+ Basic Memory is built using the MCP (Model Context Protocol) and works with the Claude desktop app (https://claude.ai/):
300
+
301
+ 1. Configure Claude Desktop to use Basic Memory:
302
+
303
+ Edit your MCP configuration file (usually located at `~/Library/Application Support/Claude/claude_desktop_config.json`
304
+ for OS X):
305
+
306
+ ```json
307
+ {
308
+ "mcpServers": {
309
+ "basic-memory": {
310
+ "command": "uvx",
311
+ "args": [
312
+ "basic-memory",
313
+ "mcp"
314
+ ]
315
+ }
316
+ }
317
+ }
318
+ ```
319
+
320
+ If you want to use a specific project (see [Multiple Projects](#multiple-projects) below), update your Claude Desktop
321
+ config:
322
+
323
+ ```json
324
+ {
325
+ "mcpServers": {
326
+ "basic-memory": {
327
+ "command": "uvx",
328
+ "args": [
329
+ "basic-memory",
330
+ "mcp",
331
+ "--project",
332
+ "your-project-name"
333
+ ]
334
+ }
335
+ }
336
+ }
337
+ ```
338
+
339
+ 2. Sync your knowledge:
340
+
341
+ ```bash
342
+ # One-time sync of local knowledge updates
343
+ basic-memory sync
344
+
345
+ # Run realtime sync process (recommended)
346
+ basic-memory sync --watch
347
+ ```
348
+
349
+ 3. In Claude Desktop, the LLM can now use these tools:
350
+
351
+ ```
352
+ write_note(title, content, folder, tags) - Create or update notes
353
+ read_note(identifier, page, page_size) - Read notes by title or permalink
354
+ build_context(url, depth, timeframe) - Navigate knowledge graph via memory:// URLs
355
+ search(query, page, page_size) - Search across your knowledge base
356
+ recent_activity(type, depth, timeframe) - Find recently updated information
357
+ canvas(nodes, edges, title, folder) - Generate knowledge visualizations
358
+ ```
359
+
360
+ 5. Example prompts to try:
361
+
362
+ ```
363
+ "Create a note about our project architecture decisions"
364
+ "Find information about JWT authentication in my notes"
365
+ "Create a canvas visualization of my project components"
366
+ "Read my notes on the authentication system"
367
+ "What have I been working on in the past week?"
368
+ ```
369
+
370
+ ## Futher info
371
+
372
+ See the [Documentation](https://memory.basicmachines.co/) for more info, including:
373
+
374
+ - [Complete User Guide](https://memory.basicmachines.co/docs/user-guide)
375
+ - [CLI tools](https://memory.basicmachines.co/docs/cli-reference)
376
+ - [Managing multiple Projects](https://memory.basicmachines.co/docs/cli-reference#project)
377
+ - [Importing data from OpenAI/Claude Projects](https://memory.basicmachines.co/docs/cli-reference#import)
378
+
379
+ ## License
380
+
381
+ AGPL-3.0
382
+
383
+ Contributions are welcome. See the [Contributing](CONTRIBUTING.md) guide for info about setting up the project locally
384
+ and submitting PRs.
385
+
386
+ Built with ♥️ by Basic Machines
@@ -0,0 +1,99 @@
1
+ basic_memory/__init__.py,sha256=YT8crmOfNy-XKuzs53zmYlk7WGRbsDxeU_X1c_UEqAE,123
2
+ basic_memory/config.py,sha256=PHUrzwjJSHab691mzShz5uZ-uuJyXcznnXA8kjD-wJU,7659
3
+ basic_memory/db.py,sha256=UDWBr52u7oBT4aXputhAG_Prmsv5og00sYVzPmaylhk,6026
4
+ basic_memory/deps.py,sha256=yI6RL_5-8LXw7ywSJ_84BXAczDtv2h9GFLw-E9XDJFg,5770
5
+ basic_memory/file_utils.py,sha256=csvij8o_j14A-rr8NTDeH6pUaI4DdBqNAWJIVc5r4A0,6658
6
+ basic_memory/utils.py,sha256=EPumxT4HkprZG9BzWZnym3teOjn24Vm3lgncQADN5ew,3764
7
+ basic_memory/alembic/alembic.ini,sha256=IEZsnF8CbbZnkwBr67LzKKNobHuzTaQNUvM8Psop5xc,3733
8
+ basic_memory/alembic/env.py,sha256=GyQpEpQu84flqAdelxR0-H9nbkHrVoCboYGfmltBDoA,2737
9
+ basic_memory/alembic/migrations.py,sha256=lriHPXDdBLSNXEW3QTpU0SJKuVd1V-8NrVkpN3qfsUQ,718
10
+ basic_memory/alembic/script.py.mako,sha256=MEqL-2qATlST9TAOeYgscMn1uy6HUS9NFvDgl93dMj8,635
11
+ basic_memory/alembic/versions/3dae7c7b1564_initial_schema.py,sha256=lTbWlAnd1es7xU99DoJgfaRe1_Kte8TL98riqeKGV80,4363
12
+ basic_memory/alembic/versions/502b60eaa905_remove_required_from_entity_permalink.py,sha256=k6xYTmYPM9Ros-7CA7BwZBKYwoK_gmVdC-2n8FAjdoE,1840
13
+ basic_memory/alembic/versions/b3c3938bacdb_relation_to_name_unique_index.py,sha256=RsGymQzfRXV1LSNKiyi0lMilTxW1NgwS9jR67ye2apI,1428
14
+ basic_memory/alembic/versions/cc7172b46608_update_search_index_schema.py,sha256=Lbo3dEzdId_vKRFe3jMkGFF3dNQpblPIQa4Bh7np-zA,4020
15
+ basic_memory/api/__init__.py,sha256=wCpj-21j1D0KzKl9Ql6unLBVFY0K1uGp_FeSZRKtqpk,72
16
+ basic_memory/api/app.py,sha256=NLcNpfNzVz4pgtbjaZUHTvRCqay16J_G4K1ok9DMDCU,1516
17
+ basic_memory/api/routers/__init__.py,sha256=SKuL-weA58hYj0NOMCQRfmsaumlNjjyVHDXNpRO38bQ,305
18
+ basic_memory/api/routers/knowledge_router.py,sha256=iYuBguMb6ERitAwoelSejBYJqLTGfjpkzAHrqwTKjVE,5876
19
+ basic_memory/api/routers/memory_router.py,sha256=W_uHJe2c4XN96mFj6XNvUH6INVbl1BMxy0KUchLcbxU,5421
20
+ basic_memory/api/routers/project_info_router.py,sha256=Qv12_QL3SRpo7bPcpAjizJmkZEVm5h5tyjrf-qIiRl0,9030
21
+ basic_memory/api/routers/resource_router.py,sha256=WEJEqEaY_yTKj5-U-rW4kXQKUcJflykgwI6_g_R41ck,8058
22
+ basic_memory/api/routers/search_router.py,sha256=R_a5OF5_8rCjmoOMhmw3M4VLCy6I1KLGJ-otSLB0rbI,1953
23
+ basic_memory/cli/__init__.py,sha256=arcKLAWRDhPD7x5t80MlviZeYzwHZ0GZigyy3NKVoGk,33
24
+ basic_memory/cli/app.py,sha256=J4mkWnxbevOYmJwwRMx344olGOxoXq0o4RNG6DMQLKE,1804
25
+ basic_memory/cli/main.py,sha256=9uwxOUc4mDeTeZCEWyJh7X5PzPXG1fva2veV2OPbFtg,1442
26
+ basic_memory/cli/commands/__init__.py,sha256=aBihwtUFs0MpsxCed74A5fYoxFmJA4NOVXPRrVY4lnw,427
27
+ basic_memory/cli/commands/db.py,sha256=UL3JXGJrLzKZ-uRwgk6p0kbRznBy5x7keirvweVGNvY,754
28
+ basic_memory/cli/commands/import_chatgpt.py,sha256=M4_oUN9o_BaW5jpKQu2pTEybivB5ccVolhdZzmhLOsI,8162
29
+ basic_memory/cli/commands/import_claude_conversations.py,sha256=D_4-0xFKkZka7xFvvW8OkgjLv3TFqsC_VuB2Z-Y3avU,6827
30
+ basic_memory/cli/commands/import_claude_projects.py,sha256=KzUuf3wrlvJlqTWCzoLRrNxD3OYNteRXaTFj5IB1FA8,6649
31
+ basic_memory/cli/commands/import_memory_json.py,sha256=zqpU4eCzQXx04aRsigddJAyhvklmTgSAzeRTuEdNw0c,5194
32
+ basic_memory/cli/commands/mcp.py,sha256=ue_zDA8w0zZZToHLvu56s8hWkalgZsC64CfTyXX6z2I,715
33
+ basic_memory/cli/commands/project.py,sha256=vEPv34Grn8DGwP8Ig9xcFWeVW0cro_Qyfq2TU22pcQQ,4103
34
+ basic_memory/cli/commands/project_info.py,sha256=2XFe0eONsJ-FOmiOO6faYAS9AgX7Dmj4HNeTTrUr0ZE,7099
35
+ basic_memory/cli/commands/status.py,sha256=nbs3myxaNtehEEJ4BBngPuKs-vqZTHNCCb0bTgDsE-s,5277
36
+ basic_memory/cli/commands/sync.py,sha256=JxGJA6b7Qksz0ZKonHfB3s--7qzY7eWeLogPX8tR1pY,8351
37
+ basic_memory/cli/commands/tool.py,sha256=DjoB4slhmzfCjIgom1-xBP6sRl_gy7PrhGtQk3rNAqM,8855
38
+ basic_memory/markdown/__init__.py,sha256=DdzioCWtDnKaq05BHYLgL_78FawEHLpLXnp-kPSVfIc,501
39
+ basic_memory/markdown/entity_parser.py,sha256=LnjG_wg38LVN8JndsZJV2UVGPIaoIV5sGs94iQ9PL6k,3781
40
+ basic_memory/markdown/markdown_processor.py,sha256=S5ny69zu2dlqO7tWJoLrpLSzg8emQIDq7Du7olpJUsk,4968
41
+ basic_memory/markdown/plugins.py,sha256=gtIzKRjoZsyvBqLpVNnrmzl_cbTZ5ZGn8kcuXxQjRko,6639
42
+ basic_memory/markdown/schemas.py,sha256=mzVEDUhH98kwETMknjkKw5H697vg_zUapsJkJVi17ho,1894
43
+ basic_memory/markdown/utils.py,sha256=zlHlUtrnXaUCnsaPNJzR0wlhg2kB1YbXx0DMvs-snJM,2973
44
+ basic_memory/mcp/__init__.py,sha256=dsDOhKqjYeIbCULbHIxfcItTbqudEuEg1Np86eq0GEQ,35
45
+ basic_memory/mcp/async_client.py,sha256=Eo345wANiBRSM4u3j_Vd6Ax4YtMg7qbWd9PIoFfj61I,236
46
+ basic_memory/mcp/main.py,sha256=0kbcyf1PxRC1bLnHv2zzParfJ6cOq7Am9ScF9UoI50U,703
47
+ basic_memory/mcp/server.py,sha256=VGv0uWma6JGkT6Y_GESYGhGMYfPavkhEKlCNza8bvtY,287
48
+ basic_memory/mcp/prompts/__init__.py,sha256=-Bl9Dgj2TD9PULjzggPqXuvPEjWCRy7S9Yg03h2-U7A,615
49
+ basic_memory/mcp/prompts/ai_assistant_guide.py,sha256=rfp3xPmTsbSMlv_NI91BwGhYXtkn6T9ISvtEWru5kM8,855
50
+ basic_memory/mcp/prompts/continue_conversation.py,sha256=zb_3cOaO7NMFuStBkJDlMstQZqz1RCOYl6txwaHYM_Q,4424
51
+ basic_memory/mcp/prompts/recent_activity.py,sha256=7607MWiGJWY0vPurhVII17LxLZlXY_zmH3xH9LfT6SY,2793
52
+ basic_memory/mcp/prompts/search.py,sha256=nCz5wPxTszJLNQJ1CE7CIhnamy08EpGLQjoBMlXRRNc,6283
53
+ basic_memory/mcp/prompts/utils.py,sha256=u_bG8DMtMMERvGPJfA3gbl5VAs0xmkuK8ZJBkY8xyV8,5371
54
+ basic_memory/mcp/tools/__init__.py,sha256=mp8BiY-2YY5zzGBAIbf9hMCQM6uhDtst3eq1ApR2p2s,870
55
+ basic_memory/mcp/tools/build_context.py,sha256=8xYRPpeYCEU8F9Dv_ctvbunZ8ciKwmFu9i8Pdv5vYfI,2891
56
+ basic_memory/mcp/tools/canvas.py,sha256=fHC90eshnSSmROTBV-tBB-FSuXSpYVj_BcDrc96pWi0,2993
57
+ basic_memory/mcp/tools/delete_note.py,sha256=mnrgOv-D7f6nsgZIAK0Wvyn0dbkwCg8adW_xJd7jwc0,829
58
+ basic_memory/mcp/tools/project_info.py,sha256=pyoHpOMhjMIvZFku2iEIpXc2XDtbnNeb-OMrJlYR9LU,1710
59
+ basic_memory/mcp/tools/read_content.py,sha256=PKnvLzNmHfzoIxRKXNaYW5P5q0d1azVwG9juPXPYeQo,8148
60
+ basic_memory/mcp/tools/read_note.py,sha256=pM6FUxMdDxxCNxhnDrkrVqIJouIRPbUqSHsL3BVgiy8,6469
61
+ basic_memory/mcp/tools/recent_activity.py,sha256=S0LgIk9RaeYzIsi2FIHs0KK7R1K-LJy3QaSokGlY9ew,3501
62
+ basic_memory/mcp/tools/search.py,sha256=0PcLCpXe73X72jSudVLVMO8TQwEjnB6F1V9jCtjf2ZE,2999
63
+ basic_memory/mcp/tools/utils.py,sha256=tOWklfSlDcoAJCRBmxkCVwkTY_TDBa5vOGxzU8J5eiQ,13636
64
+ basic_memory/mcp/tools/write_note.py,sha256=CdUdFitmuDQl8z36IqrbSB0hSEdw20k_ZIXnpV_KDSc,4374
65
+ basic_memory/models/__init__.py,sha256=Bf0xXV_ryndogvZDiVM_Wb6iV2fHUxYNGMZNWNcZi0s,307
66
+ basic_memory/models/base.py,sha256=4hAXJ8CE1RnjKhb23lPd-QM7G_FXIdTowMJ9bRixspU,225
67
+ basic_memory/models/knowledge.py,sha256=lbKd8VOOVPqXtIhNMY30bIokoQutFjLpHwLD5At90MY,6644
68
+ basic_memory/models/search.py,sha256=YnF2YnP6NUFf7SSy9xvkY055MlfkBXJuxLoOhCTvB2Q,1244
69
+ basic_memory/repository/__init__.py,sha256=TnscLXARq2iOgQZFvQoT9X1Bn9SB_7s1xw2fOqRs3Jg,252
70
+ basic_memory/repository/entity_repository.py,sha256=VLKlQ97-_HhSqc-st_YToWUNE4pJIcKEOcGDxC25q1k,3575
71
+ basic_memory/repository/observation_repository.py,sha256=BOcy4wARqCXu-thYyt7mPxt2A2C8TW0le3s_X9wrK6I,1701
72
+ basic_memory/repository/project_info_repository.py,sha256=nHWzs0WBQ366WfzIYZgnAfU6tyQ_8slEszWNlDSeIlo,336
73
+ basic_memory/repository/relation_repository.py,sha256=DwpTcn9z_1sZQcyMOUABz1k1VSwo_AU63x2zR7aerTk,2933
74
+ basic_memory/repository/repository.py,sha256=cZFCjp7Q-fKwjEYe3ubG1rgYbPEQXsocAn9LgFNXCG0,12071
75
+ basic_memory/repository/search_repository.py,sha256=82NCjq06JUuUQXQ9k_D-h8BBlO5gl51XF9UdcY8gK8Q,11621
76
+ basic_memory/schemas/__init__.py,sha256=KHzF2lZhYXRsH2g6tV5Oivlk1EHFfrlbKuiRllqnBzs,1570
77
+ basic_memory/schemas/base.py,sha256=dwnaI5fJXsdp81mdH0ZpmJ-WICY-0M7ZPWeW5OUgBG8,5685
78
+ basic_memory/schemas/delete.py,sha256=UAR2JK99WMj3gP-yoGWlHD3eZEkvlTSRf8QoYIE-Wfw,1180
79
+ basic_memory/schemas/memory.py,sha256=qqQm89nZQKtrhquHlRnR6LaSWynPi4MgtcMcqvGH5zg,3136
80
+ basic_memory/schemas/project_info.py,sha256=qsZfafp8bn2oqCizX_CVwJZS4HE79kOmaNiNK9C_9_w,3380
81
+ basic_memory/schemas/request.py,sha256=58r9mPGc4Am9rR_zGzo-yqXcsrl5I6n3M5LjGK5gFFk,1626
82
+ basic_memory/schemas/response.py,sha256=lVYR31DTtSeFRddGWX_wQWnQgyiwX0LEpNJ4f4lKpTM,6440
83
+ basic_memory/schemas/search.py,sha256=mfPHo8lzZ8BMLzmID-0g_0pWHhBIBNIvy4c8KYHFuvQ,3655
84
+ basic_memory/services/__init__.py,sha256=oop6SKmzV4_NAYt9otGnupLGVCCKIVgxEcdRQWwh25I,197
85
+ basic_memory/services/context_service.py,sha256=fhJNHQoTEeIC9ZmZ49CXcNF2aVBghVnmo6LtdSDcAas,9708
86
+ basic_memory/services/entity_service.py,sha256=p4yP-VngdtfCqbvygQ968tGQVOJ1nFzN3XRyXenEcRM,12432
87
+ basic_memory/services/exceptions.py,sha256=VGlCLd4UD2w5NWKqC7QpG4jOM_hA7jKRRM-MqvEVMNk,288
88
+ basic_memory/services/file_service.py,sha256=7uLVkcFMFj20srdch8c6u9T6nO5X4wHgcXdL81pGV88,9935
89
+ basic_memory/services/link_resolver.py,sha256=yWqqKqJtGU_93xy25y6Us4xRTNijrBLz76Nvm_zFEOI,3326
90
+ basic_memory/services/search_service.py,sha256=t3d5jhABs5bXwtOu7_AvRCpVd8RRd2j6Gg59BAYZ0l8,10625
91
+ basic_memory/services/service.py,sha256=V-d_8gOV07zGIQDpL-Ksqs3ZN9l3qf3HZOK1f_YNTag,336
92
+ basic_memory/sync/__init__.py,sha256=CVHguYH457h2u2xoM8KvOilJC71XJlZ-qUh8lHcjYj4,156
93
+ basic_memory/sync/sync_service.py,sha256=YirSOgk0PyqPJoHXVUzAxhNKdd2pebP8sFeXeAYmGjM,21957
94
+ basic_memory/sync/watch_service.py,sha256=ZcpMfbNpMsKVjKJQ8BaF3CXKpTycOF9HddTsRlefVEQ,13467
95
+ basic_memory-0.10.0.dist-info/METADATA,sha256=g4VfqLtcp4NiydgNNfZYwQyJ4kL96jWv8_0GfHbjmEs,12850
96
+ basic_memory-0.10.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
97
+ basic_memory-0.10.0.dist-info/entry_points.txt,sha256=IDQa_VmVTzmvMrpnjhEfM0S3F--XsVGEj3MpdJfuo-Q,59
98
+ basic_memory-0.10.0.dist-info/licenses/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
99
+ basic_memory-0.10.0.dist-info/RECORD,,
@@ -1,25 +0,0 @@
1
- from pathlib import Path
2
-
3
- import logfire
4
- from loguru import logger
5
-
6
- from basic_memory.mcp.server import mcp
7
-
8
-
9
- @mcp.resource(
10
- uri="memory://json_canvas_spec",
11
- name="json_canvas_spec",
12
- description="JSON Canvas specification for visualizing knowledge graphs in Obsidian"
13
- )
14
- def json_canvas_spec() -> str:
15
- """Return the JSON Canvas specification for Obsidian visualizations.
16
-
17
- Returns:
18
- The JSON Canvas specification document.
19
- """
20
- with logfire.span("Getting JSON Canvas spec"): # pyright: ignore
21
- logger.info("Loading JSON Canvas spec resource")
22
- canvas_spec = Path(__file__).parent.parent.parent.parent.parent / "data/json_canvas_spec_1_0.md"
23
- content = canvas_spec.read_text()
24
- logger.info(f"Loaded JSON Canvas spec ({len(content)} chars)")
25
- return content
@@ -1,68 +0,0 @@
1
- """Knowledge graph management tools for Basic Memory MCP server."""
2
-
3
- import logfire
4
-
5
- from basic_memory.mcp.server import mcp
6
- from basic_memory.mcp.tools.utils import call_get, call_post
7
- from basic_memory.schemas.memory import memory_url_path
8
- from basic_memory.schemas.request import (
9
- GetEntitiesRequest,
10
- )
11
- from basic_memory.schemas.delete import (
12
- DeleteEntitiesRequest,
13
- )
14
- from basic_memory.schemas.response import EntityListResponse, EntityResponse, DeleteEntitiesResponse
15
- from basic_memory.mcp.async_client import client
16
-
17
-
18
- @mcp.tool(
19
- description="Get complete information about a specific entity including observations and relations",
20
- )
21
- async def get_entity(identifier: str) -> EntityResponse:
22
- """Get a specific entity info by its permalink.
23
-
24
- Args:
25
- identifier: Path identifier for the entity
26
- """
27
- with logfire.span("Getting entity", permalink=identifier): # pyright: ignore [reportGeneralTypeIssues]
28
- permalink = memory_url_path(identifier)
29
- url = f"/knowledge/entities/{permalink}"
30
- response = await call_get(client, url)
31
- return EntityResponse.model_validate(response.json())
32
-
33
-
34
- @mcp.tool(
35
- description="Load multiple entities by their permalinks in a single request",
36
- )
37
- async def get_entities(request: GetEntitiesRequest) -> EntityListResponse:
38
- """Load multiple entities by their permalinks.
39
-
40
- Args:
41
- request: OpenNodesRequest containing list of permalinks to load
42
-
43
- Returns:
44
- EntityListResponse containing complete details for each requested entity
45
- """
46
- with logfire.span("Getting multiple entities", permalink_count=len(request.permalinks)): # pyright: ignore [reportGeneralTypeIssues]
47
- url = "/knowledge/entities"
48
- response = await call_get(
49
- client,
50
- url,
51
- params=[
52
- ("permalink", memory_url_path(identifier)) for identifier in request.permalinks
53
- ],
54
- )
55
- return EntityListResponse.model_validate(response.json())
56
-
57
-
58
- @mcp.tool(
59
- description="Permanently delete entities and all related content (observations and relations)",
60
- )
61
- async def delete_entities(request: DeleteEntitiesRequest) -> DeleteEntitiesResponse:
62
- """Delete entities from the knowledge graph."""
63
- with logfire.span("Deleting entities", permalink_count=len(request.permalinks)): # pyright: ignore [reportGeneralTypeIssues]
64
- url = "/knowledge/entities/delete"
65
-
66
- request.permalinks = [memory_url_path(permlink) for permlink in request.permalinks]
67
- response = await call_post(client, url, json=request.model_dump())
68
- return DeleteEntitiesResponse.model_validate(response.json())