gnosys-mcp 1.3.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/README.md +207 -41
  2. package/dist/cli.js +224 -6
  3. package/dist/cli.js.map +1 -1
  4. package/dist/index.js +532 -104
  5. package/dist/index.js.map +1 -1
  6. package/dist/lib/config.d.ts +40 -21
  7. package/dist/lib/config.d.ts.map +1 -1
  8. package/dist/lib/config.js +55 -18
  9. package/dist/lib/config.js.map +1 -1
  10. package/dist/lib/dashboard.d.ts +17 -1
  11. package/dist/lib/dashboard.d.ts.map +1 -1
  12. package/dist/lib/dashboard.js +44 -1
  13. package/dist/lib/dashboard.js.map +1 -1
  14. package/dist/lib/db.d.ts +121 -0
  15. package/dist/lib/db.d.ts.map +1 -0
  16. package/dist/lib/db.js +356 -0
  17. package/dist/lib/db.js.map +1 -0
  18. package/dist/lib/dbSearch.d.ts +65 -0
  19. package/dist/lib/dbSearch.d.ts.map +1 -0
  20. package/dist/lib/dbSearch.js +239 -0
  21. package/dist/lib/dbSearch.js.map +1 -0
  22. package/dist/lib/dbWrite.d.ts +54 -0
  23. package/dist/lib/dbWrite.d.ts.map +1 -0
  24. package/dist/lib/dbWrite.js +167 -0
  25. package/dist/lib/dbWrite.js.map +1 -0
  26. package/dist/lib/dream.d.ts +170 -0
  27. package/dist/lib/dream.d.ts.map +1 -0
  28. package/dist/lib/dream.js +698 -0
  29. package/dist/lib/dream.js.map +1 -0
  30. package/dist/lib/export.d.ts +92 -0
  31. package/dist/lib/export.d.ts.map +1 -0
  32. package/dist/lib/export.js +362 -0
  33. package/dist/lib/export.js.map +1 -0
  34. package/dist/lib/hybridSearch.d.ts +4 -1
  35. package/dist/lib/hybridSearch.d.ts.map +1 -1
  36. package/dist/lib/hybridSearch.js +23 -1
  37. package/dist/lib/hybridSearch.js.map +1 -1
  38. package/dist/lib/migrate.d.ts +19 -0
  39. package/dist/lib/migrate.d.ts.map +1 -0
  40. package/dist/lib/migrate.js +256 -0
  41. package/dist/lib/migrate.js.map +1 -0
  42. package/dist/lib/recall.d.ts +34 -19
  43. package/dist/lib/recall.d.ts.map +1 -1
  44. package/dist/lib/recall.js +149 -71
  45. package/dist/lib/recall.js.map +1 -1
  46. package/dist/lib/resolver.d.ts +34 -2
  47. package/dist/lib/resolver.d.ts.map +1 -1
  48. package/dist/lib/resolver.js +109 -6
  49. package/dist/lib/resolver.js.map +1 -1
  50. package/package.json +1 -1
package/README.md CHANGED
@@ -16,15 +16,15 @@
16
16
 
17
17
  **Gnosys** gives LLMs — and humans — a knowledge layer that survives across sessions and scales to real-world datasets.
18
18
 
19
- Every piece of knowledge is stored as an atomic Markdown file with rich YAML frontmatter inside a `.gnosys/` directory. Git versions every change. SQLite FTS5 delivers instant keyword search. The entire folder is a fully functional Obsidian vault for browsing, wikilinking, graphing, and editing.
19
+ In v2.0, Gnosys is **agent-first**: a unified SQLite database (`gnosys.db`) is the primary store for all reads and writes, while Markdown files remain as a human-readable safety net. Dream Mode consolidates knowledge during idle time. One-command export regenerates a full Obsidian vault from the database. Multi-project support routes memory calls across parallel workspaces without conflicts.
20
20
 
21
- It runs as a CLI and a complete MCP server that drops straight into Cursor, Claude Desktop, Claude Code, or any MCP client.
21
+ It runs as a CLI and a complete MCP server that drops straight into Cursor, Claude Desktop, Claude Code, Cowork, Codex, or any MCP client.
22
22
 
