Repository navigation
feat(#317): SQLite knowledge graph storage (schema v7) - #332
Merged
Merged
Conversation
- Schema v7: graph_nodes + graph_edges tables - GraphStore: upsert_node, add_edge, find_node, neighbors, find_path - BFS pathfinding with parent tracking - query_relation: (source, edge, target) triples - stats: node/edge count, relation types - 16 graph tests - Foreign keys enabled (PRAGMA foreign_keys=ON) - Backward compatible: relationship metadata system preserved Part 1 of #317 — CLI + remember integration next.
- CLI: `uteke graph nodes/edges/neighbors/path/query/stats` - Human-readable + JSON output for all subcommands - BFS pathfinding with node labels - GraphStore accessible via uteke.graph_store() - Store.conn made pub for graph access Closes #317
| pub struct GraphPath { | ||
| pub nodes: Vec<GraphNode>, | ||
| pub edges: Vec<GraphEdge>, | ||
| pub total_weight: f64, |
| } | ||
|
|
||
| /// Get or create a node by label. Returns node ID. | ||
| /// Idempotent — if a node with the same label exists, returns its ID. |
| 5 => self.migrate_v4_to_v5()?, | ||
| // v6: Content type column (text vs json) | ||
| 6 => self.migrate_v5_to_v6()?, | ||
| // v7: Knowledge graph tables (graph_nodes, graph_edges) |
🔍 Cora AI Code Review❌ Blocked — critical issues found. 🔴 Error (3)
Review powered by cora-cli · BYOK · MIT |
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
* feat(#317): graph core — schema v7, GraphStore, BFS pathfinding - Schema v7: graph_nodes + graph_edges tables - GraphStore: upsert_node, add_edge, find_node, neighbors, find_path - BFS pathfinding with parent tracking - query_relation: (source, edge, target) triples - stats: node/edge count, relation types - 16 graph tests - Foreign keys enabled (PRAGMA foreign_keys=ON) - Backward compatible: relationship metadata system preserved Part 1 of #317 — CLI + remember integration next. * feat(#317): graph CLI — uteke graph subcommand + GraphStore accessor - CLI: `uteke graph nodes/edges/neighbors/path/query/stats` - Human-readable + JSON output for all subcommands - BFS pathfinding with node labels - GraphStore accessible via uteke.graph_store() - Store.conn made pub for graph access Closes #317
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #317
Changes
Schema v7
graph_nodes(id, label, entity_type, properties_json, memory_id, created_at)graph_edges(id, source_id, target_id, relation, weight, created_at)GraphStore (crates/uteke-core/src/graph.rs)
upsert_node()— get-or-create by label (case-insensitive)add_edge()— INSERT OR IGNORE (idempotent, logs duplicates)find_node()/get_node()— lookup by label or IDneighbors()— outgoing edges via BFS up to depth Nfind_path()— shortest path via BFS with parent trackingquery_relation()— (source, edge, target) triplesall_nodes()/all_edges()/stats()CLI:
uteke graphAll support
--jsonoutput.Backward compatible
PRAGMA foreign_keys=ONTests
cargo test --workspace✅ (162 passed, 5 ignored)cargo clippy --workspace -- -D warnings✅cargo fmt --all✅