Associative Memory
Every registered associative memory instance operation, with source-derived inputs, outputs, access policy, and errors.
This reference covers 11 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 |
|---|---|---|
POST | /v1/assoc/mhn/new | Mhn new |
POST | /v1/assoc/mhn/store | Mhn store |
POST | /v1/assoc/mhn/retrieve | Mhn retrieve |
POST | /v1/assoc/mhn/retrieve_by_vector | Mhn retrieve by vector |
POST | /v1/assoc/mhn/retrieve_by_key | Mhn retrieve by key |
POST | /v1/assoc/mhn/clear | Mhn clear |
POST | /v1/assoc/mhn/stats | Mhn stats |
POST | /v1/assoc/mhn/config | Mhn config |
POST | /v1/assoc/mhn/system_info | Mhn system info |
GET | /v1/mhn/health | Mhn health |
POST | /v1/assoc/mhn/list | Mhn list |
POST /v1/assoc/mhn/new
Mhn new
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | MHN |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped( CoreAction::Write, "mhn:write", request_authority::MEMORY_MHN, ); require_scoped( CoreAction::Admin, "mhn:admin", request_authority::MEMORY_MHN, ); require_matching_db(&db).
Request
Json — MhnNewReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
dimensions | usize | Yes | |
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnNewReq {
dimensions: usize,
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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,
"dims": req.dimensions,
"namespace": hex::encode(ns_id.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:7924. Registration: akasha-daemon/src/main.rs:4708.
POST /v1/assoc/mhn/store
Mhn store
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | MHN |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped( CoreAction::Write, "mhn:write", request_authority::MEMORY_MHN, ); require_matching_db(&db).
Request
Json — MhnStoreReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
id | String | Yes | |
vector | Vec<f32> | Yes | |
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnStoreReq {
id: String,
vector: Vec<f32>,
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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!({"id": id.to_string()})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:7968. Registration: akasha-daemon/src/main.rs:4709.
POST /v1/assoc/mhn/retrieve
Mhn retrieve
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | MHN |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped(CoreAction::Read, "mhn:read", request_authority::MEMORY_MHN); require_matching_db(&db).
Request
Json — MhnRetrieveReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
vector | Vec<f32> | Yes | |
k | Option<usize> | No; optional or defaulted | |
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnRetrieveReq {
vector: Vec<f32>,
k: Option<usize>,
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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!({
"id": best_id.to_string(),
"embedding": embedding.to_vec(),
"score": best_score,
})serde_json::json!({
"id": id.to_string(),
"embedding": emb.to_vec(),
})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:8013. Registration: akasha-daemon/src/main.rs:4710.
POST /v1/assoc/mhn/retrieve_by_vector
Mhn retrieve by vector
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | MHN |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped(CoreAction::Read, "mhn:read", request_authority::MEMORY_MHN); require_matching_db(&db).
Request
Json — MhnRetrieveVectorReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
vector | Vec<f32> | Yes | |
k | Option<usize> | No; optional or defaulted | |
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnRetrieveVectorReq {
vector: Vec<f32>,
k: Option<usize>,
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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!({"neighbors": rows})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:8160. Registration: akasha-daemon/src/main.rs:4711.
POST /v1/assoc/mhn/retrieve_by_key
Mhn retrieve by key
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | MHN |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped(CoreAction::Read, "mhn:read", request_authority::MEMORY_MHN); require_matching_db(&db).
Request
Json — MhnRetrieveKeyReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
id | String | Yes | |
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnRetrieveKeyReq {
id: String,
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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!({"id": id.to_string(), "embedding": embedding.to_vec()}),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:8199. Registration: akasha-daemon/src/main.rs:4715.
POST /v1/assoc/mhn/clear
Mhn clear
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | MHN |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped( CoreAction::Admin, "mhn:admin", request_authority::MEMORY_MHN, ); require_matching_db(&db).
Request
Json — MhnClearReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnClearReq {
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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})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:8087. Registration: akasha-daemon/src/main.rs:4716.
POST /v1/assoc/mhn/stats
Mhn stats
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | MHN |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped(CoreAction::Read, "mhn:read", request_authority::MEMORY_MHN); require_matching_db(&db).
Request
Json — MhnStatsReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnStatsReq {
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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!({
"namespace": hex::encode(authority.namespace().0),
"count": count,
})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:8124. Registration: akasha-daemon/src/main.rs:4717.
POST /v1/assoc/mhn/config
Mhn config
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | MHN |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped. Handler additionally checks require_scoped(CoreAction::Read, "mhn:read", request_authority::MEMORY_MHN); require_matching_db(&db).
Request
Json — MhnConfigReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnConfigReq {
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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!({
"namespace": hex::encode(authority.namespace().0),
"dimensions": entry.dimensions,
"persistence": true,
"network_id": entry.network_id,
"namespace_id": hex::encode(entry.namespace.0),
"created_at": entry.created_at.to_rfc3339(),
"last_accessed": entry.last_accessed.to_rfc3339(),
"pattern_count": entry.pattern_count,
})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:8235. Registration: akasha-daemon/src/main.rs:4718.
POST /v1/assoc/mhn/system_info
Mhn system info
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| 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_scoped(CoreAction::Read, "mhn:read", request_authority::MEMORY_MHN); require_matching_db(&db).
Request
Json — MhnSystemInfoReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnSystemInfoReq {
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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!({
"namespace": hex::encode(authority.namespace().0),
"dimensions": dims,
"count": count,
"capacity_estimate": capacity,
"sparsity": None::<f64>,
"network_id": entry.network_id,
"namespace_id": hex::encode(entry.namespace.0),
"created_at": entry.created_at.to_rfc3339(),
"last_accessed": entry.last_accessed.to_rfc3339(),
"pattern_count": entry.pattern_count,
})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:8266. Registration: akasha-daemon/src/main.rs:4719.
GET /v1/mhn/health
Mhn health
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| Handler dependencies | See handler source and return expressions. |
Access: Daemon authentication and capability namespace authority; memory-domain permissions apply where mapped.
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>
Serialization is delegated or the handler returns a raw response. Consult the exact handler below; the OpenAPI response intentionally remains unconstrained.
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:10305. Registration: akasha-daemon/src/main.rs:4720.
POST /v1/assoc/mhn/list
Mhn list
| Availability | Source contract |
|---|---|
| Registration | config.enable_mhn |
| Runtime service | mhn |
| 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_scoped(CoreAction::Read, "mhn:read", request_authority::MEMORY_MHN).
Request
Json — MhnListReq
| Field | Rust type | Required on input | Notes |
|---|---|---|---|
Flattened body_authority fields | RejectedBodyAuthority | See flattened type; not a named JSON field | Serde: flatten |
struct MhnListReq {
#[serde(flatten)]
body_authority: RejectedBodyAuthority,
}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!({
"patterns": [],
"totalCount": count
})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:11237. Registration: akasha-daemon/src/main.rs:4721.