Version control Claude Code configuration including: - Global instructions (CLAUDE.md) - User settings (settings.json) - Custom agents (architect, designer, engineer, etc.) - Custom skills (create-skill templates and workflows) Excludes session data, secrets, cache, and temporary files per .gitignore. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
4.9 KiB
4.9 KiB
MemoryGraph SQLite Schema
Database Location: ~/.memorygraph/memory.db
Tables
nodes
Stores all memory entries.
| Column | Type | Description |
|---|---|---|
| id | TEXT PRIMARY KEY | UUID identifier |
| label | TEXT NOT NULL | Always "Memory" for memory nodes |
| properties | TEXT NOT NULL | JSON blob containing all memory fields |
| created_at | TIMESTAMP | Auto-set on creation |
| updated_at | TIMESTAMP | Auto-set on update |
Indexes:
idx_nodes_label- Label lookupidx_nodes_created- Chronological queriesidx_nodes_memory- Memory-specific queries (WHERE label = 'Memory')
relationships
Stores typed connections between memories.
| Column | Type | Description |
|---|---|---|
| id | TEXT PRIMARY KEY | UUID identifier |
| from_id | TEXT NOT NULL | Source memory ID (FK to nodes) |
| to_id | TEXT NOT NULL | Target memory ID (FK to nodes) |
| rel_type | TEXT NOT NULL | Relationship type (SOLVES, CAUSES, etc.) |
| properties | TEXT NOT NULL | JSON blob with strength, confidence, context |
| created_at | TIMESTAMP | Auto-set on creation |
Indexes:
idx_rel_from- Outgoing relationshipsidx_rel_to- Incoming relationshipsidx_rel_type- Relationship type queries
nodes_fts
FTS5 virtual table for full-text search.
| Column | Type | Description |
|---|---|---|
| id | TEXT | Memory ID |
| title | TEXT | Memory title |
| content | TEXT | Memory content |
| summary | TEXT | Memory summary |
Memory Properties (JSON in nodes.properties)
{
"id": "uuid",
"type": "solution|problem|error|fix|...",
"title": "Short descriptive title",
"content": "Detailed content",
"summary": "Optional brief summary",
"tags": ["tag1", "tag2"],
"importance": 0.5,
"confidence": 0.8,
"usage_count": 0,
"created_at": "ISO timestamp",
"updated_at": "ISO timestamp"
}
Memory Types
| Type | Description |
|---|---|
solution |
Fix or solution to a problem |
problem |
Issue or challenge encountered |
error |
Specific error message or condition |
fix |
Code-level fix or patch |
code_pattern |
Reusable code pattern |
decision |
Architectural or design decision |
configuration |
Configuration that worked |
workflow |
Process or workflow pattern |
task |
Task or todo item |
project |
Project context |
technology |
Technology notes |
command |
Useful command |
file_context |
File-specific context |
general |
General memory |
Relationship Properties (JSON in relationships.properties)
{
"id": "uuid",
"strength": 0.5,
"confidence": 0.8,
"context": "{\"text\": \"...\", \"components\": [...]}",
"evidence_count": 1,
"success_rate": null,
"created_at": "ISO timestamp",
"last_validated": "ISO timestamp",
"validation_count": 0,
"counter_evidence_count": 0
}
Relationship Types
Causal
CAUSES- A causes BTRIGGERS- A triggers BLEADS_TO- A leads to BPREVENTS- A prevents BBREAKS- A breaks B
Solution
SOLVES- A solves B (most common)ADDRESSES- A addresses BALTERNATIVE_TO- A is alternative to BIMPROVES- A improves BREPLACES- A replaces B
Context
OCCURS_IN- A occurs in BAPPLIES_TO- A applies to BWORKS_WITH- A works with BREQUIRES- A requires BUSED_IN- A used in B
Learning
BUILDS_ON- A builds on BCONTRADICTS- A contradicts BCONFIRMS- A confirms BGENERALIZES- A generalizes BSPECIALIZES- A specializes B
Similarity
SIMILAR_TO- A similar to BVARIANT_OF- A variant of BRELATED_TO- A related to B (general)ANALOGY_TO- A analogy to BOPPOSITE_OF- A opposite of B
Workflow
FOLLOWS- A follows BDEPENDS_ON- A depends on BENABLES- A enables BBLOCKS- A blocks BPARALLEL_TO- A parallel to B
Quality
EFFECTIVE_FOR- A effective for BINEFFECTIVE_FOR- A ineffective for BPREFERRED_OVER- A preferred over BDEPRECATED_BY- A deprecated by BVALIDATED_BY- A validated by B
Common Queries
Get all memories
SELECT id, properties FROM nodes WHERE label = 'Memory';
Search by title/content (FTS)
SELECT n.id, n.properties
FROM nodes n
JOIN nodes_fts fts ON n.id = fts.id
WHERE nodes_fts MATCH 'search term';
Get memory with relationships
SELECT n.properties,
r.rel_type,
r.properties as rel_props,
n2.properties as related_memory
FROM nodes n
LEFT JOIN relationships r ON n.id = r.from_id OR n.id = r.to_id
LEFT JOIN nodes n2 ON (r.from_id = n2.id OR r.to_id = n2.id) AND n2.id != n.id
WHERE n.id = 'memory-uuid';
Find solutions for a problem
SELECT n.properties
FROM nodes n
JOIN relationships r ON n.id = r.from_id
WHERE r.to_id = 'problem-uuid' AND r.rel_type = 'SOLVES';
Generated: 2025-12-07