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.
| Method | Path | Operation |
|---|---|---|
GET | /v1/working-memory/slots | Working memory slots list |
GET | /v1/working-memory/config | Working memory config get |
PUT | /v1/working-memory/config | Working memory config update |
GET | /v1/working-memory/stats | Working memory stats |
POST | /v1/working-memory/slots/clear | Working memory slots clear |
POST | /v1/working-memory/slots/inject | Working memory slots inject |
GET /v1/working-memory/slots
Working memory slots list
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See 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
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See 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
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See 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
Json — serde_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
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See 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
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See 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
Json — WmSlotClearReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
id | String | Yes |
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
| Availability | Source contract |
|---|---|
| Registration | always registered |
| Runtime service | No prefix-level service check; handler dependencies still apply. |
| Handler dependencies | See 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
Json — WmSlotInjectReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
id | String | Yes | |
value | serde_json::Value | Yes |
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.