Add multi-graph support (Milestone 9)

- Graph manager: create, list, delete, use graphs
- Automatic project detection via .cortex.json or git remote
- Graph switching in db.ts connection manager
- Cross-graph search with --all-graphs flag
- CLI: graphs, use, init commands
- MCP tools: memory_graphs, memory_use_graph, memory_create_graph, memory_delete_graph
- Database migration from .memory to ~/.cortex/graphs
This commit is contained in:
2026-02-03 11:25:44 +01:00
parent 45998c73d0
commit aea3e93ff7
6 changed files with 833 additions and 4 deletions

View File

@@ -22,7 +22,9 @@ import { ingestCommand, clipCommand } from './commands/ingest';
import { exportCommand, vizCommand } from './commands/export';
import { importCommand } from './commands/import';
import { backupCommand, restoreDbCommand, listBackupsCommand } from './commands/backup-cmd';
import { graphsCommand, useCommand, initCommand } from './commands/graphs';
import { closeDb } from '../core/db';
import { migrateOldDatabase } from '../core/db';
const program = new Command();
@@ -62,6 +64,12 @@ program.addCommand(importCommand);
program.addCommand(backupCommand);
program.addCommand(restoreDbCommand);
program.addCommand(listBackupsCommand);
program.addCommand(graphsCommand);
program.addCommand(useCommand);
program.addCommand(initCommand);
// Check for old database migration
migrateOldDatabase();
program.hook('postAction', () => {
closeDb();