File-First Architecture
All knowledge in Basic Memory is stored in plain text Markdown files:- Files are the source of truth for all knowledge in Basic Memory
- Changes to files automatically update the knowledge graph in the db
- You maintain complete ownership and control
- Files work with git and other version control systems
- Knowledge persists independently of any AI conversation
Core Document Structure
Every document uses this basic structure:Frontmatter
The YAML frontmatter at the top of each file defines essential metadata:The title is particularly important as it’s used to create links between documents.
Observations
Observations are facts or statements about a topic:Observations are markdown list items beginning a
[category] value. Basic Memory knows to not make Markdown lists:
[ ] or [x]
into observations.- Category in [brackets] - classifies the information type
- Content text - the main information
- Optional #tags - additional categorization
- Optional (context) - supporting details
Common Categories
[tech]: Technical details[design]: Architecture decisions[feature]: User capabilities[decision]: Choices that were made
Additional Categories
[principle]: Fundamental concepts[method]: Approaches or techniques[preference]: Personal opinions
Relations
Relations connect documents to form the knowledge graph:Relations are markdown list items beginning a descriptive word, followed by a
[[wiki link]] value. The description
will by used as the relationship type.implements: Implementation of a specificationdepends_on: Required dependencyrelates_to: General connectioninspired_by: Source of ideasextends: Enhancementpart_of: Component relationshipcontains: Hierarchical relationshippairs_with: Complementary relationship
Knowledge Graph
Basic Memory automatically builds a knowledge graph from your document connections:- Each document becomes a node in the graph
- Relations create edges between nodes
- Relation types add semantic meaning to connections
- Forward references can link to documents that don’t exist yet
Permalinks and memory:// URLs
Every document in Basic Memory has a unique permalink that serves as its stable identifier:How Permalinks Work
- Automatically assigned: The system generates a permalink for each document
- Based on title: By default, derived from the document title
- Always unique: If conflicts exist, the system adds a suffix to ensure uniqueness
- Stable reference: Remains the same even if the file moves in the directory structure
- Used in memory:// URLs: Forms the basis of the memory:// addressing scheme
.basic-memory/config.json.
To change the behavior, set the following value:
Using memory:// URLs
The memory:// URL scheme provides a reliable way to reference knowledge:File Organization
Organize files in any structure that suits your needs:- Group by topic in folders
- Use a flat structure with descriptive filenames
- Tag files for easier discovery
- Add custom metadata in frontmatter
The system will build the semantic knowledge graph regardless of how you organize your files.