23
23
  **Beyond agents**: Gnosys turns any structured dataset into a connected, versioned knowledge graph.
24
24
  • NVD/CVE Database: 200k+ vulnerabilities auto-linked to packages, exploits, patches, and supersession history. Ask "which of our dependencies have active unpatched criticals?"
25
25
  • USDA FoodData Central: ~8k foods atomized with wikilinks to nutrients and substitutions. Ask "high-protein, low-sodium, high-potassium alternatives to X?"
26
26
 
27
- No vector DBs. No black boxes. No external services. Just files, Git, and Obsidian — the way knowledge should be.
27
+ No vector DBs. No black boxes. No external services. Just SQLite, Git, Markdown, and Obsidian — the way knowledge should be.
28
28
 
29
29
  ---
30
30
 
@@ -36,15 +36,18 @@ Gnosys takes a different approach: every memory is a plain Markdown file with YA
36
36
 
37
37
  **What makes it different:**
38
38
 
39
- - **Transparent** — every memory is a human-readable `.md` file. No embeddings, no binary blobs.
39
+ - **Agent-first SQLite** — unified `gnosys.db` handles all reads and writes at sub-10ms. Markdown files kept as a dual-write safety net.
40
+ - **Dream Mode** — idle-time consolidation engine: confidence decay, self-critique, summary generation, and relationship discovery. Never deletes — only suggests reviews.
41
+ - **Transparent** — every memory has a human-readable `.md` file alongside the database. Export to Obsidian vault with one command.
42
+ - **Multi-project** — MCP roots support + per-tool `projectRoot` routing. Multiple Cursor windows, multiple projects, zero race conditions.
40
43
  - **Freeform Ask** — ask natural-language questions and get synthesized answers with Obsidian wikilink citations from the entire vault.
41
44
  - **Hybrid Search** — combines FTS5 keyword search with semantic embeddings via Reciprocal Rank Fusion (RRF).
42
45
  - **Versioned** — Git auto-commits every write. Full history, rollback, and diff support.
43
- - **Obsidian-native** — the `.gnosys/` folder is a real vault. Graph view, wikilinks, tags, backlinks all work.
44
- - **MCP-first** — drops into Cursor, Claude Desktop, Claude Code, Codex, or any MCP client with one config line.
46
+ - **Obsidian-native** — `gnosys export` generates a full Obsidian vault with YAML frontmatter, `[[wikilinks]]`, summaries, and graph data.
47
+ - **MCP-first** — drops into Cursor, Claude Desktop, Claude Code, Cowork, Codex, or any MCP client with one config line.
45
48
  - **Bulk import** — CSV, JSON, JSONL. Import entire datasets (USDA, NVD, your internal docs) in seconds.
46
49
  - **Layered stores** — project, personal, global, and optional read-only stores stacked by precedence.
47
- - **Zero infrastructure** — no databases, no Docker (unless you want it), no cloud services. Just `npm install`.
50
+ - **Zero infrastructure** — no external databases, no Docker (unless you want it), no cloud services. Just `npm install`.
48
51
 
49
52
  ---
50
53
 
@@ -265,7 +268,11 @@ ANTHROPIC_API_KEY = "your-key-here"
265
268
  | `gnosys_dearchive` | Force-dearchive memories from archive back to active |
266
269
  | `gnosys_dashboard` | System dashboard (memory count, health, archive, graph, LLM status) |
267
270
  | `gnosys_reindex_graph` | Build/rebuild the wikilink graph |
268
- | `gnosys_stores` | Show active stores |
271
+ | `gnosys_dream` | Run a Dream Mode cycle (decay, self-critique, summaries, relationships) |
272
+ | `gnosys_export` | Export gnosys.db to an Obsidian-compatible vault |
273
+ | `gnosys_recall` | Fast memory injection for agent orchestrators (sub-50ms) |
274
+ | `gnosys_audit` | View structured audit trail of all memory operations |
275
+ | `gnosys_stores` | Show active stores, MCP roots, and detected project stores |
269
276
  | `gnosys_tags` | List tag registry |
270
277
  | `gnosys_tags_add` | Add a new tag to the registry |
