Surrealdbのロゴ

Surrealdb

コミュニティ
24601
surrealdb

Expert SurrealDB 3 architect and developer skill (tracks v3.1.4+). SurrealQL mastery, multi-model data modeling (document, graph, vector, time-series, geospatial), schema design, security, deployment, performance tuning, SDK integration (JS, Python, Go, Rust, Java, .NET, C, PHP, Swift, Kotlin, Ruby), Surrealism WASM extensions, SurrealML scope coverage (preview), built-in MCP (v3.1+) and standalone SurrealMCP, LangChain Python integration, editor tooling (LSP v0.1.6, tree-sitter, CodeMirror v1.0.6, VS Code/JetBrains/Neovim/Zed), and ecosystem integrations (Surrealist v3.9, Surreal-Sync, SurrealFS, SurrealKit v0.7, n8n, Agent Skills, setup-surreal). Universal skill for 30+ AI agents.

概要

公開者24601
リポジトリsurreal-skills
スキル名surrealdb
スター
34
フォーク
1
同梱ファイル
34
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 34個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    24601がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Surrealdb」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/24601/surreal-skills/tree/main
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/24601/surreal-skills.git \
  .claude/skills/surrealdb
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでSurrealdbを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にSurrealdbを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Surrealdbは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

SurrealDB 3 Skill

Expert-level SurrealDB 3 architecture, development, and operations. Covers SurrealQL, multi-model data modeling, graph traversal, vector search, security, deployment, performance tuning, SDK integration, and the wider SurrealDB ecosystem, including SurrealKit, SurrealMCP, n8n, CodeMirror, and agent-skill surfaces.

For AI Agents

Get a full capabilities manifest, decision trees, and output contracts:

bash
uv run {baseDir}/scripts/onboard.py --agent

See AGENTS.md for the complete structured briefing.

CommandWhat It Does
uv run {baseDir}/scripts/doctor.pyHealth check: verify surreal CLI, connectivity, versions
uv run {baseDir}/scripts/doctor.py --checkQuick pass/fail check (exit code only)
uv run {baseDir}/scripts/schema.py introspectDump full schema of a running SurrealDB instance
uv run {baseDir}/scripts/schema.py tablesList all tables with field counts and indexes
uv run {baseDir}/scripts/onboard.py --agentJSON capabilities manifest for agent integration

Prerequisites

  • surreal CLI -- brew install surrealdb/tap/surreal (macOS) or see install docs
  • Python 3.10+ -- Required for skill scripts
  • uv -- brew install uv (macOS) or pip install uv or see uv docs

Optional:

  • Docker -- For containerized SurrealDB instances (docker run surrealdb/surrealdb:v3)
  • SDK of choice -- JavaScript, Python, Go, Rust, Java, Kotlin, .NET, C, PHP, Swift, or Ruby

Security note: This skill documents package-manager and container installs only. Prefer auditable installs through Homebrew, apt/dnf, Cargo, npm, or Docker rather than remote one-line shell installers.

Quick Start

Credential warning: Examples below use root/root for local development only. Never use default credentials against production or shared instances. Create scoped, least-privilege users for non-local environments.

bash
# Start SurrealDB in-memory for LOCAL DEVELOPMENT ONLY
surreal start memory --user root --pass root --bind 127.0.0.1:8000

# Start with persistent RocksDB storage (local dev)
surreal start rocksdb://data/mydb.db --user root --pass root

# Start with SurrealKV (time-travel queries supported, local dev)
surreal start surrealkv://data/mydb --user root --pass root

# Connect via CLI REPL (local dev)
surreal sql --endpoint http://localhost:8000 --user root --pass root --ns test --db test

# Import a SurrealQL file
surreal import --endpoint http://localhost:8000 --user root --pass root --ns test --db test schema.surql

# Export the database
surreal export --endpoint http://localhost:8000 --user root --pass root --ns test --db test backup.surql

# Check version
surreal version

# Run the skill health check
uv run {baseDir}/scripts/doctor.py

Environment Variables

VariableDescriptionDefault
SURREAL_ENDPOINTSurrealDB server URLhttp://localhost:8000
SURREAL_USERRoot or namespace usernameroot
SURREAL_PASSRoot or namespace passwordroot
SURREAL_NSDefault namespacetest
SURREAL_DBDefault databasetest

These map directly to the surreal sql CLI flags (--endpoint, --user, --pass, --ns, --db) and are recognized by official SurrealDB SDKs.

Core Capabilities

SurrealQL Mastery

Full coverage of the SurrealQL query language: CREATE, SELECT, UPDATE, UPSERT, DELETE, RELATE, INSERT, LIVE SELECT, DEFINE, REMOVE, INFO, subqueries, transactions, futures, and all built-in functions (array, crypto, duration, geo, math, meta, object, parse, rand, string, time, type, vector).

