File size: 5,207 Bytes
dd6411c a714b2e dd6411c a714b2e dd6411c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 |
## Mind Memory Architecture
## Overview
The Mind system uses three complementary storage layers:
mind.db β Source of Truth
knowledge.pt β Portable Export
knowledge.faiss β Vector Search Index
Each component has a specific responsibility.
βΈ»
Component Responsibilities
1. mind.db
Purpose: Permanent storage of all memory data.
SQLite is the authoritative database and contains the complete memory graph.
Stores
β’ Captures
β’ Events
β’ Concepts
β’ Metadata
β’ Tags
β’ URLs
β’ Related IDs
β’ Lifecycle State
β’ Enrichment Data
Example
{
"id": "capture_123",
"title": "SQLite Optimization",
"url": "https://example.com",
"tags": ["sqlite", "database"],
"related_ids": ["capture_456"],
"content": "Full article text..."
}
Characteristics
β’ Human-readable data
β’ Structured metadata
β’ Editable
β’ Persistent
β’ Source of truth
βΈ»
2. knowledge.pt
Purpose: Portable snapshot of embeddings and lookup information.
Generated from mind.db.
Stores
{
"version": 1,
"embed_model": "BAAI/bge-base-en-v1.5",
"count": 1234,
"ids": [...],
"embeddings": tensor(...)
}
Future versions may also contain:
{
"records": [...],
"texts": [...],
"metadata": [...]
}
Characteristics
β’ Fast to load
β’ Portable
β’ Easy to share
β’ Useful for backups
β’ Useful for debugging
Does NOT Replace SQLite
knowledge.pt is an export.
If deleted, it can be regenerated from mind.db.
βΈ»
3. knowledge.faiss
Purpose: High-speed semantic search.
Generated from embeddings.
Stores
Vector 0
Vector 1
Vector 2
...
Vector N
Characteristics
β’ Extremely fast similarity search
β’ Optimized for vector retrieval
β’ Contains no business data
β’ Contains no content text
β’ Contains no metadata
Does NOT Store
β’ Titles
β’ URLs
β’ Tags
β’ Concepts
β’ Content
It stores vectors only.
βΈ»
Retrieval Flow
User Query
Example:
How do I convert Gemma models to GGUF?
Step 1
Generate query embedding.
Question
β
Embedding Model
β
Query Vector
βΈ»
Step 2
Search FAISS.
Query Vector
β
knowledge.faiss
β
Top Matching Vectors
Example:
Vector 42 Score 0.95
Vector 17 Score 0.88
Vector 88 Score 0.81
βΈ»
Step 3
Resolve IDs using knowledge.pt.
Vector 42
β
knowledge.pt
β
capture_123
βΈ»
Step 4
Retrieve full memory.
capture_123
β
mind.db
β
Full Record
Example:
{
"id": "capture_123",
"title": "Gemma GGUF Conversion",
"content": "Detailed conversion instructions..."
}
βΈ»
Why Three Layers?
SQLite
Best for:
β’ Storage
β’ Metadata
β’ Updates
β’ Relationships
PT
Best for:
β’ Portability
β’ Snapshots
β’ Backup
β’ Debugging
FAISS
Best for:
β’ Semantic Search
β’ Similarity Matching
β’ Fast Retrieval
βΈ»
Architecture Diagram
ββββββββββββββββββββ
β User Question β
βββββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββββββ
β BGE Embedding β
βββββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββββββ
β knowledge.faiss β
β Vector Search β
βββββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββββββ
β knowledge.pt β
β Vector β ID Map β
βββββββββββ¬βββββββββ
β
βΌ
ββββββββββββββββββββ
β mind.db β
β Full Memory Data β
ββββββββββββββββββββ
βΈ»
Current State
mind.db
β Full Memory Storage
knowledge.pt
β Embeddings
β IDs
knowledge.faiss
β Semantic Search
βΈ»
Future Enhancements
Possible upgrades:
β’ Store metadata inside knowledge.pt
β’ Store content snapshots inside knowledge.pt
β’ Incremental FAISS updates
β’ HNSW FAISS indexes for larger datasets
β’ Hybrid keyword + vector search
β’ Multi-model embedding support
β’ Automatic synchronization between SQLite and exports
βΈ»
Summary
The architecture separates responsibilities:
β’ mind.db stores the memories.
β’ knowledge.faiss finds similar memories.
β’ knowledge.pt maps vectors back to memory IDs.
This design keeps storage, retrieval, and search independent while allowing fast semantic memory lookup at scale.
:::
This document should give future contributors a clear understanding of why all three files exist and how they work together. |