surrealdb/agent-skills

surrealdb-python

Using SurrealDB with the Python SDK, covering both client/server mode (WebSocket) and embedded mode (in-memory or file-based).

First seen Apr 11, 2026

Installation

$ npx skills add surrealdb/agent-skills --skill surrealdb-python

Summary

  • Using SurrealDB with the Python SDK, covering both client/server mode (WebSocket) and embedded mode (in-memory or file-based).
  • Use when connecting to SurrealDB from Python, using the surrealdb Python package, running SurrealDB embedded without a server, or performing CRUD operations from Python code.
  • Triggers: surrealdb Python, Surreal(), AsyncSurreal(), Python SDK, embedded SurrealDB, mem://, file://.

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from surrealdb/agent-skills.

npx skills add surrealdb/agent-skills

Browse all from surrealdb/agent-skills

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Repository health

Stars 25
License LICENSE
Default branch main
Open issues 0
Status Active

Skill metadata

Parsed from SKILL.md frontmatter.

Version0.1.0
More metadata
author
surrealdb
version
0.1.0

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,150 B
  • docs SUMMARY.md 429 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 268 installs

SKILL.md

SurrealDB Python SDK

Running SurrealDB (Server Mode)

Persist data with RocksDB:

surreal start -u root -p root rocksdb:database

In-memory:

surreal start -u root -p root

Client/Server Mode

Connect via WebSocket using the Surreal context manager:

from surrealdb import Surreal

with Surreal("ws://localhost:8000/rpc") as db:
    db.signin({"username": "root", "password": "root"})
    db.use("namespace_test", "database_test")

    db.create(
        "person",
        {
            "user": "me",
            "password": "safe",
            "marketing": True,
            "tags": ["python", "documentation"],
        },
    )

    print(db.select("person"))

    print(db.update("person", {
        "user": "you",
        "password": "very_safe",
        "marketing": False,
        "tags": ["Awesome"],
    }))

    print(db.delete("person"))

    db.query("""
    insert into person {
        user: 'me',
        password: 'very_safe',
        tags: ['python', 'documentation']
    };
    """)

    print(db.query("select * from person"))

    print(db.query("""
    update person content {
        user: 'you',
        password: 'more_safe',
        tags: ['awesome']
    };
    """))

    print(db.query("delete person"))

Embedded Mode

Run SurrealDB directly inside your Python process — no server required.

  • In-memory: Surreal("mem://") / AsyncSurreal("mem://")
  • File-based persistence: Surreal(f"file://{dbpath}") / AsyncSurreal(f"file://{dbpath}")

See [references/embedded.md](references/embedded.md) for a complete async example with file-based persistence.