Architecture
Basic Memory consists of:Core Knowledge Engine
Parses and indexes Markdown files
SQLite Database
Provides fast querying and search
MCP Server
Implements the Model Context Protocol
CLI Tools
Command-line utilities for management
Sync Service
Monitors file changes and updates the database
The system follows a file-first architecture where all knowledge is represented in standard Markdown files and the database serves as a secondary index.
Model Context Protocol (MCP)
Basic Memory implements the Model Context Protocol, an open standard for enabling AI models to access external tools:Standardized Interface
Common protocol for tool integration
Tool Registration
Basic Memory registers as a tool provider
Asynchronous Communication
Enables efficient interaction with AI models
Standardized Schema
Structured data exchange format
Licensing
Basic Memory is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0):Free Software
You can use, study, share, and modify the software
Copyleft
Derivative works must be distributed under the same license
Network Use
Network users must be able to receive the source code
Commercial Use
Allowed, subject to license requirements
The AGPL license ensures Basic Memory remains open source while protecting against proprietary forks.
Source Code
Basic Memory is developed as an open-source project:GitHub Repository
Issue Tracker
Report bugs and request features on GitHub
Contributions
Pull requests are welcome following the contributing guidelines
Documentation
Source for this documentation is also available in the repository
Data Storage and Privacy
Basic Memory is designed with privacy as a core principle:Privacy-First Design:
- Local-First: All data remains on your local machine
- No Cloud Dependency: No remote servers or accounts required
- Telemetry: Optional and disabled by default
- Standard Formats: All data is stored in standard file formats you control
Implementation Details
Knowledge in Basic Memory is organized as a semantic graph:
This structure emerges from simple text patterns in standard Markdown:
Example Markdown Input
Parsed JSON Structure
Resulting JSON Entity Structure
Resulting JSON Entity Structure
Entity Model
Basic Memory’s core data model consists of:Entities
Documents in your knowledge base
Observations
Facts or statements about entities
Relations
Connections between entities
Tags
Additional categorization for entities and observations
Files as Source of Truth
Plain Markdown files store all knowledge, making it accessible with any text editor and easy to version with git.SQLite Database
A local SQLite database maintains the knowledge graph topology for fast queries and semantic traversal without cloud dependencies. It contains:Knowledge Graph Schema
Database tables for the knowledge graph structure
Search Index
Full text search index across the knowledge base
Sync Process
The sync process:Search Engine
The search functionality:Hybrid Search
Uses a combination of full-text search and semantic matching
Comprehensive Indexing
Indexes observations, relations, and content
Pattern Matching
Supports wildcards and pattern matching in memory:// URLs
Graph Traversal
Traverses the knowledge graph to follow relationships
Results are ranked by relevance to the query using advanced scoring algorithms.
System Architecture
Component Interaction
The Basic Memory system is built with a modular architecture:- File Layer
- Processing Layer
- Storage Layer
- Interface Layer
Markdown Files serve as the source of truth:
- Human-readable and editable
- Version control friendly
- Standard format compatibility
- Complete data ownership
Performance Characteristics
Local Performance
All operations are local with no network latency
Scalability
Handles knowledge bases with thousands of documents
Resource Efficiency
Minimal CPU and memory footprint
Development Philosophy
Basic Memory embodies several key principles:Core Principles:
- Local-First: Your data stays on your machine
- Open Standards: Uses standard formats and protocols
- Human-Readable: Everything is accessible without special tools
- AI-Native: Designed specifically for AI collaboration
- Privacy-Preserving: No data collection or tracking