See: rules/surrealql.md

Multi-Model Data Modeling

Design schemas that leverage SurrealDB's multi-model capabilities -- document collections, graph edges, relational references, vector embeddings, time-series data, and geospatial coordinates -- all in a single database with a single query language.

See: rules/data-modeling.md

Graph Queries

First-class graph traversal without JOINs. RELATE creates typed edges between records. Traverse with -> (outgoing), <- (incoming), and <-> (bidirectional) operators. Filter, aggregate, and recurse at any depth.

See: rules/graph-queries.md

Vector Search

Built-in vector similarity search using HNSW indexes (the v3 vector index type; brute-force is available as a fallback during index build/rebuild). Define vector fields, create indexes with configurable distance metrics (cosine, euclidean, manhattan, minkowski), and query with vector::similarity::* functions. Build RAG pipelines and semantic search directly in SurrealQL.

See: rules/vector-search.md

Security and Permissions

Row-level security via DEFINE TABLE ... PERMISSIONS, namespace/database/record-level access control, DEFINE ACCESS for JWT/token-based auth, DEFINE USER for system users, and $auth/$session runtime variables for permission predicates.

See: rules/security.md

Deployment and Operations

Single-binary deployment, Docker, Kubernetes (Helm charts), storage engine selection (memory, RocksDB, SurrealKV, TiKV for distributed), backup/restore, monitoring, and production hardening.

See: rules/deployment.md

Performance Tuning

Index strategies (unique, search, vector HNSW), query optimization with EXPLAIN, connection pooling, storage engine trade-offs, batch operations, and resource limits.

See: rules/performance.md

SDK Integration

Official SDKs for JavaScript/TypeScript (Node.js, Deno, Bun, browser), Python, Go, Rust, Java, Kotlin, .NET, C, PHP, Swift (iOS/macOS/visionOS), and Ruby. Includes the source-only C binding, Python v3 unreleased API boundary, .NET v0.10.2 beta surface, connection protocols, authentication flows, live query subscriptions, and typed record handling.

See: rules/sdks.md

Surrealism WASM Extensions

New in SurrealDB 3: extend the database with custom functions, analyzers, and logic written in Rust and compiled to WASM. Define, deploy, and manage Surrealism modules.

See: rules/surrealism.md

SurrealML In-Database Inference (preview / unstable)

surrealml has a GitHub v0.1.2 release, but PyPI still exposes surrealml 0.0.4 as the latest package as of this snapshot. The .surml artifact format and [sklearn], [torch], [tensorflow] extras are the stable documented boundary. The v1.4.0 documentation for DEFINE MODEL, INFO FOR MODEL, REMOVE MODEL, ml::name<version>(...), surreal ml import, db.upload_ml(...), and the SurMlFile.from_<framework>(...) factory methods was retracted in v1.4.1. The current Python setup path downloads native libraries from GitHub Releases unless LOCAL_BUILD=TRUE, so pin and audit before production use.

See: rules/surrealml.md

SurrealMCP -- Model Context Protocol Server

The official MCP server (surrealdb/surrealmcp) lets MCP-compatible AI hosts (Claude Desktop, Cursor, GitHub Copilot in VS Code, Zed, n8n) read and write SurrealDB through one configuration entry. Install from source (cargo install --path .) or Docker; not on crates.io or npm. Binary requires start subcommand. Tool wire-names are snake_case: query, select, insert, create, upsert, update, delete, relate, connect_endpoint, use_namespace, use_database, list_namespaces, list_databases, disconnect_endpoint, plus cloud tools.

See: rules/surrealmcp.md, skills/surrealmcp/SKILL.md

Editor Tooling

surrealql-language-server v0.1.3 is the first-party LSP baseline; surql-lsp v0.1.1 remains a separate community crate. The rule tracks tree-sitter, first-party editor extensions, and @surrealdb/codemirror / @surrealdb/lezer v1.0.5 for custom web editors. Per-extension command palettes and settings still need each extension README as source of truth.

See: rules/editor-tooling.md

LangChain Integration (Python only)

langchain-surrealdb 0.2.1 (Python; langchain-core ~= 1.1.0, surrealdb ~= 1.0.8 v1 SDK) exposes SurrealDB as a vector store via constructor SurrealDBVectorStore(embeddings, conn). JS package, async class, chat history, and hybrid retriever from v1.4.0 were retracted in v1.4.1.

See: rules/langchain.md

Ecosystem Integrations

