Agent integrations
GUIDE & REFERENCE

Use memory from any agent

Implement a small, scoped tool adapter against the dedicated daemon HTTP API.

Use the dedicated instance HTTP API when your application controls tool execution. This keeps model choice separate from memory and lets the application supply the required capability without exposing it to the model.

Connection contract

  • Base URL: the HTTPS endpoint of the selected Mind.
  • Tool discovery: POST /v1/mcp/tools/list with {}.
  • Tool execution: POST /v1/mcp/tools/call with {name, arguments}.
  • Credential: x-akasha-capability with the signed instance capability; additional Bearer JWT only if required by that deployment's legacy verifier.
  • Response: HTTP status, then the tool envelope's is_error, then result.

Do not accept a base URL or capability from model-generated tool arguments. Configure them on the trusted application side and expose only the operation's business parameters to the model.

A minimal read-only adapter

This example exposes only recall. It is application code using HTTP, not a complete standard MCP server.

const instanceUrl = process.env.MINDS_INSTANCE_URL;
const capability = process.env.MINDS_CAPABILITY;
if (!instanceUrl || !capability) throw new Error('Missing Mind connection');

export async function recallContext(query: string) {
  if (!query.trim() || query.length > 4_000) {
    throw new Error('Provide a short, non-empty memory query');
  }
  const response = await fetch(new URL('/v1/mcp/tools/call', instanceUrl), {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'x-akasha-capability': capability,
    },
    body: JSON.stringify({ name: 'recall', arguments: { query, limit: 5 } }),
    signal: AbortSignal.timeout(30_000),
  });
  if (!response.ok) throw new Error(`Memory request: HTTP ${response.status}`);
  const output = await response.json();
  if (output.is_error) throw new Error('Memory recall was rejected');
  return output.result;
}

Register recallContext using your agent framework's ordinary function-tool mechanism. Its model-visible schema needs only a string query. Return the actual memory result, preserving available source information. Keep credentials and raw transport diagnostics outside the model-visible result.

Add writes deliberately

Expose remember only when the application wants to retain information. Pass the actual source in context, and distinguish observations from conclusions. The first memory guide shows the input shape.

For deletion, expose a narrow operation using an explicit memory ID and a meaningful reason. Do not give an agent unrestricted bulk deletion merely to support a basic memory workflow.

Standard MCP adapter requirements

If your host accepts only MCP, an adapter must implement the standard initialize/tools protocol and map calls to these HTTP endpoints. It must preserve per-user authority, handle cancellation and errors, and avoid mixing namespaces. The checked-in standalone akasha-mcp constructor does not currently provide that remote-backed bridge automatically.

The daemon also supports embedding its real backend into an MCP server through McpServer::new_with_backend. That is an integration seam for application builders, not proof that the standalone command already uses your remote endpoint.

Source: daemon MCP handlers, request authority middleware, and akasha/mcp/src/server.rs.

On this page