API referenceInstance API
GUIDE & REFERENCE

Working Memory

Every registered working memory instance operation, with source-derived inputs, outputs, access policy, and errors.

This reference covers 6 HTTP operations registered by the Akasha daemon. Call these paths on your instance base URL. See authentication, errors, and coverage before integrating.

MethodPathOperation
GET/v1/working-memory/slotsWorking memory slots list
GET/v1/working-memory/configWorking memory config get
PUT/v1/working-memory/configWorking memory config update
GET/v1/working-memory/statsWorking memory stats
POST/v1/working-memory/slots/clearWorking memory slots clear
POST/v1/working-memory/slots/injectWorking memory slots inject

GET /v1/working-memory/slots

Working memory slots list

AvailabilitySource contract
Registrationalways registered
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Read, Some(request_authority::MEMORY_WORKING)); require_matching_db(&db).

Request

No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({"slots": entries, "count": entries.len()}),

Errors and validation

Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:10931. Registration: akasha-daemon/src/main.rs:4384.

GET /v1/working-memory/config

Working memory config get

AvailabilitySource contract
Registrationalways registered
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_operator_control().

Request

No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

cfg.clone()

Errors and validation

Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:10953. Registration: akasha-daemon/src/main.rs:4385.

PUT /v1/working-memory/config

Working memory config update

AvailabilitySource contract
Registrationalways registered
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_operator_control().

Request

Jsonserde_json::Value

This handler accepts dynamic JSON. The field accesses below are source observations, not a fabricated required-field schema.

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({"ok": true, "config": config})

Errors and validation

Directly referenced error variants: InvalidRequest. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:10963. Registration: akasha-daemon/src/main.rs:4385.

GET /v1/working-memory/stats

Working memory stats

AvailabilitySource contract
Registrationalways registered
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Read, Some(request_authority::MEMORY_WORKING)); require_matching_db(&db).

Request

No typed JSON, query, or path extractor is declared in the handler signature. Headers or request objects may still be consumed; the signature below is authoritative.

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({
        "slotCount": slot_count,
        "capacity": capacity,
        "utilizationPct": if capacity > 0 {
            (slot_count as f64 / capacity as f64 * 100.0).round()
        } else {
            0.0
        }
    })

Errors and validation

Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:10978. Registration: akasha-daemon/src/main.rs:4389.

POST /v1/working-memory/slots/clear

Working memory slots clear

AvailabilitySource contract
Registrationalways registered
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Delete, Some(request_authority::MEMORY_WORKING)); require_matching_db(&db).

Request

JsonWmSlotClearReq

FieldRust typeRequired on inputNotes
idStringYes
struct WmSlotClearReq {
    id: String,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({"ok": true, "removed": existed})

Errors and validation

Directly referenced error variants: none in the handler body. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:11009. Registration: akasha-daemon/src/main.rs:4390.

POST /v1/working-memory/slots/inject

Working memory slots inject

AvailabilitySource contract
Registrationalways registered
Runtime serviceNo prefix-level service check; handler dependencies still apply.
Handler dependenciesSee handler source and return expressions.

Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require(CoreAction::Write, Some(request_authority::MEMORY_WORKING)); require_matching_db(&db).

Request

JsonWmSlotInjectReq

FieldRust typeRequired on inputNotes
idStringYes
valueserde_json::ValueYes
struct WmSlotInjectReq {
    id: String,
    value: serde_json::Value,
}

Response

Declared return: Result<impl IntoResponse, DaemonError>

The following are the exact JSON construction expressions in the handler. Values such as rows, result, and delegated types are runtime values, not literal example payloads.

serde_json::json!({"ok": true, "id": req.id})

Errors and validation

Directly referenced error variants: Internal, InvalidRequest, PayloadTooLarge, WorkingMemoryCapacity. Middleware and delegated services can return additional errors described in the shared error reference.

Source: akasha-daemon/src/main.rs:11043. Registration: akasha-daemon/src/main.rs:4394.

On this page