surrealdb-python

surrealdb-python is a skill for Claude Code, Codex from surrealdb/agent-skills. It costs 95 tokens per session (535 once invoked), scanned A, original, MIT.

A Python toolkit for working with SurrealDB, a database that can run as a separate service or inside your application. It covers connections, queries, and basic data changes.

In plain words
What is it for?
Use it to connect to SurrealDB, choose a namespace and database, create and read records, update or delete them, and run database queries.
Why use it?
It gives Python code one approach for using SurrealDB whether the database is remote, local, in memory, or stored in a file.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/surrealdb/agent-skills/surrealdb-python
Any agent
npx skills add surrealdb/agent-skills --skill surrealdb-python
Clone the repo
git clone --depth 1 https://github.com/surrealdb/agent-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for surrealdb-python

README.md
[![agentmods](https://agentmods.dev/badge/skills/surrealdb/agent-skills/surrealdb-python.svg)](https://agentmods.dev/skills/surrealdb/agent-skills/surrealdb-python)
Your own site
<a href="https://agentmods.dev/skills/surrealdb/agent-skills/surrealdb-python"><img src="https://agentmods.dev/badge/skills/surrealdb/agent-skills/surrealdb-python.svg" alt="Measured on agentmods" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 535 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00095 $0.00535
Opus 5 $0.00048 $0.00267
Sonnet 5 $0.00019 $0.00107
Haiku 4.5 $0.00010 $0.00053

Measured 5d ago against content hash 0a19921355a3, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

surrealdb-python scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/surrealdb-python/SKILL.md · 87 lines

What it actually says

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://{db_path}") / AsyncSurreal(f"file://{db_path}")

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

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 87 lines · 95 tokens per session scan A 0a19921355a3

Subscribe to this mod's changes

surrealdb-python is a skill published in the GitHub repository surrealdb/agent-skills (25 stars, last pushed 2mo ago), licensed MIT. It adds 95 tokens to every session and 535 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

django-models

Design Django ORM models for Sentry following architectural conventions for silos, replication, relocation, and foreign keys. Use when adding a new Django model, designing a model for a feature, deciding where data should live, picking a foreign key type, or refactoring an existing model's silo placement. Trigger on…

getsentry/sentry · 141 tokens

adding-personhog-rpc

Guide for adding a new RPC to personhog-replica and personhog-router. Covers eligibility checks, proto definition, code generation for Python and Node.js clients, Rust implementation (storage trait, postgres queries, service handler, router wiring), and index compatibility validation. Use when adding a new gRPC…

PostHog/posthog · 88 tokens

azure-cosmos-db-py

Build Azure Cosmos DB NoSQL services with Python/FastAPI following production-grade patterns. Use when implementing database client setup with dual auth (DefaultAzureCredential + emulator), service...

benjaminasterA/antigravity-awesome-skills · 42 tokens

azure-cosmos-py

Client library for Azure Cosmos DB NoSQL API — globally distributed, multi-model database.

benjaminasterA/antigravity-awesome-skills · 0 tokens

azure-data-tables-py

NoSQL key-value store for structured data (Azure Storage Tables or Cosmos DB Table API).

benjaminasterA/antigravity-awesome-skills · 0 tokens

alembic

Manage database migrations with Alembic. Use when a user asks to version database schemas, create migration scripts, handle schema changes in production, or manage SQLAlchemy model migrations.

TerminalSkills/skills · 39 tokens