271
278
 
@@ -278,7 +285,8 @@ A Gnosys store is a `.gnosys/` directory inside your project:
278
285
  ```
279
286
  your-project/
280
287
  .gnosys/
281
- decisions/
288
+ gnosys.db # ← v2.0 unified SQLite database (primary store)
289
+ decisions/ # dual-write .md files (human-readable safety net)
282
290
  use-postgresql.md
283
291
  architecture/
284
292
  three-layer-design.md
@@ -287,12 +295,14 @@ your-project/
287
295
  nvd-cves/
288
296
  cve-2024-1234.md
289
297
  gnosys.json # configuration
290
- archive.db # two-tier memory archive (SQLite)
298
+ archive.db # legacy two-tier archive (pre-v2.0)
291
299
  .config/tags.json # tag registry
292
300
  CHANGELOG.md
293
301
  .git/ # auto-versioned
294
302
  ```
295
303
 
304
+ In v2.0, `gnosys.db` is the primary store. All reads go through SQLite for sub-10ms performance. Writes dual-write to both `.md` files and the database. Run `gnosys migrate` to move existing v1.x data into the unified database.
305
+
296
306
  Each memory is an atomic Markdown file with YAML frontmatter:
297
307
 
298
308
  ```yaml
@@ -387,12 +397,22 @@ A default `gnosys.json` is created during `gnosys init`. Validation is handled b
387
397
 
388
398
  ## Using with Obsidian
389
399
 
390
- The `.gnosys/` directory is a fully valid Obsidian vault. Open it and get graph view, wikilinks, backlinks, tag search, and visual editing with zero configuration.
400
+ In v2.0, the primary store is SQLite. Use the **Obsidian Export Bridge** to generate a full Obsidian vault from the database:
401
+
402
+ ```bash
403
+ # Export to an Obsidian-compatible vault
404
+ gnosys export --to ~/vaults/my-project
391
405
 
