synapse-db
v0.6.0
Published
Universal Markdown-First & In-Memory Connectome Database with Causal-WAL Time-Travel, Zero-GC Ring Buffer, Bump Arena & Obsidian Canvas Exporter
Maintainers
Readme
🗄️ synapse-db
Universal Markdown-First & In-Memory Connectome Database for AI-Native Systems
Part of Synapse Kit | Official Docs: https://synapse.minseok.online
Installation
bun add synapse-db
# or
npm install synapse-dbQuick Start
import { SynapseDB } from 'synapse-db';
const db = new SynapseDB({
vaultDir: './vault',
autoWatch: true,
});
await db.init();
const notes = db.collection<{ title: string; tags: string[] }>('notes');
await notes.save({
id: 'arch-01',
data: { title: 'Synapse Architecture', tags: ['core', 'db'] },
body: '# Architecture\n\nConnected to [[notes/arch-02]].',
});
// O(1) lookup, bidirectional wikilink synapses, and Korean/English BM25 search
const doc = notes.get('arch-01');
const backlinks = notes.synapses('arch-02').incoming();
const hits = notes.search('Architecture');
// Export Connectome graph directly to Obsidian Canvas (.canvas)
db.exportCanvas('./vault/connectome.canvas');Features
- Markdown-First Storage: Lossless YAML Frontmatter + Markdown body persistence with atomic
.tmprename writes. - In-Memory Connectome: $O(1)$ hash lookup and automatic bidirectional
[[collection/id|alias]]wikilink wiring with mathematically verified graph symmetry invariants. - Korean 2-gram + English BM25 Search: Zero-dependency inverted index with automatic ghost-token elimination on update/delete.
- Legacy Migrator: Built-in
migrateFromSqlite(with SQL injection identifier guard) andmigrateFromJsonArray. - Obsidian Canvas Exporter: Generates interactive
.canvasfiles for visual graph inspection in Obsidian.
License
MIT
