A Graph Database in Your Pocket: Relate, Extensions, and an iOS Reading App Developer William Lyon built relate-book, a graph database of his 2,002-item Amazon book wishlist, on Relate, an open source Apache-2.0 embedded single-process graph database that speaks Cypher and stores its entire graph in a single .rl file. The project relies on two Relate features: extensions, which package an import script as an installable CLI command run via `relate run -d ./store.rl`, and the Relate Swift client, which lets an iOS app open the same file, add ratings and notes, and combine vector search with graph patterns to explain recommendations. Relate is optimized for AI-agent use cases such as agent memory and agentic coding workflows, and fits only when the graph belongs to one application, lives on one machine, and fits in that machine's memory. A Graph Database in Your Pocket: Relate, Extensions, and an iOS Reading App William Lyon November 17, 2026 25 min read For years I've been using an Amazon wishlist to keep track of my book readling list. Amazon wishlists aren't a great fit for this purpose since they're optimized for keeping track of things to buy, so unfortunately my wishlist is where book recommendations go to be forgotten. It's now 2,002 items long, and it's a flat list without much search functionality or ability to surface what I should read next. The questions I actually want to ask about my reading are graph questions. Which books share a location? Which authors keep showing up? Given what I've read and liked, what should I read next? So I built relate-book https://github.com/johnymontana/relate-book : one graph of my reading list, stored in Relate https://relatedb.ai , an embedded graph database. In this post I want to talk about two import aspects of Relate that made this project possible: 1. Relate extensions, and 2. The Relate Swift client together is that the graph is one file. A Relate extension builds the file on a laptop with one command, then because a relate graph is a single file an iPhone app opens the same file with the same engine, adds my ratings and notes to it, and uses the graph to expand search results and explain recommendations. What you'll learn: what Relate is and where it fits, how a Relate extension works and how I built one, how to embed Relate in an iOS app with its Swift client, and how the app combines vector search with graph patterns. Who this is for: developers who know some Cypher and are curious about embedded graph databases. The iPhone half assumes you can read Swift. What Is Relate? what-is-relate what-is-relate Relate https://relatedb.ai is an open source Apache-2.0 , embedded, single-process graph database that speaks Cypher. The engine runs inside your process, so there's no server to deploy and no account to create. It's optimized for AI agents for use cases like agent memory and agentic coding workflows. If you've used SQLite then you already have the right mental model: a database that's a library plus a file, not a service. The store is a single .rl file, a directory, or :memory: . There are several ways to use Relate: the CLI, eight language clients, and relate serve which serves HTTP and MCP APIs. This post uses four of its features: Cypher, the single-file store, vector and full-text indexes behind a SEARCH clause, and extensions. So where does Relate fit? It fits when the graph belongs to one application, lives on one machine, and fits in that machine's memory. The whole graph lives in RAM, with no paging to disk, and a store has one writing process at a time. A phone app is exactly that shape. It's not the right choice when you have many writers, data bigger than memory, or a need for clustering. The Relate docs are upfront about this in Where relate fits https://relatedb.ai/docs/concepts/where-relate-fits/ . The same file also opens from Python pip install relate-db , from an agent over the Model Context Protocol, or MCP relate serve --mcp stdio , and from Neo4j drivers over Bolt relate serve --bolt 7687 . I won't cover those here, but check out the Relate docs https://relatedb.ai/docs/ for more specifics. Extensions Teach Relate New Commands extensions-teach-relate-new-commands extensions-teach-relate-new-commands Every graph project starts with an import script. Relate extensions make that script a first-class, installable command in the Relate CLI: relate run