# Build SurrealDB Python Applications

SurrealDB projects often need one guide for documents, graph traversal, vectors, and live queries. This skill gives Python-focused patterns for designing, querying, and tuning multi-model database features.

## Install

```bash
npx skillstore add activeinferenceinstitute/surrealdb-python
```

## Metadata

- Status: approved
- Slug: activeinferenceinstitute-surrealdb-python
- Skillstore revision: r1
- Version status: missing
- Tree hash: 180e090278b577ee04735db018e1a10fdab965331dee16b773a7137ff91e1e4c
- Author: ActiveInferenceInstitute
- GitHub username: ActiveInferenceInstitute
- License: MIT
- Repository: https://github.com/ActiveInferenceInstitute/Journal-Utilities/tree/main/.claude/skills/surrealdb-python
- Ref: d46e62089a6dfc9e14ea02eebd9b8e2ad2dfe1f4
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, network
- Quality score: 72
- Public page: https://skillstore.pages.dev/skills/activeinferenceinstitute-surrealdb-python
- Manifest: https://skillstore.pages.dev/api/skills/activeinferenceinstitute-surrealdb-python/manifest

## Capabilities

- Shows async SurrealDB connection, authentication, namespace selection, and cleanup patterns.
- Explains CRUD methods, merge updates, patch operations, upserts, deletes, and parameterized SurrealQL queries.
- Models graph data with RELATE statements, traversal syntax, edge metadata, constraints, and indexes.
- Guides vector storage, similarity search, hybrid retrieval, embedding choices, and RAG workflows.
- Covers live query subscriptions for real-time application updates.
- Provides reference guidance for schema design, performance tuning, and query safety.

## Use Cases

- Design Multi-Model Storage: Plan document tables, graph relationships, vector fields, and indexes for one SurrealDB-backed service.
- Build Semantic Retrieval: Create a Python RAG workflow that stores embeddings and retrieves relevant records with similarity search.
- Model Connected Knowledge: Represent entities, edge metadata, recursive traversals, and recommendation paths with SurrealDB graph features.

## Prompt Templates

### Create a Connection Plan

```
Use this skill to create a SurrealDB Python connection plan. Include authentication, namespace selection, async cleanup, and error handling.
```

### Design CRUD Operations

```
Use this skill to design CRUD operations for my SurrealDB table. Include create, merge, patch, upsert, delete, and safe parameters.
```

### Model a Graph Workflow

```
Use this skill to model my domain as a SurrealDB graph. Include RELATE statements, edge metadata, traversal queries, and indexes.
```

### Plan a RAG Architecture

```
Use this skill to plan a production RAG design with SurrealDB. Cover vector fields, embedding choices, hybrid search, graph filters, and live updates.
```

## Limitations

- It is guidance only and does not install, start, or administer a SurrealDB server.
- Examples target SurrealDB 2.3.x and may need changes for other versions.
- It does not manage production credentials, secrets, backups, or access policies.
- Embedding providers and model packages may require separate installation, keys, and cost controls.

## Best Practices

- Parameterize SurrealQL queries and keep database credentials in a secret manager.
- Define schemas, assertions, and indexes before moving SurrealDB workloads to production.
- Benchmark embedding models, vector dimensions, and k values with realistic data.

## Anti Patterns

- Do not reuse sample root credentials outside isolated local testing.
- Do not concatenate user input into raw SurrealQL query strings.
- Do not run recursive graph traversals without depth limits or timeouts.

## Security Audit

- Audited at: 2026-07-07T18:11:56.953\+00:00
- Summary: All 56 static detections were false positives from Markdown fences, inline SurrealQL syntax, database examples, and reference links. I found no prompt injection, exfiltration intent, unauthorized network calls, or shell execution in the reviewed files. One low-risk documentation issue remains: sample root credentials appear in local examples.

## Stats

- Views: 371
- Downloads: 11
- Favorites: 0
- Popularity score: 0
