/maludb:maludb-sql-clientfrom maludb
Query and write the MaluDB PostgreSQL extension (`maludb_core`) directly with SQL from middleware — no REST API in between. Use this whenever the user is writing SQL against MaluDB: SELECT/INSERT/UPDATE/DELETE through the `maludb_*` updatable views; calling facade functions like `register_svpor_subject`, `maludb_register_episode`, `maludb_svpor_statement_create`, `maludb_svpor_attribute_create`, `maludb_memory_search`, `maludb_graph_walk`/`_neighbors`, `maludb_upload_document`; using the `malu_vector` type; setting the `search_path` for facade access; dealing with RLS/tenant ownership, the provenance lifecycle, or PostgreSQL constraint/trigger errors from MaluDB. Trigger even when the user just says "the MaluDB database", "query maludb_core", "the maludb_subject view", or names any `maludb_*` object, without saying "SQL client". For calling the HTTP API instead use maludb-api-client; for building the PHP API server use maludb-api-server.
Ships in maludb. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill helps middleware talk to MaluDB directly in SQL — against the maludb_core
PostgreSQL extension, with no REST layer. MaluDB is a memory / knowledge-graph store:
subjects & verbs (nodes), SVPO statements (edges), episodes (events), typed attributes,
documents, and a graph-bound vector-memory pipeline.
If the task is calling the HTTP API, use maludb-api-client. If it's building the PHP endpoints, use maludb-api-server.
The MaluDB facade views and functions reference their internal malu$* base tables and RLS
grant tables unqualified. They only resolve when maludb_core is on the search_path,
and tenant ownership / RLS only works when the tenant (public) schema is first:
BEGIN;
SET LOCAL search_path TO public, maludb_core;
-- ... your facade calls / view writes here ...
COMMIT;
public first → current_schema() = the tenant schema, so owner_schema resolution and
row-level security apply to the caller's tenant.maludb_core in the path → the facade's base tables resolve.SET LOCAL scopes the change to the transaction; use it inside BEGIN/COMMIT.Which operations need it? Everything that touches the SVPOR graph, episodes, statements,
attributes, the unified edge/graph functions, the object handle, documents-as-graph, and the
whole memory pipeline. Plain CRUD on the simple views (maludb_subject, maludb_verb,
maludb_project, maludb_memory_pool, maludb_skill, the *_type pickers) resolves on the
default path and does not need it. When unsure, wrap it — it's harmless on the simple
views and required for the rest. See references/conventions.md.
MaluDB exposes three kinds of SQL objects (never touch the malu$* base tables directly):
maludb_subject, maludb_verb, maludb_project, maludb_memory
(notes), maludb_memory_pool, maludb_skill, maludb_document, maludb_episode,
maludb_svpor_statement, maludb_svpor_attribute, maludb_edge, …. You can
SELECT/INSERT/UPDATE/DELETE through most of them; triggers enforce integrity.register_svpor_subject(...), maludb_register_episode(...),
maludb_svpor_statement_create(...) / _set_provenance / _close / _delete,
maludb_svpor_attribute_create(...), maludb_attributes_apply(...),
maludb_object_get(...), maludb_graph_neighbors/_walk(...), resolve_svpor_verb(...),
the maludb_memory_* pipeline, maludb_upload_document(...). Signatures use named
args (p_foo => ?). Full catalog in references/facades.md.maludb_subject_type, maludb_verb_type,
maludb_episode_type, maludb_attribute_template. The DB rejects an unregistered
subject/verb type, so read these to know the valid set.Where to look:
(kind,id) handle → references/graph.mdmalu_vector, model config, ingest, search → references/vector-memory.mdRead subjects (no facade needed — simple view):
SELECT subject_id, canonical_name, subject_type, description
FROM maludb_subject
WHERE canonical_name ILIKE '%edward%'
ORDER BY canonical_name LIMIT 50;
Create a subject + an episode + link them (facades → needs search_path):
BEGIN;
SET LOCAL search_path TO public, maludb_core;
SELECT register_svpor_subject(p_canonical_name => 'Edward', p_subject_type => 'person') AS subject_id;
SELECT maludb_register_episode(
p_episode_kind => 'activity', p_title => 'Server upgrade',
p_summary => 'Upgraded prod', p_payload_jsonb => '{}'::jsonb,
p_occurred_at => now(), p_sensitivity => 'internal', p_provenance => 'provided'
) AS episode_id;
-- link the subject to the episode via a statement (resolves the verb by name)
SELECT maludb_svpor_statement_create(
p_subject_kind => 'subject', p_subject_id => <subject_id>,
p_verb_id => maludb_core.resolve_svpor_verb('performed'),
p_object_kind => 'episode_object', p_object_id => <episode_id>,
p_provenance => 'provided');
COMMIT;
Semantic search within a compartment (vector memory):
BEGIN;
SET LOCAL search_path TO public, maludb_core;
SELECT chunk_id, document_id, source_text, similarity
FROM maludb_memory_search(
p_query_embedding => '[0.12, -0.04, ...]'::maludb_core.malu_vector,
p_subject => 'Edward', p_verb => NULL,
p_namespace => 'default', p_limit => 10, p_metric => 'cosine');
COMMIT;
$1/?), never string interpolation — the same SQL
injection rules apply, and several facades take user-derived text (names, spans).INSERTs into the simple views
are fine for plain subject/verb/project/note/pool/skill rows.RAISE/constraint, not a crash. MaluDB pushes integrity into triggers — an
unregistered type, a bad enum, an out-of-order time range all surface as a PostgreSQL
error with a clear SQLSTATE. Map them like the API does (see conventions): 23505 →
conflict, 23502/23503/23514/22*/P0001 → validation, 42501 → privilege.BEGIN/COMMIT so partial graphs never persist.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
3 skills in this plugin
/maludb-api-clientIntegrate the MaluDB REST/JSON API into a desktop (Electron) or web application. Use this whenever the user is calling MaluDB over HTTP — building a client for subjects, verbs, episodes, statements, documents, notes, projects, memory pools, skills, typed attributes, the knowledge graph, or the vector-memory search pipeline; authenticating with a `malu_` Bearer token against `api.maludb.com` / `/v1/...`; handling MaluDB error codes; or writing fetch/axios/requests/cURL code that talks to any `/v1` endpoint. Trigger even when the user only says "the MaluDB API", "call the memory API", "upload a document to MaluDB", or names a `/v1` path, without saying "client". For writing SQL straight against the database use maludb-sql-client instead; for building the PHP API server itself use maludb-api-server./maludb-api-serverBuild or extend the MaluDB PHP API server — the JSON+HTTP layer that fronts the `maludb_core` PostgreSQL extension. Use this whenever the user is writing or modifying the server side of MaluDB: adding a new `/v1/...` endpoint, creating the one-file-per-endpoint PHP files under `v1/`, wiring `.htaccess` URL→file rewrites, using the shared `config/response.php` helpers (`require_auth`, `body_json`, `json_response`, `json_error`, `db_query`/`db_exec`/`db_one`, `db_tx_core`), implementing Bearer-token auth, SQL tracing, the error→HTTP-status mapping, or the multipart document upload. Trigger even when the user just says "add an endpoint to the MaluDB API", "the v1 PHP files", "the MaluDB server", or "edit response.php", without saying "API server". For calling the API from a client use maludb-api-client; for raw SQL against the DB use maludb-sql-client.npx claudepluginhub maludb/maludb-plugin --plugin maludb