basic-memory 0.9.0__py3-none-any.whl → 0.10.1__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.

@@ -1,736 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: basic-memory
3
- Version: 0.9.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
- # Basic Memory
36
-
37
- [![License: AGPL v3](https://img.shields.io/badge/License-AGPL_v3-blue.svg)](https://www.gnu.org/licenses/agpl-3.0)
38
- [![PyPI version](https://badge.fury.io/py/basic-memory.svg)](https://badge.fury.io/py/basic-memory)
39
- [![Python 3.12+](https://img.shields.io/badge/python-3.12+-blue.svg)](https://www.python.org/downloads/)
40
- [![Tests](https://github.com/basicmachines-co/basic-memory/workflows/Tests/badge.svg)](https://github.com/basicmachines-co/basic-memory/actions)
41
- [![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)
42
-
43
- ```
44
- ██████╗ █████╗ ███████╗██╗ ██████╗ ███╗ ███╗███████╗███╗ ███╗ ██████╗ ██████╗ ██╗ ██╗
45
- ██╔══██╗██╔══██╗██╔════╝██║██╔════╝ ████╗ ████║██╔════╝████╗ ████║██╔═══██╗██╔══██╗╚██╗ ██╔╝
46
- ██████╔╝███████║███████╗██║██║ ██╔████╔██║█████╗ ██╔████╔██║██║ ██║██████╔╝ ╚████╔╝
47
- ██╔══██╗██╔══██║╚════██║██║██║ ██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║██╔══██╗ ╚██╔╝
48
- ██████╔╝██║ ██║███████║██║╚██████╗ ██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝██║ ██║ ██║
49
- ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
50
-
51
- ```
52
-
53
- Basic Memory lets you build persistent knowledge through natural conversations with Large Language Models (LLMs) like
54
- Claude, while keeping everything in simple Markdown files on your computer. It uses the Model Context Protocol (MCP) to
55
- enable any compatible LLM to read and write to your local knowledge base.
56
-
57
- LLMs can build context from local knowledge bases.
58
-
59
- ![Example Gif](docs/attachments/Obsidian-CoffeeKnowledgeBase-examples-overlays.gif)
60
-
61
- Basic Memory provides persistent contextual awareness across sessions through a structured knowledge graph.
62
- The system enables LLMs to access and reference prior conversations, track semantic relationships between concepts, and
63
- incorporate human edits made directly to knowledge files.
64
-
65
- ## Quick Start
66
-
67
- ```bash
68
- # Install with uv (recommended)
69
- uv install basic-memory
70
-
71
- # Configure Claude Desktop (edit ~/Library/Application Support/Claude/claude_desktop_config.json)
72
- # Add this to your config:
73
- {
74
- "mcpServers": {
75
- "basic-memory": {
76
- "command": "uvx",
77
- "args": [
78
- "basic-memory",
79
- "mcp"
80
- ]
81
- }
82
- }
83
- }
84
- # Now in Claude Desktop, you can:
85
- # - Write notes with "Create a note about coffee brewing methods"
86
- # - Read notes with "What do I know about pour over coffee?"
87
- # - Search with "Find information about Ethiopian beans"
88
-
89
- ```
90
-
91
- You can view shared context via files in `~/basic-memory` (default directory location).
92
-
93
- You can also install the cli tools to sync files or manage projects.
94
-
95
- ```bash
96
- uv tool install basic-memory
97
-
98
- # create a new project in a different directory
99
- basic-memory project add coffee ./examples/coffee
100
-
101
- # you can set the project to the default
102
- basic-memory project default coffee
103
- ```
104
-
105
- View available projects
106
-
107
- ```bash
108
- basic-memory project list
109
- Basic Memory Projects
110
- ┏━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━┳━━━━━━━━┓
111
- ┃ Name ┃ Path ┃ Default ┃ Active ┃
112
- ┡━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━╇━━━━━━━━┩
113
- │ main │ ~/basic-memory │ ✓ │ ✓ │
114
- │ coffee │ ~/dev/basicmachines/basic-memory/examples/coffee │ │ │
115
- └────────┴──────────────────────────────────────────────────┴─────────┴────────┘
116
- ```
117
-
118
- Basic Memory will write notes in Markdown format. Open you project directory in your text editor to view project files
119
- while you have conversations with an LLM.
120
-
121
- ## Why Basic Memory?
122
-
123
- Most LLM interactions are ephemeral - you ask a question, get an answer, and everything is forgotten. Each conversation
124
- starts fresh, without the context or knowledge from previous ones. Current workarounds have limitations:
125
-
126
- - Chat histories capture conversations but aren't structured knowledge
127
- - RAG systems can query documents but don't let LLMs write back
128
- - Vector databases require complex setups and often live in the cloud
129
- - Knowledge graphs typically need specialized tools to maintain
130
-
131
- Basic Memory addresses these problems with a simple approach: structured Markdown files that both humans and LLMs can
132
- read
133
- and write to. The key advantages:
134
-
135
- - **Local-first:** All knowledge stays in files you control
136
- - **Bi-directional:** Both you and the LLM read and write to the same files
137
- - **Structured yet simple:** Uses familiar Markdown with semantic patterns
138
- - **Traversable knowledge graph:** LLMs can follow links between topics
139
- - **Standard formats:** Works with existing editors like Obsidian
140
- - **Lightweight infrastructure:** Just local files indexed in a local SQLite database
141
-
142
- With Basic Memory, you can:
143
-
144
- - Have conversations that build on previous knowledge
145
- - Create structured notes during natural conversations
146
- - Have conversations with LLMs that remember what you've discussed before
147
- - Navigate your knowledge graph semantically
148
- - Keep everything local and under your control
149
- - Use familiar tools like Obsidian to view and edit notes
150
- - Build a personal knowledge base that grows over time
151
-
152
- ## How It Works in Practice
153
-
154
- Let's say you're exploring coffee brewing methods and want to capture your knowledge. Here's how it works:
155
-
156
- 1. Start by chatting normally:
157
-
158
- ```
159
- I've been experimenting with different coffee brewing methods. Key things I've learned:
160
-
161
- - Pour over gives more clarity in flavor than French press
162
- - Water temperature is critical - around 205°F seems best
163
- - Freshly ground beans make a huge difference
164
- ```
165
-
166
- ... continue conversation.
167
-
168
- 2. Ask the LLM to help structure this knowledge:
169
-
170
- ```
171
- "Let's write a note about coffee brewing methods."
172
- ```
173
-
174
- LLM creates a new Markdown file on your system (which you can see instantly in Obsidian or your editor):
175
-
176
- ```markdown
177
- ---
178
- title: Coffee Brewing Methods
179
- permalink: coffee-brewing-methods
180
- tags:
181
- - coffee
182
- - brewing
183
- ---
184
-
185
- # Coffee Brewing Methods
186
-
187
- ## Observations
188
-
189
- - [method] Pour over provides more clarity and highlights subtle flavors
190
- - [technique] Water temperature at 205°F (96°C) extracts optimal compounds
191
- - [principle] Freshly ground beans preserve aromatics and flavor
192
-
193
- ## Relations
194
-
195
- - relates_to [[Coffee Bean Origins]]
196
- - requires [[Proper Grinding Technique]]
197
- - affects [[Flavor Extraction]]
198
- ```
199
-
200
- The note embeds semantic content and links to other topics via simple Markdown
201
- formatting.
202
-
203
- 3. You see this file on your computer in real time in the `~/$HOME/basic-memory` directory:
204
-
205
- ```markdown
206
- ---
207
- title: Coffee Brewing Methods
208
- permalink: coffee-brewing-methods
209
- type: note
210
- ---
211
-
212
- # Coffee Brewing Methods
213
-
214
- ## Observations
215
-
216
- - [method] Pour over provides more clarity and highlights subtle flavors
217
- - [technique] Water temperature at 205°F (96°C) extracts optimal compounds
218
- - [principle] Freshly ground beans preserve aromatics and flavor
219
- - [preference] Medium-light roasts work best for pour over # Added by you
220
-
221
- ## Relations
222
-
223
- - relates_to [[Coffee Bean Origins]]
224
- - requires [[Proper Grinding Technique]]
225
- - affects [[Flavor Extraction]]
226
- - pairs_with [[Breakfast Pastries]] # Added by you
227
- ```
228
-
229
- 4. In a new chat with the LLM, you can reference this knowledge:
230
-
231
- ```
232
- Look at `coffee-brewing-methods` for context about pour over coffee
233
- ```
234
-
235
- The LLM can now build rich context from the knowledge graph. For example:
236
-
237
- ```
238
- Following relation 'relates_to [[Coffee Bean Origins]]':
239
- - Found information about Ethiopian Yirgacheffe
240
- - Notes on Colombian beans' nutty profile
241
- - Altitude effects on bean characteristics
242
-
243
- Following relation 'requires [[Proper Grinding Technique]]':
244
- - Burr vs. blade grinder comparisons
245
- - Grind size recommendations for different methods
246
- - Impact of consistent particle size on extraction
247
- ```
248
-
249
- Each related document can lead to more context, building a rich semantic understanding of your knowledge base. All of
250
- this context comes from standard Markdown files that both humans and LLMs can read and write.
251
-
252
- Every time the LLM writes notes,they are saved in local Markdown files that you can:
253
-
254
- - Edit in any text editor
255
- - Version via git
256
- - Back up normally
257
- - Share when you want to
258
-
259
- ## Technical Implementation
260
-
261
- Under the hood, Basic Memory:
262
-
263
- 1. Stores everything in Markdown files
264
- 2. Uses a SQLite database for searching and indexing
265
- 3. Extracts semantic meaning from simple Markdown patterns
266
- - Files become `Entity` objects
267
- - Each `Entity` can have `Observations`, or facts associated with it
268
- - `Relations` connect entities together to form the knowledge graph
269
- 4. Maintains the local knowledge graph derived from the files
270
- 5. Provides bidirectional synchronization between files and the knowledge graph
271
- 6. Implements the Model Context Protocol (MCP) for AI integration
272
- 7. Exposes tools that let AI assistants traverse and manipulate the knowledge graph
273
- 8. Uses memory:// URLs to reference entities across tools and conversations
274
-
275
- The file format is just Markdown with some simple markup:
276
-
277
- Each Markdown file has:
278
-
279
- ### Frontmatter
280
-
281
- ```markdown
282
- title: <Entity title>
283
- type: <The type of Entity> (e.g. note)
284
- permalink: <a uri slug>
285
-
286
- - <optional metadata> (such as tags)
287
- ```
288
-
289
- ### Observations
290
-
291
- Observations are facts about a topic.
292
- They can be added by creating a Markdown list with a special format that can reference a `category`, `tags` using a
293
- "#" charactor, and an optional `context`.
294
-
295
- Observation Markdown format:
296
-
297
- ```markdown
298
- - [category] content #tag (optional context)
299
- ```
300
-
301
- Examples of observations:
302
-
303
- ```markdown
304
- - [method] Pour over extracts more floral notes than French press
305
- - [tip] Grind size should be medium-fine for pour over #brewing
306
- - [preference] Ethiopian beans have bright, fruity flavors (especially from Yirgacheffe)
307
- - [fact] Lighter roasts generally contain more caffeine than dark roasts
308
- - [experiment] Tried 1:15 coffee-to-water ratio with good results
309
- - [resource] James Hoffman's V60 technique on YouTube is excellent
310
- - [question] Does water temperature affect extraction of different compounds differently?
311
- - [note] My favorite local shop uses a 30-second bloom time
312
- ```
313
-
314
- ### Relations
315
-
316
- Relations are links to other topics. They define how entities connect in the knowledge graph.
317
-
318
- Markdown format:
319
-
320
- ```markdown
321
- - relation_type [[WikiLink]] (optional context)
322
- ```
323
-
324
- Examples of relations:
325
-
326
- ```markdown
327
- - pairs_well_with [[Chocolate Desserts]]
328
- - grown_in [[Ethiopia]]
329
- - contrasts_with [[Tea Brewing Methods]]
330
- - requires [[Burr Grinder]]
331
- - improves_with [[Fresh Beans]]
332
- - relates_to [[Morning Routine]]
333
- - inspired_by [[Japanese Coffee Culture]]
334
- - documented_in [[Coffee Journal]]
335
- ```
336
-
337
- ### Complete Example
338
-
339
- Here's a complete example of a note with frontmatter, observations, and relations:
340
-
341
- ```markdown
342
- ---
343
- title: Pour Over Coffee Method
344
- type: note
345
- permalink: pour-over-coffee-method
346
- tags:
347
- - brewing
348
- - coffee
349
- - techniques
350
- ---
351
-
352
- # Pour Over Coffee Method
353
-
354
- This note documents the pour over brewing method and my experiences with it.
355
-
356
- ## Overview
357
-
358
- The pour over method involves pouring hot water through coffee grounds in a filter. The water drains through the coffee
359
- and filter into a carafe or cup.
360
-
361
- ## Observations
362
-
363
- - [equipment] Hario V60 dripper produces clean, bright cup #gear
364
- - [technique] Pour in concentric circles to ensure even extraction
365
- - [ratio] 1:16 coffee-to-water ratio works best for balanced flavor
366
- - [timing] Total brew time should be 2:30-3:00 minutes for medium roast
367
- - [temperature] Water at 205°F (96°C) extracts optimal flavor compounds
368
- - [grind] Medium-fine grind similar to table salt texture
369
- - [tip] 30-45 second bloom with double the coffee weight in water
370
- - [result] Produces a cleaner cup with more distinct flavor notes than immersion methods
371
-
372
- ## Relations
373
-
374
- - complements [[Light Roast Beans]]
375
- - requires [[Gooseneck Kettle]]
376
- - contrasts_with [[French Press Method]]
377
- - pairs_with [[Breakfast Pastries]]
378
- - documented_in [[Brewing Journal]]
379
- - inspired_by [[Japanese Brewing Techniques]]
380
- - affects [[Flavor Extraction]]
381
- - part_of [[Morning Ritual]]
382
- ```
383
-
384
- Basic Memory will parse the Markdown and derive the semantic relationships in the content. When you run
385
- `basic-memory sync`:
386
-
387
- 1. New and changed files are detected
388
- 2. Markdown patterns become semantic knowledge:
389
-
390
- - `[tech]` becomes a categorized observation
391
- - `[[WikiLink]]` creates a relation in the knowledge graph
392
- - Tags and metadata are indexed for search
393
-
394
- 3. A SQLite database maintains these relationships for fast querying
395
- 4. MCP-compatible LLMs can access this knowledge via memory:// URLs
396
-
397
- This creates a two-way flow where:
398
-
399
- - Humans write and edit Markdown files
400
- - LLMs read and write through the MCP protocol
401
- - Sync keeps everything consistent
402
- - All knowledge stays in local files.
403
-
404
- ## Using with Claude Desktop
405
-
406
- Basic Memory is built using the MCP (Model Context Protocol) and works with the Claude desktop app (https://claude.ai/):
407
-
408
- 1. Configure Claude Desktop to use Basic Memory:
409
-
410
- Edit your MCP configuration file (usually located at `~/Library/Application Support/Claude/claude_desktop_config.json`
411
- for OS X):
412
-
413
- ```json
414
- {
415
- "mcpServers": {
416
- "basic-memory": {
417
- "command": "uvx",
418
- "args": [
419
- "basic-memory",
420
- "mcp"
421
- ]
422
- }
423
- }
424
- }
425
- ```
426
-
427
- If you want to use a specific project (see [Multiple Projects](#multiple-projects) below), update your Claude Desktop
428
- config:
429
-
430
- ```json
431
- {
432
- "mcpServers": {
433
- "basic-memory": {
434
- "command": "uvx",
435
- "args": [
436
- "basic-memory",
437
- "mcp",
438
- "--project",
439
- "your-project-name"
440
- ]
441
- }
442
- }
443
- }
444
- ```
445
-
446
- 2. Sync your knowledge:
447
-
448
- ```bash
449
- # One-time sync of local knowledge updates
450
- basic-memory sync
451
-
452
- # Run realtime sync process (recommended)
453
- basic-memory sync --watch
454
- ```
455
-
456
- 3. In Claude Desktop, the LLM can now use these tools:
457
-
458
- ```
459
- write_note(title, content, folder, tags) - Create or update notes
460
- read_note(identifier, page, page_size) - Read notes by title or permalink
461
- build_context(url, depth, timeframe) - Navigate knowledge graph via memory:// URLs
462
- search(query, page, page_size) - Search across your knowledge base
463
- recent_activity(type, depth, timeframe) - Find recently updated information
464
- canvas(nodes, edges, title, folder) - Generate knowledge visualizations
465
- ```
466
-
467
- 5. Example prompts to try:
468
-
469
- ```
470
- "Create a note about our project architecture decisions"
471
- "Find information about JWT authentication in my notes"
472
- "Create a canvas visualization of my project components"
473
- "Read my notes on the authentication system"
474
- "What have I been working on in the past week?"
475
- ```
476
-
477
- ## Multiple Projects
478
-
479
- Basic Memory supports managing multiple separate knowledge bases through projects. This feature allows you to maintain
480
- separate knowledge graphs for different purposes (e.g., personal notes, work projects, research topics).
481
-
482
- ### Managing Projects
483
-
484
- ```bash
485
- # List all configured projects
486
- basic-memory project list
487
-
488
- # Add a new project
489
- basic-memory project add work ~/work-basic-memory
490
-
491
- # Set the default project
492
- basic-memory project default work
493
-
494
- # Remove a project (doesn't delete files)
495
- basic-memory project remove personal
496
-
497
- # Show current project
498
- basic-memory project current
499
- ```
500
-
501
- ### Using Projects in Commands
502
-
503
- All commands support the `--project` flag to specify which project to use:
504
-
505
- ```bash
506
- # Sync a specific project
507
- basic-memory --project=work sync
508
-
509
- # Run MCP server for a specific project
510
- basic-memory --project=personal mcp
511
- ```
512
-
513
- You can also set the `BASIC_MEMORY_PROJECT` environment variable:
514
-
515
- ```bash
516
- BASIC_MEMORY_PROJECT=work basic-memory sync
517
- ```
518
-
519
- ### Project Isolation
520
-
521
- Each project maintains:
522
-
523
- - Its own collection of markdown files in the specified directory
524
- - A separate SQLite database for that project
525
- - Complete knowledge graph isolation from other projects
526
-
527
- ## Design Philosophy
528
-
529
- Basic Memory is built on some key ideas:
530
-
531
- - Your knowledge should stay in files you control
532
- - Both humans and AI should use natural formats
533
- - Simple text patterns can capture rich meaning
534
- - Local-first doesn't mean feature-poor
535
- - Knowledge should persist across conversations
536
- - AI assistants should build on past context
537
- - File formats should be human-readable and editable
538
- - Semantic structure should emerge from natural patterns
539
- - Knowledge graphs should be both AI and human navigable
540
- - Systems should augment human memory, not replace it
541
-
542
- ## Importing Existing Data
543
-
544
- Basic Memory provides CLI commands to import data from various sources, converting them into the structured Markdown
545
- format:
546
-
547
- ### Claude.ai
548
-
549
- First, request an export of your data from your Claude account. The data will be emailed to you in several files,
550
- including
551
- `conversations.json` and `projects.json`.
552
-
553
- Import Claude.ai conversation data
554
-
555
- ```bash
556
- basic-memory import claude conversations
557
- ```
558
-
559
- The conversations will be turned into Markdown files and placed in the "conversations" folder by default (this can be
560
- changed with the --folder arg).
561
-
562
- Example:
563
-
564
- ```bash
565
- Importing chats from conversations.json...writing to .../basic-memory
566
- Reading chat data... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
567
- ╭────────────────────────────╮
568
- │ Import complete! │
569
- │ │
570
- │ Imported 307 conversations │
571
- │ Containing 7769 messages │
572
- ╰────────────────────────────╯
573
- ```
574
-
575
- Next, you can run the `sync` command to import the data into basic-memory
576
-
577
- ```bash
578
- basic-memory sync
579
- ```
580
-
581
- You can also import project data from Claude.ai
582
-
583
- ```bash
584
- ➜ basic-memory import claude projects
585
- Importing projects from projects.json...writing to .../basic-memory/projects
586
- Reading project data... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
587
- ╭────────────────────────────────╮
588
- │ Import complete! │
589
- │ │
590
- │ Imported 101 project documents │
591
- │ Imported 32 prompt templates │
592
- ╰────────────────────────────────╯
593
-
594
- Run 'basic-memory sync' to index the new files.
595
- ```
596
-
597
- ### OpenAI ChatGPT
598
-
599
- ```bash
600
- ➜ basic-memory import chatgpt
601
- Importing chats from conversations.json...writing to .../basic-memory/conversations
602
-
603
- Reading chat data... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
604
- ╭────────────────────────────╮
605
- │ Import complete! │
606
- │ │
607
- │ Imported 198 conversations │
608
- │ Containing 11777 messages │
609
- ╰────────────────────────────╯
610
-
611
-
612
- ```
613
-
614
- ### Knowledge Graph Memory Server
615
-
616
- From the MCP Server: https://github.com/modelcontextprotocol/servers/tree/main/src/memory
617
-
618
- ```bash
619
- ➜ basic-memory import memory-json
620
- Importing from memory.json...writing to .../basic-memory
621
- Reading memory.json... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
622
- Creating entities... ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100%
623
- ╭──────────────────────╮
624
- │ Import complete! │
625
- │ │
626
- │ Created 126 entities │
627
- │ Added 252 relations │
628
- ╰──────────────────────╯
629
- ```
630
-
631
- ## Working with Your Knowledge Base
632
-
633
- Once you've built up a knowledge base, you can interact with it in several ways:
634
-
635
- ### Command Line Interface
636
-
637
- Basic Memory provides a powerful CLI for managing your knowledge:
638
-
639
- ```bash
640
- # See all available commands
641
- basic-memory --help
642
-
643
- # Check the status of your knowledge sync
644
- basic-memory status
645
-
646
- # Access specific tool functionality directly
647
- basic-memory tools
648
-
649
- # Start a continuous sync process
650
- basic-memory sync --watch
651
- ```
652
-
653
- ### Obsidian Integration
654
-
655
- Basic Memory works seamlessly with [Obsidian](https://obsidian.md/), a popular knowledge management app:
656
-
657
- 1. Point Obsidian to your Basic Memory directory
658
- 2. Use standard Obsidian features like backlinks and graph view
659
- 3. See your knowledge graph visually
660
- 4. Use the canvas visualization generated by Basic Memory
661
-
662
- ### File Organization
663
-
664
- Basic Memory is flexible about how you organize your files:
665
-
666
- - Group by topic in folders
667
- - Use a flat structure with descriptive filenames
668
- - Add custom metadata in frontmatter
669
- - Tag files for better searchability
670
-
671
- The system will build the semantic knowledge graph regardless of your file organization preference.
672
-
673
- ## Using stdin with Basic Memory's `write_note` Tool
674
-
675
- The `write-note` tool supports reading content from standard input (stdin), allowing for more flexible workflows when
676
- creating or updating notes in your Basic Memory knowledge base.
677
-
678
- ### Use Cases
679
-
680
- This feature is particularly useful for:
681
-
682
- 1. **Piping output from other commands** directly into Basic Memory notes
683
- 2. **Creating notes with multi-line content** without having to escape quotes or special characters
684
- 3. **Integrating with AI assistants** like Claude Code that can generate content and pipe it to Basic Memory
685
- 4. **Processing text data** from files or other sources
686
-
687
- ## Basic Usage
688
-
689
- ### Method 1: Using a Pipe
690
-
691
- You can pipe content from another command into `write_note`:
692
-
693
- ```bash
694
- # Pipe output of a command into a new note
695
- echo "# My Note\n\nThis is a test note" | basic-memory tools write-note --title "Test Note" --folder "notes"
696
-
697
- # Pipe output of a file into a new note
698
- cat README.md | basic-memory tools write-note --title "Project README" --folder "documentation"
699
-
700
- # Process text through other tools before saving as a note
701
- cat data.txt | grep "important" | basic-memory tools write-note --title "Important Data" --folder "data"
702
- ```
703
-
704
- ### Method 2: Using Heredoc Syntax
705
-
706
- For multi-line content, you can use heredoc syntax:
707
-
708
- ```bash
709
- # Create a note with heredoc
710
- cat << EOF | basic-memory tools write_note --title "Project Ideas" --folder "projects"
711
- # Project Ideas for Q2
712
-
713
- ## AI Integration
714
- - Improve recommendation engine
715
- - Add semantic search to product catalog
716
-
717
- ## Infrastructure
718
- - Migrate to Kubernetes
719
- - Implement CI/CD pipeline
720
- EOF
721
- ```
722
-
723
- ### Method 3: Input Redirection
724
-
725
- You can redirect input from a file:
726
-
727
- ```bash
728
- # Create a note from file content
729
- basic-memory tools write-note --title "Meeting Notes" --folder "meetings" < meeting_notes.md
730
- ```
731
-
732
- ## License
733
-
734
- AGPL-3.0
735
-
736
- Built with ♥️ by Basic Machines