Knowledge Format
Learn Basic Memory’s knowledge format using standard Markdown with semantic patterns to create a knowledge graph
Understanding how Basic Memory structures knowledge will help you create richer, more connected notes. Here’s how the semantic patterns work.
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.
Each observation contains:
- 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.
You can also create inline references:
Common relation types include:
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
This graph enables rich context building and navigation across your knowledge base.
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
You can specify a custom permalink in the frontmatter:
If not specified, one will be generated automatically from the title, if the note has has a frontmatter section.
By default a notes’ permalink value will not change if the file is moved. It’s a stable identifier. But if you’d rather permalinks are always updated when a file moves, you can set the config setting in the global config.
The config file for Basic Memory is in the home directory under .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:
Memory URLs support pattern matching for more powerful queries:
This addressing scheme ensures content remains accessible even as your knowledge base evolves and files are reorganized.
File Organization
Organize files in any structure that suits your needs:
You can:
- 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.