Official-docs and first-party-adjacent surfaces that are not full dedicated rules yet: @surrealdb/n8n-nodes-surrealdb v0.6.0 for self-hosted n8n, the official AI framework docs index, Spectron / Agent Memory Context as roadmap-only, CodeMirror packages, and the official surrealdb/agent-skills repo. Use this rule to avoid presenting roadmap or pointer pages as production APIs.

See: rules/ecosystem-integrations.md

Ecosystem Tools

  • Surrealist -- Official IDE and GUI for SurrealDB (schema designer, query editor, graph visualizer)
  • Surreal-Sync -- Change Data Capture (CDC) for migrations from other databases
  • SurrealFS -- AI agent filesystem built on SurrealDB
  • SurrealKit -- Desired-state schema sync, rollout-based migrations, seeding, and declarative tests
  • SurrealML -- Preview-stage .surml artifact tooling; server invocation surface still unstable
  • SurrealMCP -- Model Context Protocol server for AI agents
  • n8n -- Official scoped community package for self-hosted n8n workflows
  • CodeMirror -- Official SurrealQL syntax packages for custom editors
  • setup-surreal -- Official GitHub Action (surrealdb/setup-surreal@v2) for running SurrealDB in CI workflows. Not a CLI bootstrap (the v1.4.0 documentation that described it as one was retracted in v1.4.2)

See: rules/surrealist.md, rules/surreal-sync.md, rules/surrealfs.md, rules/surrealkit.md, rules/surrealml.md, rules/surrealmcp.md, rules/ecosystem-integrations.md, rules/deployment.md (setup-surreal section)

Doctor / Health Check

bash
# Full diagnostic (Rich output on stderr, JSON on stdout)
uv run {baseDir}/scripts/doctor.py

# Quick check (exit code 0 = healthy, 1 = issues found)
uv run {baseDir}/scripts/doctor.py --check

# Check a specific endpoint
uv run {baseDir}/scripts/doctor.py --endpoint http://my-server:8000

The doctor script verifies: surreal CLI installed and on PATH, server reachable, authentication succeeds, namespace and database exist, version compatibility, and storage engine status.

Schema Introspection

bash
# Full schema dump (all tables, fields, indexes, events, accesses)
uv run {baseDir}/scripts/schema.py introspect

# List tables with summary
uv run {baseDir}/scripts/schema.py tables

# Inspect a specific table
uv run {baseDir}/scripts/schema.py table <table_name>

# Export schema as SurrealQL (reproducible DEFINE statements)
uv run {baseDir}/scripts/schema.py export --format surql

# Export schema as JSON
uv run {baseDir}/scripts/schema.py export --format json

Introspection uses INFO FOR DB, INFO FOR TABLE, and INFO FOR NS to reconstruct the full schema.

Rules Reference

Rule FileCoverage
rules/surrealql.mdSurrealQL syntax, statements, functions, operators, idioms
rules/data-modeling.mdSchema design, record IDs, field types, relations, normalization
rules/graph-queries.mdRELATE, graph traversal operators, path expressions, recursive queries
rules/vector-search.mdVector fields, HNSW indexes (the v3 vector index type), similarity functions, RAG patterns
rules/security.mdPermissions, access control, authentication, JWT, row-level security
rules/deployment.mdInstallation, storage engines, Docker, Kubernetes, production config; surrealdb/setup-surreal@v2 GitHub Action (CI-only; not a CLI bootstrap)
rules/performance.mdIndexes, EXPLAIN, query optimization, batch ops, resource tuning
rules/sdks.mdJS/TS, Python, Go, Rust, Java, Kotlin, .NET, C, PHP, Swift, Ruby SDK usage, connection patterns, live queries
rules/surrealism.mdWASM extensions, custom functions, Surrealism module authoring
rules/surrealml.mdSurrealML preview scope, .surml artifacts, package/release boundaries, native dependency warning
rules/surrealmcp.mdModel Context Protocol server: tool catalog, host configuration, transports, deployment
rules/editor-tooling.mdLSP, tree-sitter grammar, CodeMirror, VS Code / JetBrains / Neovim / Helix / Sublime / Zed extensions
rules/langchain.mdLangChain Python integration: vector store, constructor API, custom_filter boundary
rules/ecosystem-integrations.mdn8n, AI framework docs index, Spectron roadmap boundary, CodeMirror, official Agent Skills repo
rules/surrealist.mdSurrealist IDE/GUI usage, schema designer, query editor
rules/surreal-sync.mdCDC migration tool, source/target connectors, migration workflows
rules/surrealfs.mdAI agent filesystem, file storage, metadata, retrieval patterns
rules/surrealkit.mdDesired-state schema sync, rollout-based migrations, seeding, and declarative DB testing
rules/gotchas.mdCross-domain edge cases and footguns: upgrade, graph, vector, security, MCP, SDKs (v3.1.4+)

