| ▲ | Show HN: SQLite Graph Ext – Graph database with Cypher queries (alpha)(github.com) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 points by gwillen85 6 days ago | 17 comments | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I've been working on adding graph database capabilities to SQLite with support for the Cypher query language. As of this week, both CREATE and MATCH operations work with full relationship support. Here's what it looks like: 
The interesting part was building the complete execution pipeline - lexer, parser, logical planner, physical planner, and an iterator-based executor using the Volcano model. All in C99 with no dependencies beyond SQLite.What works now: - Full CREATE: nodes, relationships, properties, chained patterns (70/70 openCypher TCK tests) - MATCH with relationship patterns: (a)-[r:TYPE]->(b) with label and type filtering - WHERE clause: property comparisons on nodes (=, >, <, >=, <=, <>) - RETURN: basic projection with JSON serialization - Virtual table integration for mixing SQL and Cypher Performance: - 340K nodes/sec inserts (consistent to 1M nodes) - 390K edges/sec for relationships - 180K nodes/sec scans with WHERE filtering Current limitations (alpha): - Only forward relationships (no `<-[r]-` or bidirectional `-[r]-`) - No relationship property filtering in WHERE (e.g., `WHERE r.weight > 5`) - No variable-length paths yet (e.g., `[r*1..3]`) - No aggregations, ORDER BY, property projection in RETURN - Must use double quotes for strings: {name: "Alice"} not {name: 'Alice'} This is alpha - API may change. But core graph query patterns work! The execution pipeline handles CREATE/MATCH/WHERE/RETURN end-to-end. Next up: bidirectional relationships, property projection, aggregations. Roadmap targets full Cypher support by Q1 2026. Built as part of Agentflare AI, but it's standalone and MIT licensed. Would love feedback on what to prioritize. GitHub: https://github.com/agentflare-ai/sqlite-graph Happy to answer questions about the implementation!  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | mentalgear 6 days ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I like the ambition and the open-source spirit behind your project! Open-source graph databases are fantastic. That said, I’d encourage you to consider leveraging existing projects rather than starting from scratch. There are already mature, local / in-browser graph databases that could benefit from your skills and vision. For example: - Kuzu https://github.com/kuzudb/kuzu: This project had very active development but was recently archived (as of October 10, 2025). Continuiing or forking it could be a game-changer for the community. - Cozodb https://www.cozodb.org/ It’s very feature-rich and actively seeking contributors. Your expertise could help push it even further. I do get the appeal of building something from the ground up; it’s incredibly rewarding. But achieving production readiness is seriously challenging and time-consuming. These projects are already years ahead in scope, so contributing to them could accelerate your impact and save you from reinventing the wheel.  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | leetrout 6 days ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I have an ELI5 question... So you're doing the planning and execution which results in what? Some direct calls into sqlite that create tables? Under the hood is this using tables in a conventional manner where there are adjacency lists or just edges and vertexes or ... ? I'm looking at `graphFindEdgesByType` and it says they're done with SQL queries - are you effectively transpiling some of the Cypher or just have routines that build queries as needed? Thanks!  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | jeffreyajewett 6 days ago | parent | prev | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nothing says weekend project like writing a Cypher planner from scratch in C99. We also recently launched AgentML -> check it out https://github.com/agentflare-ai/agentml (ALSO MIT)  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | ble 5 days ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
What kind of constraints can you add? Could I put a unique constraint on property `id` of all nodes with label X? Could I put a constraint that edges of kind A must always go from nodes with label X to nodes with label Y? What kind of indices can you add? Will SQLite use them when you do a Cypher query? Will your Cypher query planner take them into account?  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||