Getting Started with AstraeaDB

Why Graphs, and Why Now: An Introduction to AstraeaDB

On this page

Nodes, edges, and embeddings are the building blocks, and AstraeaDB is a database built to keep them together.

Almost everything interesting about your data lives in the connections between things: which customers bought which products, who cites whom in a research paper, or which account sent money to which other account at 3 a.m. Yet most of us store that connection-rich data in tables, then spend our careers fighting the database to get the connections back out. This post is a gentle introduction to graph databases, and to AstraeaDB, a database that pairs the classic graph way of storing connections with a newer technique for finding items by their meaning, called vector search. There is no R or Python code here yet, only the ideas, with the hands-on tutorials to follow.

Tables are great, until you need relationships

The relational model, the familiar way of organizing data into tables of rows and columns, is one of the best ideas in computing. It has a catch, though: it stores relationships only indirectly. To connect two tables, you place a shared value (called a foreign key) in each one, then match them up when you ask your question, using an operation called a JOIN that stitches rows from different tables together. A question like "who are my customers' customers?" forces you to join a table to itself. A deeper one, such as "find every chain of purchases connecting these two people, up to six steps apart," pushes you into long, repetitive queries, or into exporting the data to another tool to analyze it.

The trouble is not that table-based databases cannot answer these questions, but that relationships are an afterthought. Every question about connections costs a JOIN, and deeper questions cost more of them.

A graph stores relationships directly

A graph turns this around. It is built from just two kinds of pieces.

Both nodes and edges can carry properties, which are simple pieces of labeled information like a name, a year, or a weight. Nodes can also carry labels that record what type of thing they are, such as Person or Movie. That is the entire data model. Here is a tiny movie example described in words.

(Keanu Reeves:Person) --ACTED_IN--> (The Matrix:Movie) --IN_GENRE--> (Sci-Fi:Genre)

Because each edge is a real, stored object, following it from one node to the next is fast. This step-by-step following is called traversing the graph, or a traversal, and finding a node's immediate neighbors is a direct lookup, not a table join. That one difference makes a whole class of questions easy to ask:

Many graph databases let you ask questions in a language designed for graphs. One well-known example is Cypher, and a related standard is GQL, short for Graph Query Language. Such languages let you describe the pattern you are looking for almost as if you were drawing it:

MATCH (p:Person)-[:ACTED_IN]->(m:Movie)-[:IN_GENRE]->(:Genre {name: "Sci-Fi"})
RETURN p.name, m.title

That query reads almost like the picture it matches, and that resemblance is exactly the point.

Adding AI: meaning can live in the graph too

Something important has changed in recent years. Modern artificial intelligence can turn a piece of content into a list of numbers that captures its meaning. Such a list is called a vector, and the vector produced for a specific item is called its embedding. You can picture each embedding as a point in space, where items with similar meaning sit close together and unrelated items sit far apart. Once a movie's plot or a paragraph of text has been turned into an embedding, you can find similar items by looking for the stored embeddings closest to it. That ability powers semantic search, that is, search based on meaning rather than exact keywords. It also powers a technique called retrieval-augmented generation, or RAG, which fetches relevant information first and then asks an AI language model to write its answer using that information.

Until recently, using embeddings meant running a separate specialized system called a vector database next to your graph or table-based database, plus extra code to keep the two copies of your data in step. Yet questions about how your data is connected and what it means are usually about the same things, so two systems mean avoidable work and a risk that they drift out of sync.

A vector-property graph keeps both in one place. Every node can carry its own embedding, stored right next to that node's edges and properties and organized with a special index so the closest embeddings can be found quickly even across millions of nodes. (An index is simply a supporting structure that makes searching fast, like the index at the back of a book.) With everything in one store, you can ask questions that neither a plain graph nor a plain vector database handles well alone:

Meet AstraeaDB

AstraeaDB is a graph database written in the Rust programming language and designed with these AI uses in mind. At its heart is the vector-property graph described above: nodes with labels, edges with types, properties on both, and an embedding on each node. Those embeddings are organized by an index called HNSW, short for Hierarchical Navigable Small World, a well-known method for finding the closest embeddings quickly without checking every single one. Because the connections and the embeddings share one store, following relationships and searching by meaning happen side by side. Building on that foundation, AstraeaDB offers several capabilities:

The ecosystem: one server, many front doors

AstraeaDB runs as a server that your program connects to. It understands several communication methods, so you can pick the one that fits your setup:

Surrounding the server is a growing collection of client libraries, small packages that let you use AstraeaDB from a language you already know:

Because AstraeaDB is open source, its core building blocks are also published as Rust packages (which Rust calls crates) on crates.io, so a Rust program can build the database engine in directly and run without a separate server.

Where to go from here

To sum up: relationships are stored directly as data, embeddings sit right next to them, and a single store can answer questions about structure, about meaning, and about both at once, along with graph analytics, time-travel queries, and GraphRAG.

The rest of this series is hands-on. Each language has its own three-part track that builds the same small movie knowledge graph step by step, starting from a first simple example and moving on to recommendations, graph algorithms, and GraphRAG.

Choose the language you are most comfortable with, start a server, and work through its track at your own pace.