gnosys-mcp 2.6.0 → 2.7.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.
- package/README.md +98 -58
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
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
|
-
In
|
|
19
|
+
In v3.0, Gnosys is a **centralized brain**: a single SQLite database at `~/.gnosys/gnosys.db` unifies all projects, user preferences, and global knowledge under one roof. Every memory is scoped (`project`, `user`, or `global`) and tagged with a `project_id`. Federated search ranks results across scopes with tier boosting and recency awareness. Preferences drive automatic agent rules generation. Project briefings give instant status. Dream Mode consolidates knowledge during idle time. One-command export regenerates a full Obsidian vault. Multi-project routing with ambiguity detection keeps parallel workspaces conflict-free.
|
|
20
20
|
|
|
21
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
|
|
|
@@ -36,17 +36,22 @@ 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
|
-
- **
|
|
40
|
-
- **
|
|
39
|
+
- **Centralized brain (v3.0)** — single `~/.gnosys/gnosys.db` unifies all projects with `project_id` + `scope` columns. No more per-project silos.
|
|
40
|
+
- **Federated search** — tier-boosted search across project (1.5x) → user (1.0x) → global (0.7x) scopes with recency and reinforcement boosts.
|
|
41
|
+
- **Preferences as memories** — user preferences stored as scoped memories, driving automatic agent rules generation via `gnosys sync`.
|
|
42
|
+
- **Project briefings** — instant project status: categories, recent activity, top tags, summary. Dream Mode pre-computes these.
|
|
43
|
+
- **Ambiguity detection** — when a query hits multiple projects, Gnosys lists all candidates instead of guessing wrong.
|
|
44
|
+
- **Agent-first SQLite** — sub-10ms reads/writes. Markdown files kept as a dual-write safety net.
|
|
45
|
+
- **Dream Mode** — idle-time consolidation: confidence decay, self-critique, summary generation, relationship discovery. Never deletes — only suggests reviews.
|
|
41
46
|
- **Transparent** — every memory has a human-readable `.md` file alongside the database. Export to Obsidian vault with one command.
|
|
42
|
-
- **Multi-project** — MCP roots
|
|
43
|
-
- **Freeform Ask** —
|
|
44
|
-
- **Hybrid Search** —
|
|
47
|
+
- **Multi-project** — MCP roots + per-tool `projectRoot` routing + central project registry. Multiple Cursor windows, zero conflicts.
|
|
48
|
+
- **Freeform Ask** — natural-language questions, synthesized answers with Obsidian wikilink citations.
|
|
49
|
+
- **Hybrid Search** — FTS5 keyword + semantic embeddings via Reciprocal Rank Fusion (RRF).
|
|
45
50
|
- **Versioned** — Git auto-commits every write. Full history, rollback, and diff support.
|
|
46
|
-
- **Obsidian-native** — `gnosys export` generates a full
|
|
51
|
+
- **Obsidian-native** — `gnosys export` generates a full vault with YAML frontmatter, `[[wikilinks]]`, summaries, and graph data.
|
|
47
52
|
- **MCP-first** — drops into Cursor, Claude Desktop, Claude Code, Cowork, Codex, or any MCP client with one config line.
|
|
48
53
|
- **Bulk import** — CSV, JSON, JSONL. Import entire datasets (USDA, NVD, your internal docs) in seconds.
|
|
49
|
-
- **
|
|
54
|
+
- **Backup & restore** — `gnosys backup` + `gnosys restore` for the central DB. Point-in-time recovery.
|
|
50
55
|
- **Zero infrastructure** — no external databases, no Docker (unless you want it), no cloud services. Just `npm install`.
|
|
51
56
|
|
|
52
57
|
---
|
|
@@ -275,33 +280,48 @@ ANTHROPIC_API_KEY = "your-key-here"
|
|
|
275
280
|
| `gnosys_stores` | Show active stores, MCP roots, and detected project stores |
|
|
276
281
|
| `gnosys_tags` | List tag registry |
|
|
277
282
|
| `gnosys_tags_add` | Add a new tag to the registry |
|
|
283
|
+
| **v3.0: Centralized Brain** | |
|
|
284
|
+
| `gnosys_projects` | List all registered projects in the central DB |
|
|
285
|
+
| `gnosys_backup` | Create a point-in-time backup of the central DB |
|
|
286
|
+
| `gnosys_restore` | Restore the central DB from a backup |
|
|
287
|
+
| `gnosys_migrate_to_central` | Migrate project data into the central DB |
|
|
288
|
+
| `gnosys_preference_set` | Set a user preference (stored as scoped memory) |
|
|
289
|
+
| `gnosys_preference_get` | Get one or all preferences |
|
|
290
|
+
| `gnosys_preference_delete` | Delete a preference |
|
|
291
|
+
| `gnosys_sync` | Regenerate agent rules file from preferences + conventions |
|
|
292
|
+
| `gnosys_federated_search` | Tier-boosted search across project → user → global scopes |
|
|
293
|
+
| `gnosys_detect_ambiguity` | Check if a query matches multiple projects |
|
|
294
|
+
| `gnosys_briefing` | Generate project briefing (categories, activity, tags, summary) |
|
|
295
|
+
| `gnosys_working_set` | Get recently modified memories for the current project |
|
|
278
296
|
|
|
279
297
|
---
|
|
280
298
|
|
|
281
299
|
## How It Works
|
|
282
300
|
|
|
283
|
-
|
|
301
|
+
### Central Brain (v3.0)
|
|
302
|
+
|
|
303
|
+
In v3.0, Gnosys uses a **central database** at `~/.gnosys/gnosys.db` as the single source of truth across all projects. Each project also has a local `.gnosys/` directory with a `gnosys.json` identity file:
|
|
284
304
|
|
|
285
305
|
```
|
|
306
|
+
~/.gnosys/
|
|
307
|
+
gnosys.db # ← v3.0 central brain (all projects, users, globals)
|
|
308
|
+
|
|
286
309
|
your-project/
|
|
287
310
|
.gnosys/
|
|
288
|
-
gnosys.
|
|
311
|
+
gnosys.json # ← v3.0 project identity (projectId, name, settings)
|
|
312
|
+
gnosys.db # per-project SQLite database (legacy + local reads)
|
|
289
313
|
decisions/ # dual-write .md files (human-readable safety net)
|
|
290
314
|
use-postgresql.md
|
|
291
315
|
architecture/
|
|
292
316
|
three-layer-design.md
|
|
293
|
-
usda-foods/
|
|
294
|
-
almond-butter-creamy.md
|
|
295
|
-
nvd-cves/
|
|
296
|
-
cve-2024-1234.md
|
|
297
|
-
gnosys.json # configuration
|
|
298
|
-
archive.db # legacy two-tier archive (pre-v2.0)
|
|
299
317
|
.config/tags.json # tag registry
|
|
300
318
|
CHANGELOG.md
|
|
301
319
|
.git/ # auto-versioned
|
|
302
320
|
```
|
|
303
321
|
|
|
304
|
-
|
|
322
|
+
`gnosys init` creates the project identity, registers the project in the central DB, and auto-detects your IDE (Cursor, Claude Code) for rules file generation.
|
|
323
|
+
|
|
324
|
+
All reads go through SQLite for sub-10ms performance. Writes dual-write to both `.md` files and the database. Run `gnosys migrate --to-central` to migrate existing v2.x project data into the central DB.
|
|
305
325
|
|
|
306
326
|
Each memory is an atomic Markdown file with YAML frontmatter:
|
|
307
327
|
|
|
@@ -558,9 +578,9 @@ The `gnosys_maintain` MCP tool lets agents trigger maintenance programmatically
|
|
|
558
578
|
|
|
559
579
|
---
|
|
560
580
|
|
|
561
|
-
## Agent-First SQLite Core
|
|
581
|
+
## Agent-First SQLite Core
|
|
562
582
|
|
|
563
|
-
Gnosys
|
|
583
|
+
Gnosys uses an **agent-first SQLite core**. In v3.0, the central `~/.gnosys/gnosys.db` holds all memories across all projects, with `project_id` and `scope` columns for multi-project isolation. The schema has six tables: `memories`, `memories_fts` (FTS5), `relationships`, `summaries`, `audit_log`, and `projects`.
|
|
564
584
|
|
|
565
585
|
### Migration
|
|
566
586
|
|
|
@@ -580,11 +600,12 @@ Migration is one-shot and safe — your `.md` files remain untouched. After migr
|
|
|
580
600
|
|
|
581
601
|
| Table | Purpose |
|
|
582
602
|
|-------|---------|
|
|
583
|
-
| `memories` | All memory data: frontmatter, content, embeddings
|
|
603
|
+
| `memories` | All memory data: frontmatter, content, embeddings, project_id, scope |
|
|
584
604
|
| `memories_fts` | FTS5 full-text index — auto-synced via INSERT/UPDATE/DELETE triggers |
|
|
585
605
|
| `relationships` | Typed edges between memories (wikilinks, Dream Mode discoveries) |
|
|
586
606
|
| `summaries` | Category-level summaries generated by Dream Mode |
|
|
587
607
|
| `audit_log` | Every operation logged with timestamps and trace IDs |
|
|
608
|
+
| `projects` | v3.0: Project identity registry (id, name, working_directory) |
|
|
588
609
|
|
|
589
610
|
The database uses WAL mode for concurrent access — multiple agents can read and write safely from parallel processes.
|
|
590
611
|
|
|
@@ -642,9 +663,9 @@ The `gnosys_dream` MCP tool lets agents trigger dream cycles programmatically.
|
|
|
642
663
|
|
|
643
664
|
---
|
|
644
665
|
|
|
645
|
-
## Multi-Project Support
|
|
666
|
+
## Multi-Project Support
|
|
646
667
|
|
|
647
|
-
Gnosys
|
|
668
|
+
Gnosys supports multiple projects in parallel — critical for developers using multiple Cursor windows or multi-root workspaces. In v3.0, the central DB's `projects` table acts as a registry, and federated search + ambiguity detection make cross-project workflows safe and predictable.
|
|
648
669
|
|
|
649
670
|
### The Problem
|
|
650
671
|
|
|
@@ -857,6 +878,21 @@ gnosys export --to <dir> --all # Include summaries, reviews, and graph
|
|
|
857
878
|
gnosys export --to <dir> --overwrite # Overwrite existing export
|
|
858
879
|
gnosys serve # Start MCP server (stdio)
|
|
859
880
|
gnosys serve --with-maintenance # MCP server + maintenance every 6h
|
|
881
|
+
|
|
882
|
+
# v3.0: Centralized Brain
|
|
883
|
+
gnosys projects # List all registered projects
|
|
884
|
+
gnosys backup # Backup the central DB
|
|
885
|
+
gnosys restore <file> # Restore central DB from backup
|
|
886
|
+
gnosys migrate --to-central # Migrate project data to central DB
|
|
887
|
+
gnosys pref set <key> <val> # Set a user preference
|
|
888
|
+
gnosys pref get [key] # Get one or all preferences (--json)
|
|
889
|
+
gnosys pref delete <key> # Delete a preference
|
|
890
|
+
gnosys sync # Regenerate agent rules from preferences
|
|
891
|
+
gnosys fsearch "query" # Federated search (project > user > global)
|
|
892
|
+
gnosys ambiguity "query" # Check for cross-project ambiguity
|
|
893
|
+
gnosys briefing # Project briefing (categories, activity, tags)
|
|
894
|
+
gnosys briefing --all # Briefings for all projects
|
|
895
|
+
gnosys working-set # Show implicit working set (recent memories)
|
|
860
896
|
```
|
|
861
897
|
|
|
862
898
|
---
|
|
@@ -875,41 +911,45 @@ npm run dev # Run MCP server in dev mode (tsx)
|
|
|
875
911
|
|
|
876
912
|
```
|
|
877
913
|
src/
|
|
878
|
-
index.ts
|
|
879
|
-
cli.ts
|
|
914
|
+
index.ts # MCP server — 47+ tools + gnosys://recall resource
|
|
915
|
+
cli.ts # CLI — full command suite with --json output
|
|
880
916
|
lib/
|
|
881
|
-
db.ts
|
|
882
|
-
dbSearch.ts
|
|
883
|
-
dbWrite.ts
|
|
884
|
-
migrate.ts
|
|
885
|
-
dream.ts
|
|
886
|
-
export.ts
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
917
|
+
db.ts # GnosysDB — central SQLite (6-table schema, project_id + scope)
|
|
918
|
+
dbSearch.ts # Adapter bridging GnosysDB to search interfaces
|
|
919
|
+
dbWrite.ts # Dual-write helpers (sync .md → gnosys.db)
|
|
920
|
+
migrate.ts # Migration: v1.x → v2.0 → v3.0 central DB
|
|
921
|
+
dream.ts # Dream Mode engine + idle scheduler
|
|
922
|
+
export.ts # Obsidian Export Bridge (gnosys.db → vault)
|
|
923
|
+
federated.ts # v3.0: Federated search, ambiguity detection, briefings, working set
|
|
924
|
+
preferences.ts # v3.0: User preferences as scoped memories
|
|
925
|
+
rulesGen.ts # v3.0: Agent rules generation (GNOSYS:START/END blocks)
|
|
926
|
+
projectIdentity.ts # v3.0: Project identity (gnosys.json) + central registry
|
|
927
|
+
store.ts # Core: read/write/update memory files (.md)
|
|
928
|
+
search.ts # FTS5 search and discovery
|
|
929
|
+
embeddings.ts # Lazy semantic embeddings (all-MiniLM-L6-v2)
|
|
930
|
+
hybridSearch.ts # Hybrid search with RRF fusion
|
|
931
|
+
ask.ts # Freeform Q&A with LLM synthesis + citations
|
|
932
|
+
llm.ts # LLM abstraction — System of Cognition (5 providers)
|
|
933
|
+
maintenance.ts # Auto-maintenance: decay, dedup, consolidation, archiving
|
|
934
|
+
archive.ts # Two-tier memory: active ↔ archive (SQLite)
|
|
935
|
+
recall.ts # Ultra-fast recall hook for agent orchestrators
|
|
936
|
+
audit.ts # Structured JSONL audit logging
|
|
937
|
+
lock.ts # File-level write locking + WAL helper
|
|
938
|
+
dashboard.ts # Aggregated system dashboard + performance monitoring
|
|
939
|
+
graph.ts # Persistent wikilink graph (graph.json)
|
|
940
|
+
tags.ts # Tag registry management
|
|
941
|
+
ingest.ts # LLM-powered structuring (with retry logic)
|
|
942
|
+
import.ts # Bulk import engine (CSV, JSON, JSONL)
|
|
943
|
+
config.ts # gnosys.json loader with Zod validation
|
|
944
|
+
retry.ts # Exponential backoff for LLM calls
|
|
945
|
+
resolver.ts # Layered multi-store resolution + MCP roots + multi-project
|
|
946
|
+
lensing.ts # Memory lensing (filtered views)
|
|
947
|
+
history.ts # Git history and rollback
|
|
948
|
+
timeline.ts # Knowledge evolution timeline
|
|
949
|
+
wikilinks.ts # Obsidian wikilink graph
|
|
950
|
+
bootstrap.ts # Bootstrap from source code
|
|
911
951
|
prompts/
|
|
912
|
-
synthesize.md
|
|
952
|
+
synthesize.md # System prompt template for ask engine
|
|
913
953
|
```
|
|
914
954
|
|
|
915
955
|
---
|
|
@@ -929,7 +969,7 @@ Real numbers from our demo vault (120 memories — 100 USDA foods + 20 NVD CVEs)
|
|
|
929
969
|
| Graph reindex (120 memories) | <1s |
|
|
930
970
|
| Storage per memory | ~1 KB `.md` file |
|
|
931
971
|
| Embedding storage (120 memories) | ~0.3 MB |
|
|
932
|
-
| Test suite |
|
|
972
|
+
| Test suite | 183 tests, 0 errors |
|
|
933
973
|
|
|
934
974
|
All benchmarks on Apple M-series hardware, Node.js 20+. Structured imports bypass LLM entirely. LLM-enriched imports depend on provider latency.
|
|
935
975
|
|
|
@@ -950,12 +990,12 @@ Gnosys is open source (MIT) and actively developed. Here's how to get involved:
|
|
|
950
990
|
- PRs welcome — especially for new import connectors, LLM providers, and Obsidian plugins
|
|
951
991
|
|
|
952
992
|
**What's next:**
|
|
993
|
+
- Multi-machine sync (central DB replication via network shares)
|
|
953
994
|
- Temporal memory versioning (valid_from / valid_until)
|
|
954
995
|
- Cross-session "deep dream" overnight consolidation
|
|
955
|
-
- Versioned export snapshots (Git-tagged)
|
|
956
|
-
- Docker Hub published image for one-line deployment
|
|
957
996
|
- Graph visualization in the dashboard
|
|
958
997
|
- Obsidian community plugin for native vault integration
|
|
998
|
+
- Docker Hub published image for one-line deployment
|
|
959
999
|
|
|
960
1000
|
---
|
|
961
1001
|
|
package/package.json
CHANGED