Workflow Examples

All workflow examples use root/root for local development only. For production, use DEFINE USER with scoped, least-privilege credentials.

New Project Setup

bash
# 1. Verify environment
uv run {baseDir}/scripts/doctor.py

# 2. Start SurrealDB
surreal start rocksdb://data/myproject.db --user root --pass root

# 3. Design schema (use rules/data-modeling.md for guidance)
# 4. Import initial schema
surreal import --endpoint http://localhost:8000 --user root --pass root \
  --ns myapp --db production schema.surql

# 5. Introspect to verify
uv run {baseDir}/scripts/schema.py introspect

Migration from SurrealDB v2

bash
# 1. Export v2 data
surreal export --endpoint http://old-server:8000 --user root --pass root \
  --ns myapp --db production v2-backup.surql

# 2. Review breaking changes (see rules/surrealql.md v2->v3 migration section)
# Key changes: range syntax 1..4 is now exclusive of end, new WASM extension system

# 3. Import into v3
surreal import --endpoint http://localhost:8000 --user root --pass root \
  --ns myapp --db production v2-backup.surql

# 4. Verify schema
uv run {baseDir}/scripts/schema.py introspect

Data Modeling for a New Domain

bash
# 1. Read rules/data-modeling.md for schema design patterns
# 2. Read rules/graph-queries.md if your domain has relationships
# 3. Read rules/vector-search.md if you need semantic search
# 4. Draft schema.surql with DEFINE TABLE, DEFINE FIELD, DEFINE INDEX
# 5. Import and test
surreal import --endpoint http://localhost:8000 --user root --pass root \
  --ns dev --db test schema.surql
uv run {baseDir}/scripts/schema.py introspect

Deploying to Production

bash
# 1. Read rules/deployment.md for storage engine selection and hardening
# 2. Read rules/security.md for access control setup
# 3. Read rules/performance.md for index strategy
# 4. Run doctor against production endpoint
uv run {baseDir}/scripts/doctor.py --endpoint https://prod-surreal:8000
# 5. Verify schema matches expectations
uv run {baseDir}/scripts/schema.py introspect --endpoint https://prod-surreal:8000

Upstream Source Check

bash
# Check if upstream SurrealDB repos have changed since this skill was built
uv run {baseDir}/scripts/check_upstream.py

# JSON-only output for agents
uv run {baseDir}/scripts/check_upstream.py --json

# Only show repos that have new commits
uv run {baseDir}/scripts/check_upstream.py --stale

Compares current HEAD SHAs and release tags of all tracked repos against the baselines in SOURCES.json. Use this to plan incremental skill updates.

Source Provenance

This skill was refreshed on 2026-06-17 from these upstream sources:

RepositoryReleaseSnapshot Date
surrealdb/surrealdbv3.1.42026-06-10
surrealdb/surrealistsurrealist-v3.9.02026-06-16
surrealdb/surrealdb.jsv2.0.32026-06-17
surrealdb/surrealdb.pyv2.0.0 (PyPI); main 3.0.0 unreleased2026-06-17
surrealdb/surrealkitv0.7.02026-06-11
surrealdb/surrealmcpv0.4.0 standalone; built-in MCP in 3.1+2026-06-17

Documentation: surrealdb.com/docs snapshot 2026-06-17.

Machine-readable provenance: SOURCES.json.

Output Convention

All Python scripts in this skill follow a dual-output pattern:

  • stderr: Rich-formatted human-readable output (tables, panels, status indicators)
  • stdout: Machine-readable JSON for programmatic consumption by AI agents

This means 2>/dev/null hides the human output, and piping stdout gives clean JSON for downstream processing.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Surrealdb」では何ができますか?

Expert SurrealDB 3 architect and developer skill (tracks v3.1.4+). SurrealQL mastery, multi-model data modeling (document, graph, vector, time-series, geospatial), schema design, security, deployment, performance tuning, SDK integration (JS, Python, Go, Rust, Java, .NET, C, PHP, Swift, Kotlin, Ruby), Surrealism WASM extensions, SurrealML scope coverage (preview), built-in MCP (v3.1+) and standalone SurrealMCP, LangChain Python integration, editor tooling (LSP v0.1.6, tree-sitter, CodeMirror v1.0.6, VS Code/JetBrains/Neovim/Zed), and ecosystem integrations (Surrealist v3.9, Surreal-Sync, Sur...

TypingMindでSurrealdbを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Surrealdbはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにSurrealdbをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/24601/surreal-skills/tree/mainを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Surrealdbを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Surrealdbで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもSurrealdbを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Surrealdb」は無料ですか?

はい。24601がMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