Skip to content

Commit a0c08de

Browse files
authored
Merge branch 'main' into main
2 parents b795b04 + 105bcaa commit a0c08de

81 files changed

Lines changed: 21831 additions & 631 deletions

File tree

Some content is hidden

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

.github/workflows/test.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,12 @@ on:
1414

1515
jobs:
1616
test:
17-
runs-on: ubuntu-latest
1817
strategy:
1918
fail-fast: false
2019
matrix:
20+
os: [ubuntu-latest, windows-latest]
2121
python-version: [ "3.12" ]
22+
runs-on: ${{ matrix.os }}
2223

2324
steps:
2425
- uses: actions/checkout@v4
@@ -35,10 +36,18 @@ jobs:
3536
run: |
3637
pip install uv
3738
38-
- name: Install just
39+
- name: Install just (Linux/macOS)
40+
if: runner.os != 'Windows'
3941
run: |
4042
curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | bash -s -- --to /usr/local/bin
4143
44+
- name: Install just (Windows)
45+
if: runner.os == 'Windows'
46+
run: |
47+
# Install just using Chocolatey (pre-installed on GitHub Actions Windows runners)
48+
choco install just --yes
49+
shell: pwsh
50+
4251
- name: Create virtual env
4352
run: |
4453
uv venv
@@ -54,4 +63,4 @@ jobs:
5463
- name: Run tests
5564
run: |
5665
uv pip install pytest pytest-cov
57-
just test
66+
just test

CLA.md

Lines changed: 63 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,71 @@
1-
Developer Certificate of Origin
2-
Version 1.1
3-
https://developercertificate.org/
1+
# Contributor License Agreement
42

5-
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
3+
## Copyright Assignment and License Grant
64

7-
Everyone is permitted to copy and distribute verbatim copies of this
8-
license document, but changing it is not allowed.
5+
By signing this Contributor License Agreement ("Agreement"), you accept and agree to the following terms and conditions
6+
for your present and future Contributions submitted
7+
to Basic Machines LLC. Except for the license granted herein to Basic Machines LLC and recipients of software
8+
distributed by Basic Machines LLC, you reserve all right,
9+
title, and interest in and to your Contributions.
910

10-
Developer's Certificate of Origin 1.1
11+
### 1. Definitions
1112

12-
By making a contribution to this project, I certify that:
13+
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this
14+
Agreement with Basic Machines LLC.
1315

