scorpiox-bot-plugin-memory

scorpiox-bot-plugin-memory

main1 branch · 0 tags
VS Code
HTTPS
ForkDelete
Recent Commits
README

SCORPIOX BOT — memory

A persistent knowledge graph your agents can write to and read back, living on

your own node.

This is the standard MCP memory server, rebuilt as one static C99 binary. Entities

carry observations, typed relations link them, and the same nine tools an agent

sees over stdio back a browser UI for searching, inspecting and editing the graph.

The whole graph is a single JSONL file in this connector's own data directory.

No account, no database, no CDN, no network request of any kind — the binary

opens no socket and runs no other program.

make            # native build            -> ./plugin_memory
make musl       # static musl x86_64      -> ./plugin_memory.musl
make arm64      # static aarch64          -> ./plugin_memory.arm64
make win64      # MinGW-w64 static PE     -> ./plugin_memory.exe
make macos      # Apple clang (on macOS)  -> ./plugin_memory
make ui         # regenerate src/ui_html.h from src/ui.html
make test       # offline suite (180+ assertions)
make e2e        # Playwright viewport suite (1440 / 1024 / 390, dark + light)

Install

Drop the binary where the node looks for plugins, then open

Settings → Plugins, or use the market installer:

# node plugin directory (created by scorpiox-bot on startup)
cp plugin_memory ~/.scorpiox/plugins/plugin_memory
chmod +x ~/.scorpiox/plugins/plugin_memory

# or from the market
curl -s -H "X-Bot-Password: $BOT_PASSWORD" \
  "http://127.0.0.1:8150/plugin_manage?action=install&slug=memory&mode=prebuilt"

Windows: %LOCALAPPDATA%\scorpiox\plugins\plugin_memory.exe.

BotCloud container: /workspace/.scorpiox/plugins/plugin_memory.

Five modes, one binary

Mode Trigger Response
Discovery --meta or SX_PLUGIN_META=1 {"name":"memory","desc":"Knowledge graph","kind":"mcp","mcp":true,"daemon":false,"menus":false,"verified":"live","category":"devtools","version":"1.0.0"} (unauthenticated)
MCP tool provider --mcp newline-delimited JSON-RPC 2.0 over stdio — initialize, tools/list, tools/call, resources/list, resources/read, ping
API ?action=..., ?format=json, or any POST application/json; charset=utf-8
UI plain GET (?embed=1 aware) the graph browser, text/html
Info --version, --help, --schema id + version, usage, the nine tool schemas

Modes 3 and 4 sit behind require_node_auth(): X-Bot-Password,

Authorization: Bearer <pwd>, or ?pwd=. With BOT_PASSWORD unset the check

is a no-op, which is the intended behaviour on a single-user box. --meta and

--mcp stay open — the node spawns the stdio server itself, so a CGI password

must not stop it, or the router could never reach an installed connector.

Why --mcp and not an MCP server entry

plugin_memory is a connector plugin, not a new MCP server. scorpiox-bot-api

ships one lightweight stdio router, sx-connector-mcp, registered as a single

MCP server; it reads mcp_plugins.json and dispatches into every installed

mcp:true plugin. That keeps clang's MAX_SERVERS 16 untouched and adds zero

prompt bloat no matter how many connectors are installed:

# what the router sees
sx-connector-mcp --list                     # memory   kind mcp   9 tools
sx-connector-mcp --tools memory
sx-connector-mcp --call memory create_entities \
  '{"entities":[{"name":"Earl Grey","entityType":"tea","observations":["bergamot"]}]}'
sx-connector-mcp --call memory read_graph '{}'

The nine tools

Names, schemas and error texts match the upstream reference server, so a prompt or

tool-allowlist written for it works unchanged.

Tool Arguments Notes
create_entities {entities:[{name,entityType,observations[]}]} a name already present, or repeating earlier in the same call, is skipped and listed in skipped; its observations are not added — use add_observations
add_observations {observations:[{entityName,contents[]}]} one unknown entity fails the whole call; repeats inside the call and against the graph are dropped
delete_entities {entityNames[]} cascades every relation touching them; reports Deleted N of M entities. Not found: …
create_relations {relations:[{from,to,relationType}]} both ends must exist (Entity with name X not found); the exact triple is never stored twice
delete_relations {relations:[{from,to,relationType}]} exact-triple match; entities are kept
delete_observations {deletions:[{entityName,observations[]}]} exact-text match
read_graph {entityTypes?, observationLimit?} observationLimit: 0 returns counts only (observationCount) — absent returns full text
search_nodes {query, limit?, observationLimit?} case-insensitive substring over name, type and observations, first-N in stored order
open_nodes {names[], observationLimit?} exact names; relations kept when either endpoint is in the set

A tool failure is a tools/call result with isError:true and the human

sentence in content[0].text — never a JSON-RPC error — so an agent reading the

text can correct itself. Mutations also carry structuredContent, and

create_entities adds a second plain-text block naming what was skipped.

HTTP actions

Every action maps onto one of the nine tools, so the page can never drift away

from what an agent sees.

Action Call Returns
graph GET ?action=graph {"ok":true,"entities":[…],"relations":[…]}
search GET ?action=search&q=<text>&limit= same shape, name / type / observation matched
entity GET ?action=entity&name=<name> {"ok":true,"entities":[e],"relations":[…]} — both directions
stats GET ?action=stats {"ok":true,"entities":N,"relations":N,"observations":N,"unreadable_lines":N,"types":[…]}
add_entity POST ?action=add_entity {"name","entityType","observations?":[]} {"ok":true,…}
add_relation POST ?action=add_relation {"from","to","relationType"} {"ok":true,…}
add_obs POST ?action=add_obs {"name","contents":[]} {"ok":true,"results":[…]}
delete_entity POST ?action=delete_entity&name= {"ok":true,"message":"…"}
delete_obs POST ?action=delete_obs {"name","observations":[]} {"ok":true,"message":"…"}
delete_relation POST ?action=delete_relation {"from","to","relationType"} {"ok":true,"message":"…"}
tools GET ?action=tools the nine MCP tool schemas + kind:"mcp"
export GET ?action=export the raw JSONL as text/plain download

?action= and a JSON body are both accepted, so the page can POST an array

(contents, observations) without stuffing it into a query string.

P="pwd=$BOT_PASSWORD"
curl -s "http://127.0.0.1:8150/plugin_memory?action=stats&$P"

curl -s -X POST -H "Content-Type: application/json" \
  "http://127.0.0.1:8150/plugin_memory?action=add_entity&$P" \
  -d '{"name":"Earl Grey","entityType":"tea","observations":["black tea","bergamot"]}'

curl -s -X POST -H "Content-Type: application/json" \
  "http://127.0.0.1:8150/plugin_memory?action=add_relation&$P" \
  -d '{"from":"Earl Grey","to":"Cup","relationType":"is served in"}'

curl -s "http://127.0.0.1:8150/plugin_memory?action=search&q=bergamot&$P"

Storage

Platform Location
Linux / macOS ~/.scorpiox/connectors/plugin_memory/memory.jsonl
BotCloud container /workspace/.scorpiox/connectors/plugin_memory/memory.jsonl (preferred when /workspace exists — the rootfs does not survive stop → start)
Windows %LOCALAPPDATA%\scorpiox\connectors\plugin_memory\memory.jsonl
Override $MEMORY_FILE_PATH (absolute, or relative to the connector directory)

One JSON object per line, exactly the upstream record shape:

{"type":"entity","name":"Earl Grey","entityType":"tea","observat