Skip to content

Get started

Getting started

SurrealDB stores relational, document, graph, time-series, vector and full-text data in one engine, queried through SurrealQL and reachable from ten official SDKs. It runs embedded in your application, as a single node, or as a distributed cluster, and SurrealDB Cloud runs it for you, on dedicated instances or serverless on SurrealDB Earth.

Set me up for SurrealDB. Fetch https://surrealdb.com/docs/agents/instructions.md and follow it.

Your agent installs SurrealDB's Agent Skills and connects to the SurrealDB MCP server, ready to write SurrealQL against a real database.

Setup steps for each agent

If you have not used a database before, Database basics explains the ideas that the rest of the documentation builds on.

SurrealQL is SQL-shaped, so most of it reads as you would expect. What it adds is the ability to relate records directly and traverse those relations in the same statement, without a join table or a second database. Edit and run this:

The querying guide covers the language properly, and data models covers what else the engine stores.

Choose a language to see how a first connection looks, then continue in that language's quickstart, which goes on to insert and query data.

cargo add surrealdb --features kv-mem,protocol-ws
cargo add tokio --features macros,rt-multi-thread
use surrealdb::engine::remote::ws::Ws;
use surrealdb::opt::auth::Root;
use surrealdb::Surreal;

#[tokio::main]
async fn main() -> surrealdb::Result<()> {
    let db = Surreal::new::<Ws>("127.0.0.1:8000").await?;

    db.signin(Root {
        username: "root".to_string(),
        password: "secret".to_string(),
    })
    .await?;

    db.use_ns("main").use_db("main").await?;

    Ok(())
}

The Rust quickstart continues with inserting and querying data, and the Rust SDK reference covers every method.

Each tab holds the first connection from that language's quickstart, which stays the full guide. The SDKs page lists all ten, community SDKs cover further languages, and the React Native and Expo guide covers mobile.

Was this page helpful?

Last updated