392
- 1. Open Obsidian "Open folder as vault" → select `.gnosys/`
393
- 2. Browse categories as folders, explore the graph view
394
- 3. Wikilinks between memories (e.g., `[[eric_allman/sendmail]]` in CVE data) create navigable connections
395
- 4. Edits made in Obsidian are picked up automatically (filesystem is source of truth)
406
+ # Overwrite an existing export
407
+ gnosys export --to ~/vaults/my-project --overwrite
408
+
409
+ # Export everything including summaries, reviews, and graph data
410
+ gnosys export --to ~/vaults/my-project --all
411
+ ```
412
+
413
+ The export creates: category folders with YAML frontmatter `.md` files, `[[wikilinks]]` from the relationships table, `_summaries/` for Dream Mode category summaries, `_review/` for flagged memories, and `_graph/` for relationship data.
414
+
415
+ You can also browse the dual-write `.md` files directly in the `.gnosys/` directory — they're kept in sync with every write. Open the exported vault in Obsidian for graph view, wikilinks, backlinks, tag search, and visual editing.
396
416
 
397
417
  ---
398
418
 
@@ -538,6 +558,120 @@ The `gnosys_maintain` MCP tool lets agents trigger maintenance programmatically
538
558
 
539
559
  ---
540
560
 
561
+ ## Agent-First SQLite Core (v2.0)
562
+
563
+ Gnosys 2.0 shifts from a human-first Markdown store to an **agent-first SQLite core**. The unified `gnosys.db` replaces four separate data stores (`.md` files, `archive.db`, `embeddings.db`, `graph.json`) with five tables: `memories`, `memories_fts` (FTS5), `relationships`, `summaries`, and `audit_log`.
564
+
565
+ ### Migration
566
+
567
+ Existing v1.x stores upgrade with a single command:
568
+
569
+ ```bash
570
+ # Migrate all .md files + archive.db into gnosys.db
571
+ gnosys migrate
572
+
573
+ # Preview what would be migrated (dry run)
574
+ gnosys migrate --dry-run
575
+ ```
576
+
577
+ Migration is one-shot and safe — your `.md` files remain untouched. After migration, all reads go through SQLite (sub-10ms), and all writes dual-write to both `.md` and `gnosys.db`.
578
+
579
+ ### Schema
580
+
581
+ | Table | Purpose |
582
+ |-------|---------|
583
+ | `memories` | All memory data: frontmatter, content, embeddings (BLOB), timestamps |
584
+ | `memories_fts` | FTS5 full-text index — auto-synced via INSERT/UPDATE/DELETE triggers |
585
+ | `relationships` | Typed edges between memories (wikilinks, Dream Mode discoveries) |
586
+ | `summaries` | Category-level summaries generated by Dream Mode |
587
+ | `audit_log` | Every operation logged with timestamps and trace IDs |
588
+
589
+ The database uses WAL mode for concurrent access — multiple agents can read and write safely from parallel processes.
590
+
591
+ ---
592
+
593
+ ## Dream Mode
594
+
595
+ Dream Mode is Gnosys's idle-time consolidation engine — inspired by how biological memory consolidates during sleep. When your agent goes idle, Dream Mode runs a four-phase cycle:
596
+
597
+ **Phase 1: Confidence Decay** — Applies exponential decay to unreinforced memories. No LLM needed.
598
+
599
+ **Phase 2: Self-Critique** — Rule-based + optional LLM scoring flags low-quality, stale, or contradictory memories for review. **Never deletes** — only stores review suggestions.
600
+
601
+ **Phase 3: Summary Generation** — LLM generates category-level summaries and stores them in the `summaries` table.
602
+
603
+ **Phase 4: Relationship Discovery** — LLM discovers semantic relationships between memories and stores typed edges in the `relationships` table.
604
+
605
+ ### Usage
606
+
607
+ ```bash
608
+ # Run a Dream cycle manually
609
+ gnosys dream
610
+
611
+ # Limit runtime
612
+ gnosys dream --max-runtime 15
613
+
614
+ # Skip specific phases
615
+ gnosys dream --no-summaries --no-relationships
616
+
617
+ # JSON output for automation
618
+ gnosys dream --json
619
+ ```
620
+
621
+ ### Configuration
622
+
623
+ Dream Mode is **off by default**. Enable it in `gnosys.json`:
624
+
625
+ ```json
626
+ {
627
+ "dream": {
628
+ "enabled": true,
629
+ "idleMinutes": 10,
630
+ "maxRuntimeMinutes": 30,
631
+ "provider": "ollama",
632
+ "selfCritique": true,
633
+ "generateSummaries": true,
634
+ "discoverRelationships": true
635
+ }
636
+ }
637
+ ```
638
+
639
+ When enabled and the MCP server is running, Dream Mode automatically triggers after the configured idle period. Any agent activity immediately aborts the dream cycle and resets the idle timer.
640
+
641
+ The `gnosys_dream` MCP tool lets agents trigger dream cycles programmatically.
642
+
643
+ ---
644
+
645
+ ## Multi-Project Support (v2.0)
646
+
647
+ Gnosys 2.0 supports multiple projects in parallel — critical for developers using multiple Cursor windows or multi-root workspaces.
648
+
649
+ ### The Problem
650
+
651
+ In v1.x, the MCP server used `process.cwd()` to find the `.gnosys/` store. All Cursor windows sharing one MCP process would read and write to the same store, regardless of which project was active.
652
+
653
+ ### The Solution
654
+
655
+ Every MCP tool now accepts an optional `projectRoot` parameter that routes the call to the correct `.gnosys/` store. This is **stateless** — each call carries its own routing context with no shared mutable state, so parallel agents across multiple windows never conflict.
656
+
657
+ ```
658
+ # Agent in Window 1 (project-a):
659
+ gnosys_add(input: "...", projectRoot: "/Users/me/project-a")
660
+
661
+ # Agent in Window 2 (project-b) — runs simultaneously, routes correctly:
662
+ gnosys_add(input: "...", projectRoot: "/Users/me/project-b")
663
+ ```
664
+
665
+ ### MCP Roots
666
+
667
+ Gnosys also supports the MCP roots protocol. On connect, the server calls `roots/list` to discover workspace folders and listens for `notifications/roots/list_changed` to track dynamic changes. Store resolution priority: registered stores → MCP roots → `cwd` walkup.
668
+
669
+ ### Debugging
670
+
671
+ Use `gnosys stores` (CLI) or the `gnosys_stores` MCP tool to see all detected stores, MCP roots, and which store is currently active.
672
+
673
+ ---
674
+
541
675
  ## Comparison
542
676
 
543
677
  Agent memory is a spectrum — from a single markdown file to full knowledge graphs. Here's an honest look at the trade-offs.
@@ -545,15 +679,15 @@ Agent memory is a spectrum — from a single markdown file to full knowledge gra
545
679
  | Aspect | Plain Markdown | RAG (Vector DB) | Knowledge Graph | **Gnosys** |
546
680
  |--------|---------------|-----------------|-----------------|-----------|
547
681
  | **Examples** | CLAUDE.md, .cursorrules | Mem0, LangChain Memory | Graphiti/Zep, Mem0 Graph | — |
548
- | **Storage** | `.md` files | Embeddings in vector DB | Nodes/edges in graph DB | `.md` files + SQLite index + SQLite archive |
549
- | **Transparency** | Perfect | Lossy (embeddings) | High (query nodes) | High (readable markdown) |
682
+ | **Storage** | `.md` files | Embeddings in vector DB | Nodes/edges in graph DB | Unified SQLite DB + `.md` dual-write |
683
+ | **Transparency** | Perfect | Lossy (embeddings) | High (query nodes) | High (SQLite + dual-write `.md` + Obsidian export) |
550
684
  | **Version history** | Git native | None built-in | None built-in | Git native |
551
685
  | **Keyword search** | Manual / grep | BM25 layer (some) | BM25 layer (some) | FTS5 (built-in) |
552
686
  | **Semantic search** | None | Vector similarity | Graph + vectors | Vector + FTS5 hybrid (RRF) |
553
687
  | **Relationship traversal** | None | None | Multi-hop graph queries | Wikilinks (manual encoding) |
554
688
  | **Automatic extraction** | No | Yes (embeddings) | Yes (entities + edges) | No (explicit structuring) |
555
689
  | **Conflict detection** | No | No | Yes (graph rules) | No |
556
- | **Scale comfort zone** | ~5K memories | 100K+ | 100K+ | 100K+ (two-tier: active `.md` + SQLite archive) |
690
+ | **Scale comfort zone** | ~5K memories | 100K+ | 100K+ | 100K+ (unified SQLite + optional archive tier) |
557
691
  | **Setup time** | < 5 min | 30 min – 2 hours | 4 – 8 hours | 15 – 30 min |
558
692
  | **Infrastructure** | None | Vector DB + embeddings API | Graph DB + LLM | SQLite (embedded) |
559
693
  | **Human editability** | Excellent | Poor (re-embed) | Moderate | Excellent |
@@ -582,9 +716,11 @@ Agent memory is a spectrum — from a single markdown file to full knowledge gra
582
716
 
583
717
  ### Two-Tier Memory (Active + Archive)
584
718
 
719
+ > **Note:** In v2.0, the unified `gnosys.db` handles all memories. The two-tier archive system (`archive.db`) remains supported for pre-migration stores and as an additional archiving layer.
720
+
585
721
  Gnosys uses a two-tier architecture so your current work stays fast while safely growing to 100k+ memories:
586
722
 
587
- **Active layer** — `.gnosys/<category>/*.md` — fast markdown files for day-to-day work.
723
+ **Active layer** — `gnosys.db` (v2.0) or `.gnosys/<category>/*.md` (v1.x) primary store for day-to-day work.
588
724
 
589
725
  **Archive layer** — `.gnosys/archive.db` — SQLite database for old or low-confidence memories.
590
726
 
@@ -605,35 +741,50 @@ Configure thresholds in `gnosys.json`:
605
741
  }
606
742
  ```
607
743
 
608
- ### Enterprise Reliability (v1.3.0)
744
+ ### Enterprise Reliability (v1.3.0+)
609
745
 
610
746
  Built for long-running agent orchestrators that call Gnosys hundreds of times per session.
611
747
 
612
- **Always-on recall** — `gnosys_recall` tool + `gnosys://recall` resource Sub-50ms automatic context injection. No LLM, no embeddings. Three modes: **aggressive** (default, always injects top 3+), **balanced** (relevance threshold), **conservative** (high relevance only). MCP resource with `priority: 1` for hosts that support automatic resource injection. Returns `<gnosys-recall>` blocks or a `<gnosys: no-strong-recall-needed>` heartbeat marker.
748
+ **Automatic Memory Injection** — The `gnosys://recall` MCP Resource is read by hosts (Cursor, Claude Desktop, Claude Code, Cowork) on every single turn. No tool call needed the host injects relevant memories into the model context automatically. The `gnosys_recall` tool is kept as a fallback for hosts that don't support MCP Resources.
749
+
750
+ Sub-50ms, no LLM, no embeddings — pure FTS5 keyword search with relevance scoring. Returns `<gnosys-recall>` blocks with `[[wikilinks]]` or a `<gnosys: no-strong-recall-needed>` heartbeat.
751
+
752
+ Two modes: **aggressive** (default) always injects the top 3 memories plus any above the relevance floor. **Filtered** (`aggressive: false`) applies a hard cutoff at `minRelevance`.
613
753
 
614
754
  ```bash
615
755
  # CLI — aggressive mode (default)
616
756
  gnosys recall "React state management"
617
757
 
618
- # Override mode, host-friendly format
619
- gnosys recall "React state management" --mode balanced --host
758
+ # Force filtered mode
759
+ gnosys recall "React state management" --no-aggressive --host
620
760
 
621
- # MCP tool (called by orchestrator before each turn)
622
- gnosys_recall { query: "React state management", mode: "aggressive" }
761
+ # Configure recall
762
+ gnosys config set recall aggressive true
763
+ gnosys config set recall maxMemories 12
764
+ gnosys config set recall minRelevance 0.3
623
765
  ```
624
766
 
625
767
  Configure in `gnosys.json`:
626
768
  ```json
627
769
  {
628
770
  "recall": {
629
- "mode": "aggressive",
630
- "minRelevanceScore": 0.65,
631
- "maxMemoriesPerTurn": 8,
632
- "alwaysInjectTopN": 3
771
+ "aggressive": true,
772
+ "maxMemories": 8,
773
+ "minRelevance": 0.4
633
774
  }
634
775
  }
635
776
  ```
636
777
 
778
+ #### Setup for Automatic Injection
779
+
780
+ **Cursor** — Add to your MCP config. Cursor reads `gnosys://recall` automatically on every turn when it's listed as a resource with `priority: 1`.
781
+
782
+ **Claude Desktop** — Same MCP config. The resource appears in the model context on every message.
783
+
784
+ **Claude Code / Cowork** — Configure via `.mcp.json` or the MCP settings. The `gnosys://recall` resource is injected into every assistant turn.
785
+
786
+ No per-turn tool calls, no manual invocation — just configure the MCP server once and memories flow into every conversation automatically.
787
+
637
788
  **Concurrency safety** — Write locking with PID tracking prevents corruption when multiple agents write simultaneously. SQLite databases (archive + embeddings) use WAL mode for concurrent reads during writes. Stale lock detection auto-recovers from crashed processes.
638
789
 
639
790
  **Audit trail** — Every memory operation (read, write, recall, ask, maintain, archive, dearchive) is logged to `.gnosys/.config/audit.jsonl` with timestamps, durations, and optional traceIds for correlation with your outer orchestrator.
@@ -689,13 +840,21 @@ gnosys config set provider <name> # Set default provider
689
840
  gnosys config set task <task> <provider> <model> # Route task
690
841
  gnosys doctor # Full system health check (all providers)
691
842
  gnosys stores # Show active stores
692
- gnosys recall "query" # Always-on recall (aggressive mode by default)
693
- gnosys recall "q" --mode balanced # Override recall mode
694
- gnosys recall "q" --host # Output in <gnosys-recall> host format
695
- gnosys recall "q" --json # Recall as JSON for programmatic use
843
+ gnosys recall "query" # Always-on recall (aggressive mode by default)
844
+ gnosys recall "q" --no-aggressive # Force filtered mode (hard cutoff)
845
+ gnosys recall "q" --host # Output in <gnosys-recall> host format
846
+ gnosys recall "q" --json # Recall as JSON for programmatic use
696
847
  gnosys audit # View audit trail (last 7 days)
697
848
  gnosys audit --days 30 # View last 30 days of operations
698
849
  gnosys audit --operation ask # Filter by operation type
850
+ gnosys migrate # Migrate v1.x data to unified gnosys.db
851
+ gnosys migrate --dry-run # Preview migration without changes
852
+ gnosys dream # Run Dream Mode consolidation cycle
853
+ gnosys dream --max-runtime 15 # Limit dream runtime to 15 minutes
854
+ gnosys dream --no-summaries # Skip summary generation phase
855
+ gnosys export --to <dir> # Export gnosys.db to Obsidian vault
856
+ gnosys export --to <dir> --all # Include summaries, reviews, and graph
857
+ gnosys export --to <dir> --overwrite # Overwrite existing export
699
858
  gnosys serve # Start MCP server (stdio)
700
859
  gnosys serve --with-maintenance # MCP server + maintenance every 6h
701
860
  ```
@@ -716,10 +875,16 @@ npm run dev # Run MCP server in dev mode (tsx)
716
875
 
717
876
  ```
718
877
  src/
719
- index.ts # MCP server — exposes all tools
878
+ index.ts # MCP server — 35 tools + gnosys://recall resource
720
879
  cli.ts # CLI — thin wrapper around core modules
721
880
  lib/
722
- store.ts # Core: read/write/update memory files
881
+ db.ts # v2.0: GnosysDB unified SQLite database (5-table schema)
882
+ dbSearch.ts # v2.0: Adapter bridging GnosysDB to search interfaces
883
+ dbWrite.ts # v2.0: Dual-write helpers (sync .md → gnosys.db)
884
+ migrate.ts # v2.0: One-shot migration from v1.x to gnosys.db
885
+ dream.ts # v2.0: Dream Mode engine + idle scheduler
886
+ export.ts # v2.0: Obsidian Export Bridge (gnosys.db → vault)
887
+ store.ts # Core: read/write/update memory files (.md)
723
888
  search.ts # FTS5 search and discovery
724
889
  embeddings.ts # Lazy semantic embeddings (all-MiniLM-L6-v2)
725
890
  hybridSearch.ts # Hybrid search with RRF fusion
@@ -735,9 +900,9 @@ src/
735
900
  tags.ts # Tag registry management
736
901
  ingest.ts # LLM-powered structuring (with retry logic)
737
902
  import.ts # Bulk import engine (CSV, JSON, JSONL)
738
- config.ts # gnosys.json loader with Zod validation
903
+ config.ts # gnosys.json loader with Zod validation + dream config
739
904
  retry.ts # Exponential backoff for LLM calls
740
- resolver.ts # Layered multi-store resolution
905
+ resolver.ts # Layered multi-store resolution + MCP roots + multi-project
741
906
  lensing.ts # Memory lensing (filtered views)
742
907
  history.ts # Git history and rollback
743
908
  timeline.ts # Knowledge evolution timeline
@@ -784,12 +949,13 @@ Gnosys is open source (MIT) and actively developed. Here's how to get involved:
784
949
  - [Issues](https://github.com/proticom/gnosys-mcp/issues) — bug reports and feature requests
785
950
  - PRs welcome — especially for new import connectors, LLM providers, and Obsidian plugins
786
951
 
787
- **What's next (v1.2+):**
788
- - Obsidian community plugin for native vault integration
789
- - VS Code extension for in-editor memory reinforcement
952
+ **What's next:**
953
+ - Temporal memory versioning (valid_from / valid_until)
954
+ - Cross-session "deep dream" overnight consolidation
955
+ - Versioned export snapshots (Git-tagged)
790
956
  - Docker Hub published image for one-line deployment
791
- - Multi-agent memory sharing protocol
792
957
  - Graph visualization in the dashboard
958
+ - Obsidian community plugin for native vault integration
793
959
 
794
960
  ---
795
961