API referenceInstance API
GUIDE & REFERENCE

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.

MethodPathOperation
POST/v1/assoc/mhn/newMhn new
POST/v1/assoc/mhn/storeMhn store
POST/v1/assoc/mhn/retrieveMhn retrieve
POST/v1/assoc/mhn/retrieve_by_vectorMhn retrieve by vector
POST/v1/assoc/mhn/retrieve_by_keyMhn retrieve by key
POST/v1/assoc/mhn/clearMhn clear
POST/v1/assoc/mhn/statsMhn stats
POST/v1/assoc/mhn/configMhn config
POST/v1/assoc/mhn/system_infoMhn system info
GET/v1/mhn/healthMhn health
POST/v1/assoc/mhn/listMhn list

POST /v1/assoc/mhn/new

Mhn new

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesMHN

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

JsonMhnNewReq

FieldRust typeRequired on inputNotes
dimensionsusizeYes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesMHN

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

JsonMhnStoreReq

FieldRust typeRequired on inputNotes
idStringYes
vectorVec<f32>Yes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesMHN

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

JsonMhnRetrieveReq

FieldRust typeRequired on inputNotes
vectorVec<f32>Yes
kOption<usize>No; optional or defaulted
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesMHN

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

JsonMhnRetrieveVectorReq

FieldRust typeRequired on inputNotes
vectorVec<f32>Yes
kOption<usize>No; optional or defaulted
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesMHN

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

JsonMhnRetrieveKeyReq

FieldRust typeRequired on inputNotes
idStringYes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesMHN

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

JsonMhnClearReq

FieldRust typeRequired on inputNotes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesMHN

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

JsonMhnStatsReq

FieldRust typeRequired on inputNotes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesMHN

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

JsonMhnConfigReq

FieldRust typeRequired on inputNotes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesSee 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

JsonMhnSystemInfoReq

FieldRust typeRequired on inputNotes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesSee 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

AvailabilitySource contract
Registrationconfig.enable_mhn
Runtime servicemhn
Handler dependenciesSee 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

JsonMhnListReq

FieldRust typeRequired on inputNotes
Flattened body_authority fieldsRejectedBodyAuthoritySee flattened type; not a named JSON fieldSerde: 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.

On this page