Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Default Plugins

AeorDB ships first-party WASM query plugins under aeordb-plugins/. Release WASM builds for these plugins are embedded into the AeorDB server binary and installed at startup into user-accessible plugin paths.

On startup, AeorDB installs these bundled plugins if they are missing. If a plugin already exists at a bundled path, AeorDB overwrites it only when both conditions are true:

  • The stored plugin ID matches the bundled plugin ID.
  • The bundled plugin version is greater than or equal to the stored plugin version.

This makes checksum drift a signal, not the authority. A stored plugin at the same path with a different plugin ID is treated as user-managed and left untouched. A stored plugin with the bundled ID but a newer version is also left untouched to avoid downgrades.

PluginPlugin IDVersionAuthorPublic invoke path
extract/org/aeordev/aeordb/plugins/extract0.1.0AeorDBPOST /plugins/extract/invoke
jq/org/aeordev/aeordb/plugins/jq0.1.0AeorDBPOST /plugins/jq/invoke

If you change a default plugin’s source, rebuild its WASM and refresh the embedded copy before rebuilding AeorDB:

cd aeordb-plugins/extract-plugin
cargo build --target wasm32-unknown-unknown --release
cp target/wasm32-unknown-unknown/release/aeordb_extract_plugin.wasm \
  ../../aeordb-lib/src/plugins/bundled/extract.wasm

cd ../jq-plugin
cargo build --target wasm32-unknown-unknown --release
cp target/wasm32-unknown-unknown/release/aeordb_jq_plugin.wasm \
  ../../aeordb-lib/src/plugins/bundled/jq.wasm

User-deployed plugins still use the normal plugin deployment API. The bundled plugin paths are reserved for AeorDB defaults; if one of those paths is occupied by a plugin without the matching bundled plugin ID, startup leaves it untouched and logs a warning.

extract

The extract plugin reads only the requested text range through the native plugin host extraction call. It does not buffer the whole file across the plugin boundary.

Request fields:

FieldTypeRequiredDescription
filestringyesFile path to extract from
pathstringaliasAlias for file
modestringyeslines or chars
startintegerno1-based line start for lines, 0-based char start for chars
endintegernoInclusive line end for lines, exclusive char end for chars
max_bytesintegernoMaximum returned text bytes

Example:

POST /plugins/extract/invoke
Content-Type: application/json

{
  "file": "/docs/readme.md",
  "mode": "lines",
  "start": 10,
  "end": 20,
  "max_bytes": 65536
}

Response body:

{
  "text": "selected text\n",
  "content_type": "text/markdown",
  "source_size": 12345,
  "mode": "lines",
  "start": 10,
  "end": 20,
  "truncated": false
}

jq

The jq plugin reads a JSON file and evaluates a jq-compatible expression using the embedded jaq engine. JSON files are currently loaded in full before filtering.

Request fields:

FieldTypeRequiredDescription
filestringyesJSON file path
pathstringaliasAlias for file
exprstringyesjq expression

Example:

POST /plugins/jq/invoke
Content-Type: application/json

{
  "file": "/data/messages.json",
  "expr": ".messages[] | select(.role == \"user\") | .content"
}

Responses always use a plural outputs array, even when the expression emits one value:

{
  "outputs": [
    "first user message",
    "second user message"
  ]
}