14-
(a) The contribution was created in whole or in part by me and I
15-
have the right to submit it under the open source license
16-
indicated in the file; or
16+
"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work,
17+
that is intentionally submitted by You to Basic
18+
Machines LLC for inclusion in, or documentation of, any of the products owned or managed by Basic Machines LLC (the "
19+
Work").
1720

18-
(b) The contribution is based upon previous work that, to the best
19-
of my knowledge, is covered under an appropriate open source
20-
license and I have the right under that license to submit that
21-
work with modifications, whether created in whole or in part
22-
by me, under the same open source license (unless I am
23-
permitted to submit under a different license), as indicated
24-
in the file; or
21+
### 2. Grant of Copyright License
2522

26-
(c) The contribution was provided directly to me by some other
27-
person who certified (a), (b) or (c) and I have not modified
28-
it.
23+
Subject to the terms and conditions of this Agreement, You hereby grant to Basic Machines LLC and to recipients of
24+
software distributed by Basic Machines LLC a perpetual,
25+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to use, copy, modify, merge, publish,
26+
distribute, sublicense, and/or sell copies of the
27+
Work, and to permit persons to whom the Work is furnished to do so.
2928

30-
(d) I understand and agree that this project and the contribution
31-
are public and that a record of the contribution (including all
32-
personal information I submit with it, including my sign-off) is
33-
maintained indefinitely and may be redistributed consistent with
34-
this project or the open source license(s) involved.
29+
### 3. Assignment of Copyright
30+
31+
You hereby assign to Basic Machines LLC all right, title, and interest worldwide in all Copyright covering your
32+
Contributions. Basic Machines LLC may license the
33+
Contributions under any license terms, including copyleft, permissive, commercial, or proprietary licenses.
34+
35+
### 4. Grant of Patent License
36+
37+
Subject to the terms and conditions of this Agreement, You hereby grant to Basic Machines LLC and to recipients of
38+
software distributed by Basic Machines LLC a perpetual,
39+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to
40+
make, have made, use, offer to sell, sell, import, and
41+
otherwise transfer the Work.
42+
43+
### 5. Developer Certificate of Origin
44+
45+
By making a Contribution to this project, You certify that:
46+
47+
(a) The Contribution was created in whole or in part by You and You have the right to submit it under this Agreement; or
48+
49+
(b) The Contribution is based upon previous work that, to the best of Your knowledge, is covered under an appropriate
50+
open source license and You have the right under that
51+
license to submit that work with modifications, whether created in whole or in part by You, under this Agreement; or
52+
53+
(c) The Contribution was provided directly to You by some other person who certified (a), (b) or (c) and You have not
54+
modified it.
55+
56+
(d) You understand and agree that this project and the Contribution are public and that a record of the Contribution (
57+
including all personal information You submit with
58+
it, including Your sign-off) is maintained indefinitely and may be redistributed consistent with this project or the
59+
open source license(s) involved.
60+
61+
### 6. Representations
62+
63+
You represent that you are legally entitled to grant the above license and assignment. If your employer(s) has rights to
64+
intellectual property that you create that
65+
includes your Contributions, you represent that you have received permission to make Contributions on behalf of that
66+
employer, or that your employer has waived such rights
67+
for your Contributions to Basic Machines LLC.
68+
69+
---
70+
71+
This Agreement is effective as of the date you first submit a Contribution to Basic Machines LLC.

CLAUDE.md

Lines changed: 32 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ See the [README.md](README.md) file for a project overview.
1414

1515
### Build and Test Commands
1616

17-
- Install: `just install` or `pip install -e ".[dev]"`
18-
- Run tests: `uv run pytest -p pytest_mock -v` or `just test`
17+
- Install: `make install` or `pip install -e ".[dev]"`
18+
- Run tests: `uv run pytest -p pytest_mock -v` or `make test`
1919
- Single test: `pytest tests/path/to/test_file.py::test_function_name`
20-
- Lint: `just lint` or `ruff check . --fix`
21-
- Type check: `just type-check` or `uv run pyright`
22-
- Format: `just format` or `uv run ruff format .`
23-
- Run all code checks: `just check` (runs lint, format, type-check, test)
24-
- Create db migration: `just migration "Your migration message"`
25-
- Run development MCP Inspector: `just run-inspector`
20+
- Lint: `make lint` or `ruff check . --fix`
21+
- Type check: `make type-check` or `uv run pyright`
22+
- Format: `make format` or `uv run ruff format .`
23+
- Run all code checks: `make check` (runs lint, format, type-check, test)
24+
- Create db migration: `make migration m="Your migration message"`
25+
- Run development MCP Inspector: `make run-inspector`
2626

2727
### Code Style Guidelines
2828

@@ -37,7 +37,6 @@ See the [README.md](README.md) file for a project overview.
3737
- API uses FastAPI for endpoints
3838
- Follow the repository pattern for data access
3939
- Tools communicate to api routers via the httpx ASGI client (in process)
40-
- avoid using "private" functions in modules or classes (prepended with _)
4140

4241
### Codebase Architecture
4342

@@ -65,7 +64,6 @@ See the [README.md](README.md) file for a project overview.
6564
- Test database uses in-memory SQLite
6665
- Avoid creating mocks in tests in most circumstances.
6766
- Each test runs in a standalone environment with in memory SQLite and tmp_file directory
68-
- Do not use mocks in tests if possible. Tests run with an in memory sqlite db, so they are not needed. See fixtures in conftest.py
6967

7068
## BASIC MEMORY PRODUCT USAGE
7169

@@ -97,37 +95,26 @@ See the [README.md](README.md) file for a project overview.
9795

9896
**Content Management:**
9997
- `write_note(title, content, folder, tags)` - Create/update markdown notes with semantic observations and relations
100-
- `read_note(identifier, page, page_size)` - Read notes by title, permalink, or memory:// URL with knowledge graph awareness
101-
- `edit_note(identifier, operation, content)` - Edit notes incrementally (append, prepend, find/replace, section replace)
102-
- `move_note(identifier, destination_path)` - Move notes with database consistency and search reindexing
103-
- `view_note(identifier)` - Display notes as formatted artifacts for better readability in Claude Desktop
104-
- `read_content(path)` - Read raw file content (text, images, binaries) without knowledge graph processing
105-
- `delete_note(identifier)` - Delete notes from knowledge base
106-
107-
**Project Management:**
108-
- `list_memory_projects()` - List all available projects with status indicators
109-
- `switch_project(project_name)` - Switch to different project context during conversations
110-
- `get_current_project()` - Show currently active project with statistics
111-
- `create_memory_project(name, path, set_default)` - Create new Basic Memory projects
112-
- `delete_project(name)` - Delete projects from configuration and database
113-
- `set_default_project(name)` - Set default project in config
114-
- `sync_status()` - Check file synchronization status and background operations
98+
- `read_note(identifier, page, page_size)` - Read notes by title, permalink, or memory:// URL with knowledge graph
99+
awareness
100+
- `read_file(path)` - Read raw file content (text, images, binaries) without knowledge graph processing
115101

116102
**Knowledge Graph Navigation:**
117-
- `build_context(url, depth, timeframe)` - Navigate the knowledge graph via memory:// URLs for conversation continuity
118-
- `recent_activity(type, depth, timeframe)` - Get recently updated information with specified timeframe (e.g., "1d", "1 week")
119-
- `list_directory(dir_name, depth, file_name_glob)` - List directory contents with filtering and depth control
103+
- `build_context(url, depth, timeframe)` - Navigate the knowledge graph via memory:// URLs for conversation
104+
continuity
105+
- `recent_activity(type, depth, timeframe)` - Get recently updated information with specified timeframe (e.g., "
106+
1d", "1 week")
120107

121108
**Search & Discovery:**
122-
- `search_notes(query, page, page_size)` - Full-text search across all content with filtering options
109+
- `search(query, page, page_size)` - Full-text search across all content with filtering options
123110

124111
**Visualization:**
125112
- `canvas(nodes, edges, title, folder)` - Generate Obsidian canvas files for knowledge graph visualization
126113

127114
- MCP Prompts for better AI interaction:
128115
- `ai_assistant_guide()` - Guidance on effectively using Basic Memory tools for AI assistants
129116
- `continue_conversation(topic, timeframe)` - Continue previous conversations with relevant historical context
130-
- `search_notes(query, after_date)` - Search with detailed, formatted results for better context understanding
117+
- `search(query, after_date)` - Search with detailed, formatted results for better context understanding
131118
- `recent_activity(timeframe)` - View recently changed items with formatted output
132119
- `json_canvas_spec()` - Full JSON Canvas specification for Obsidian visualization
133120

@@ -147,32 +134,30 @@ could achieve independently.
147134

148135
## GitHub Integration
149136

150-
Basic Memory uses Claude directly into the development workflow through GitHub:
137+
Basic Memory has taken AI-Human collaboration to the next level by integrating Claude directly into the development workflow through GitHub:
151138

152139
### GitHub MCP Tools
153140

154-
Using the GitHub Model Context Protocol server, Claude can:
141+
Using the GitHub Model Context Protocol server, Claude can now:
155142

156143
- **Repository Management**:
157-
- View repository files and structure
158-
- Read file contents
159-
- Create new branches
160-
- Create and update files
144+
- View repository files and structure
145+
- Read file contents
146+
- Create new branches
147+
- Create and update files
161148

162149
- **Issue Management**:
163-
- Create new issues
164-
- Comment on existing issues
165-
- Close and update issues
166-
- Search across issues
150+
- Create new issues
151+
- Comment on existing issues
152+
- Close and update issues
153+
- Search across issues
167154

168155
- **Pull Request Workflow**:
169-
- Create pull requests
170-
- Review code changes
171-
- Add comments to PRs
156+
- Create pull requests
157+
- Review code changes
158+
- Add comments to PRs
172159

173-
This integration enables Claude to participate as a full team member in the development process, not just as a code
174-
generation tool. Claude's GitHub account ([bm-claudeai](https://github.com/bm-claudeai)) is a member of the Basic
175-
Machines organization with direct contributor access to the codebase.
160+
This integration enables Claude to participate as a full team member in the development process, not just as a code generation tool. Claude's GitHub account ([bm-claudeai](https://github.com/bm-claudeai)) is a member of the Basic Machines organization with direct contributor access to the codebase.
176161

177162
### Collaborative Development Process
178163

@@ -183,75 +168,4 @@ With GitHub integration, the development workflow includes:
183168
3. **Branch management** - Claude can create feature branches for implementations
184169
4. **Documentation maintenance** - Claude can keep documentation updated as the code evolves
185170

186-
With this integration, the AI assistant is a full-fledged team member rather than just a tool for generating code
187-
snippets.
188-
189-
190-
### Basic Memory Pro
191-
192-
Basic Memory Pro is a desktop GUI application that wraps the basic-memory CLI/MCP tools:
193-
194-
- Built with Tauri (Rust), React (TypeScript), and a Python FastAPI sidecar
195-
- Provides visual knowledge graph exploration and project management
196-
- Uses the same core codebase but adds a desktop-friendly interface
197-
- Project configuration is shared between CLI and Pro versions
198-
- Multiple project support with visual switching interface
199-
200-
local repo: /Users/phernandez/dev/basicmachines/basic-memory-pro
201-
github: https://github.com/basicmachines-co/basic-memory-pro
202-
203-
## Release and Version Management
204-
205-
Basic Memory uses `uv-dynamic-versioning` for automatic version management based on git tags:
206-
207-
### Version Types
208-
- **Development versions**: Automatically generated from commits (e.g., `0.12.4.dev26+468a22f`)
209-
- **Beta releases**: Created by tagging with beta suffixes (e.g., `v0.13.0b1`, `v0.13.0rc1`)
210-
- **Stable releases**: Created by tagging with version numbers (e.g., `v0.13.0`)
211-
212-
### Release Workflows
213-
214-
#### Development Builds (Automatic)
215-
- Triggered on every push to `main` branch
216-
- Publishes dev versions like `0.12.4.dev26+468a22f` to PyPI
217-
- Allows continuous testing of latest changes
218-
- Users install with: `pip install basic-memory --pre --force-reinstall`
219-
220-
#### Beta/RC Releases (Manual)
221-
- Create beta tag: `git tag v0.13.0b1 && git push origin v0.13.0b1`
222-
- Automatically builds and publishes to PyPI as pre-release
223-
- Users install with: `pip install basic-memory --pre`
224-
- Use for milestone testing before stable release
225-
226-
#### Stable Releases (Automated)
227-
- Use the automated release system: `just release v0.13.0`
228-
- Includes comprehensive quality checks (lint, format, type-check, tests)
229-
- Automatically updates version in `__init__.py`
230-
- Creates git tag and pushes to GitHub
231-
- Triggers GitHub Actions workflow for:
232-
- PyPI publication
233-
- Homebrew formula update (requires HOMEBREW_TOKEN secret)
234-
235-
**Manual method (legacy):**
236-
- Create version tag: `git tag v0.13.0 && git push origin v0.13.0`
237-
238-
#### Homebrew Formula Updates
239-
- Automatically triggered after successful PyPI release for **stable releases only**
240-
- **Stable releases** (e.g., v0.13.7) automatically update the main `basic-memory` formula
241-
- **Pre-releases** (dev/beta/rc) are NOT automatically updated - users must specify version manually
242-
- Updates formula in `basicmachines-co/homebrew-basic-memory` repo
243-
- Requires `HOMEBREW_TOKEN` secret in GitHub repository settings:
244-
- Create a fine-grained Personal Access Token with `Contents: Read and Write` and `Actions: Read` scopes on `basicmachines-co/homebrew-basic-memory`
245-
- Add as repository secret named `HOMEBREW_TOKEN` in `basicmachines-co/basic-memory`
246-
- Formula updates include new version URL and SHA256 checksum
247-
248-
### For Development
249-
- **Automated releases**: Use `just release v0.13.x` for stable releases and `just beta v0.13.0b1` for beta releases
250-
- **Quality gates**: All releases require passing lint, format, type-check, and test suites
251-
- **Version management**: Versions automatically derived from git tags via `uv-dynamic-versioning`
252-
- **Configuration**: `pyproject.toml` uses `dynamic = ["version"]`
253-
- **Release automation**: `__init__.py` updated automatically during release process
254-
- **CI/CD**: GitHub Actions handles building and PyPI publication
255-
256-
## Development Notes
257-
- make sure you sign off on commits
171+
This level of integration represents a new paradigm in AI-human collaboration, where the AI assistant becomes a full-fledged team member rather than just a tool for generating code snippets.

Dockerfile

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
11
FROM python:3.12-slim-bookworm
22

3+
# Build arguments for user ID and group ID (defaults to 1000)
4+
ARG UID=1000
5+
ARG GID=1000
6+
37
# Copy uv from official image
48
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
59

610
# Set environment variables
711
ENV PYTHONUNBUFFERED=1 \
812
PYTHONDONTWRITEBYTECODE=1
913

14+
# Create a group and user with the provided UID/GID
15+
# Check if the GID already exists, if not create appgroup
16+
RUN (getent group ${GID} || groupadd --gid ${GID} appgroup) && \
17+
useradd --uid ${UID} --gid ${GID} --create-home --shell /bin/bash appuser
18+
1019
# Copy the project into the image
1120
ADD . /app
1221

1322
# Sync the project into a new environment, asserting the lockfile is up to date
1423
WORKDIR /app
1524
RUN uv sync --locked
1625

17-
# Create data directory
18-
RUN mkdir -p /app/data
26+
# Create necessary directories and set ownership
27+
RUN mkdir -p /app/data /app/.basic-memory && \
28+
chown -R appuser:${GID} /app
1929

2030
# Set default data directory and add venv to PATH
2131
ENV BASIC_MEMORY_HOME=/app/data \
2232
PATH="/app/.venv/bin:$PATH"
2333

34+
# Switch to the non-root user
35+
USER appuser
36+
2437
# Expose port
2538
EXPOSE 8000
2639

0 commit comments

Comments
 (0)