Introducing Surrealism

Published: (February 19, 2026 at 01:38 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

Overview

Surrealism is an open‑source extension framework for SurrealDB that brings true extensibility directly inside the database. It allows developers to define modular, programmable logic using functions written in Rust, which are compiled to WebAssembly and executed at runtime. Future support for additional languages such as JavaScript and Python is planned.

Features

Extensible Logic Inside the Database

  • Replaces brittle scripts, heavyweight external services, or application‑layer logic with fast, secure, and testable database‑side functions.
  • Provides version‑controlled, shareable modules for custom business logic and access‑control layers.
  • Executes with full transactional guarantees, suitable for dynamic API behaviours, policy enforcement, and auditing.

WebAssembly Execution

  • Functions compile to WebAssembly, running in a deterministic, sandboxed environment.
  • Near‑native performance with strict isolation between functions.
  • Ideal for both single‑tenant systems and multi‑tenant clusters where isolation and efficiency are critical.

Dynamic Plugin Management

  • Plugins can be loaded from local disk, object storage, or uploaded directly into SurrealDB.
  • Enable and execute plugins dynamically without restarting the database.
  • Fine‑grained permission controls determine who can load or invoke plugins.

Development Experience

  • Developers can use their own Rust libraries, tools, and frameworks.
  • Tests can be written in Rust and integrated into CI/CD pipelines.
  • Plugins are defined in simple projects with metadata in a TOML file and compiled into portable WebAssembly binaries.
  • Versioning and sharing of plugins follow the same workflow as other application components.

AI Integration

Surrealism enables direct integration with AI models, both local and remote:

  • Plugins can interact with GPU‑accelerated inference runtimes or call external APIs for tasks such as text or image generation, classification, tokenisation, embedding, and translation.
  • Example workflow: a plugin receives user input, runs it through a local LLM, and stores the generated result—all within a single SurrealQL query.
  • Plugins have full access to SurrealDB’s query engine, schema, and file functionality, allowing them to work with structured data, unstructured content, and multi‑model assets in a unified system.

Sample Use Cases

  • Sentiment analysis on inserted documents.
  • Similarity scoring against vector indexes.
  • Vision models extracting structured data from uploaded files.
  • Transcribing audio, extracting named entities, enriching results with remote models, and saving the output—all in one transactional flow.

Getting Started

Surrealism is available today for developing custom or business logic directly within SurrealDB. To begin building extensions, refer to the Surrealism Documentation. Contributions and extensions can be shared via the project’s Discord channel.

0 views
Back to Blog

Related posts

Read more »

Apex B. OpenClaw, Local Embeddings.

Local Embeddings para Private Memory Search Por default, el memory search de OpenClaw envía texto a un embedding API externo típicamente Anthropic u OpenAI par...