Add 7 living memory tools: split, merge, dedupe, prune, reorganize, bulk_tag, stats
This commit is contained in:
@@ -57,6 +57,12 @@ export function getConnections(nodeId: string): { incoming: (Edge & { node: Node
|
||||
};
|
||||
}
|
||||
|
||||
export function getEdgesByNode(nodeId: string): Edge[] {
|
||||
const db = getDb();
|
||||
const rows = db.prepare('SELECT * FROM edges WHERE from_id = ? OR to_id = ?').all(nodeId, nodeId) as any[];
|
||||
return rows.map(rowToEdge);
|
||||
}
|
||||
|
||||
export function buildTree(rootId?: string): TreeNode[] {
|
||||
const db = getDb();
|
||||
const edges = db.prepare('SELECT * FROM edges').all() as any[];
|
||||
|
||||
Reference in New Issue
Block a user