Skip to content

Commit e6496df

Browse files
authored
feat: Beta work (#17)
feat: Add multiple projects support feat: enhanced read_note for when initial result is not found fix: merge frontmatter when updating note fix: handle directory removed on sync watch
1 parent 41868fd commit e6496df

60 files changed

Lines changed: 3525 additions & 1242 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/dco.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

README.md

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
██╔══██╗██╔══██║╚════██║██║██║ ██║╚██╔╝██║██╔══╝ ██║╚██╔╝██║██║ ██║██╔══██╗ ╚██╔╝
1414
██████╔╝██║ ██║███████║██║╚██████╗ ██║ ╚═╝ ██║███████╗██║ ╚═╝ ██║╚██████╔╝██║ ██║ ██║
1515
╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝
16+
1617
```
1718

1819
Basic Memory lets you build persistent knowledge through natural conversations with Large Language Models (LLMs) like
@@ -355,6 +356,25 @@ for OS X):
355356
}
356357
```
357358

359+
If you want to use a specific project (see [Multiple Projects](#multiple-projects) below), update your Claude Desktop
360+
config:
361+
362+
```json
363+
{
364+
"mcpServers": {
365+
"basic-memory": {
366+
"command": "uvx",
367+
"args": [
368+
"basic-memory",
369+
"mcp",
370+
"--project",
371+
"your-project-name"
372+
]
373+
}
374+
}
375+
}
376+
```
377+
358378
2. Sync your knowledge:
359379

360380
```bash
@@ -386,6 +406,56 @@ canvas(nodes, edges, title, folder) - Generate knowledge visualizations
386406
"What have I been working on in the past week?"
387407
```
388408

409+
## Multiple Projects
410+
411+
Basic Memory supports managing multiple separate knowledge bases through projects. This feature allows you to maintain
412+
separate knowledge graphs for different purposes (e.g., personal notes, work projects, research topics).
413+
414+
### Managing Projects
415+
416+
```bash
417+
# List all configured projects
418+
basic-memory project list
419+
420+
# Add a new project
421+
basic-memory project add work ~/work-basic-memory
422+
423+
# Set the default project
424+
basic-memory project default work
425+
426+
# Remove a project (doesn't delete files)
427+
basic-memory project remove personal
428+
429+
# Show current project
430+
basic-memory project current
431+
```
432+
433+
### Using Projects in Commands
434+
435+
All commands support the `--project` flag to specify which project to use:
436+
437+
```bash
438+
# Sync a specific project
439+
basic-memory --project=work sync
440+
441+
# Run MCP server for a specific project
442+
basic-memory --project=personal mcp
443+
```
444+
445+
You can also set the `BASIC_MEMORY_PROJECT` environment variable:
446+
447+
```bash
448+
BASIC_MEMORY_PROJECT=work basic-memory sync
449+
```
450+
451+
### Project Isolation
452+
453+
Each project maintains:
454+
455+
- Its own collection of markdown files in the specified directory
456+
- A separate SQLite database for that project
457+
- Complete knowledge graph isolation from other projects
458+
389459
## Design Philosophy
390460

391461
Basic Memory is built on some key ideas:
@@ -532,6 +602,65 @@ Basic Memory is flexible about how you organize your files:
532602

533603
The system will build the semantic knowledge graph regardless of your file organization preference.
534604

605+
## Using stdin with Basic Memory's `write_note` Tool
606+
607+
The `write-note` tool supports reading content from standard input (stdin), allowing for more flexible workflows when
608+
creating or updating notes in your Basic Memory knowledge base.
609+
610+
### Use Cases
611+
612+
This feature is particularly useful for:
613+
614+
1. **Piping output from other commands** directly into Basic Memory notes
615+
2. **Creating notes with multi-line content** without having to escape quotes or special characters
616+
3. **Integrating with AI assistants** like Claude Code that can generate content and pipe it to Basic Memory
617+
4. **Processing text data** from files or other sources
618+
619+
## Basic Usage
620+
621+
### Method 1: Using a Pipe
622+
623+
You can pipe content from another command into `write_note`:
624+
625+
```bash
626+
# Pipe output of a command into a new note
627+
echo "# My Note\n\nThis is a test note" | basic-memory tools write-note --title "Test Note" --folder "notes"
628+
629+
# Pipe output of a file into a new note
630+
cat README.md | basic-memory tools write-note --title "Project README" --folder "documentation"
631+
632+
# Process text through other tools before saving as a note
633+
cat data.txt | grep "important" | basic-memory tools write-note --title "Important Data" --folder "data"
634+
```
635+
636+
### Method 2: Using Heredoc Syntax
637+
638+
For multi-line content, you can use heredoc syntax:
639+
640+
```bash
641+
# Create a note with heredoc
642+
cat << EOF | basic-memory tools write_note --title "Project Ideas" --folder "projects"
643+
# Project Ideas for Q2
644+
645+
## AI Integration
646+
- Improve recommendation engine
647+
- Add semantic search to product catalog
648+
649+
## Infrastructure
650+
- Migrate to Kubernetes
651+
- Implement CI/CD pipeline
652+
EOF
653+
```
654+
655+
### Method 3: Input Redirection
656+
657+
You can redirect input from a file:
658+
659+
```bash
660+
# Create a note from file content
661+
basic-memory tools write-note --title "Meeting Notes" --folder "meetings" < meeting_notes.md
662+
```
663+
535664
## License
536665

537666
AGPL-3.0

0 commit comments

Comments
 (0)