Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Client for Compose Memory

Standalone Compose Memory contract. This SDK surface is intentionally independent from agent/workflow execution so any external application or autonomous agent can integrate compact pre-turn recall, post-turn memory persistence, explicit durable memory, vector recall, transcripts, layered search, and stats without adopting the rest of the manowar SDK.

Version: 0.8.6

Implementations§

Source§

impl Client

Source

pub fn new(baseurl: &str) -> Self

Create a new client.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source

pub fn new_with_client(baseurl: &str, client: Client) -> Self

Construct a new client with an existing reqwest::Client, allowing more control over its configuration.

baseurl is the base URL provided to the internal reqwest::Client, and should include a scheme and hostname, as well as port and a path stem if applicable.

Source§

impl Client

Source

pub fn graph_add(&self) -> GraphAdd<'_>

Add graph memory through the configured graph provider

Sends a POST request to /api/memory/add

let response = client.graph_add()
    .body(body)
    .send()
    .await;
Source

pub fn archives_sync(&self) -> ArchivesSync<'_>

Sync a memory archive to durable external storage

Sends a POST request to /api/memory/archives/{archiveId}/sync

let response = client.archives_sync()
    .archive_id(archive_id)
    .body(body)
    .send()
    .await;
Source

pub fn conflicts_resolve(&self) -> ConflictsResolve<'_>

Resolve a memory conflict

Sends a POST request to /api/memory/conflicts/{id}/resolve

let response = client.conflicts_resolve()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn context_assemble(&self) -> ContextAssemble<'_>

Assemble compact pre-turn memory context

Agent-first memory loop step. Call before reasoning or tool use. Returns a compact prompt and structured memory items across working, scene, graph, patterns, archives, and vectors.

Sends a POST request to /api/memory/context/assemble

let response = client.context_assemble()
    .body(body)
    .send()
    .await;
Source

pub fn evals_run(&self) -> EvalsRun<'_>

Run a memory retrieval evaluation

Sends a POST request to /api/memory/evals/runs

let response = client.evals_run()
    .body(body)
    .send()
    .await;

Search productized memory items across layers

Sends a POST request to /api/memory/items/search

let response = client.items_search()
    .body(body)
    .send()
    .await;
Source

pub fn items_get(&self) -> ItemsGet<'_>

Fetch one durable memory item

Sends a GET request to /api/memory/items/{id}

let response = client.items_get()
    .id(id)
    .agent_wallet(agent_wallet)
    .user_address(user_address)
    .send()
    .await;
Source

pub fn items_delete(&self) -> ItemsDelete<'_>

Delete or soft-delete one durable memory item

Sends a DELETE request to /api/memory/items/{id}

let response = client.items_delete()
    .id(id)
    .agent_wallet(agent_wallet)
    .hard_delete(hard_delete)
    .user_address(user_address)
    .send()
    .await;
Source

pub fn items_update(&self) -> ItemsUpdate<'_>

Update one durable memory item

Sends a PATCH request to /api/memory/items/{id}

let response = client.items_update()
    .id(id)
    .body(body)
    .send()
    .await;
Source

pub fn jobs_create(&self) -> JobsCreate<'_>

Run a memory maintenance job

Sends a POST request to /api/memory/jobs

let response = client.jobs_create()
    .body(body)
    .send()
    .await;
Source

pub fn jobs_get(&self) -> JobsGet<'_>

Fetch a memory maintenance job

Sends a GET request to /api/memory/jobs/{jobId}

let response = client.jobs_get()
    .job_id(job_id)
    .send()
    .await;

Search all memory layers

Sends a POST request to /api/memory/layers/search

let response = client.layers_search()
    .body(body)
    .send()
    .await;
Source

pub fn loop_(&self) -> Loop<'_>

Single endpoint for the agent memory loop

Minimal-token agent surface. Set step to pre_turn, post_turn, or remember; each response returns the next valid loop steps.

Sends a POST request to /api/memory/loop

let response = client.loop_()
    .body(body)
    .send()
    .await;
Source

pub fn loops_list(&self) -> LoopsList<'_>

List compact agent-first memory loop manifests

Sends a GET request to /api/memory/loops

let response = client.loops_list()
    .send()
    .await;
Source

pub fn loops_get(&self) -> LoopsGet<'_>

Fetch one compact memory loop manifest

Sends a GET request to /api/memory/loops/{loopId}

let response = client.loops_get()
    .loop_id(loop_id)
    .send()
    .await;
Source

pub fn patterns_list(&self) -> PatternsList<'_>

List learned procedural memory patterns

Sends a GET request to /api/memory/patterns

let response = client.patterns_list()
    .agent_wallet(agent_wallet)
    .limit(limit)
    .min_success_rate(min_success_rate)
    .pattern_type(pattern_type)
    .send()
    .await;
Source

pub fn patterns_get(&self) -> PatternsGet<'_>

Fetch one procedural memory pattern

Sends a GET request to /api/memory/patterns/{patternId}

let response = client.patterns_get()
    .pattern_id(pattern_id)
    .agent_wallet(agent_wallet)
    .send()
    .await;
Source

pub fn patterns_promote(&self) -> PatternsPromote<'_>

Promote a validated procedural pattern into a learned skill

Sends a POST request to /api/memory/patterns/{patternId}/promote

let response = client.patterns_promote()
    .pattern_id(pattern_id)
    .body(body)
    .send()
    .await;
Source

pub fn patterns_validate(&self) -> PatternsValidate<'_>

Validate a procedural memory pattern before promotion

Sends a POST request to /api/memory/patterns/{patternId}/validate

let response = client.patterns_validate()
    .pattern_id(pattern_id)
    .send()
    .await;
Source

pub fn remember(&self) -> Remember<'_>

Save an explicit durable fact or preference

Agent-first memory loop step. Call when the agent identifies a durable fact, preference, correction, decision, or operational lesson.

Sends a POST request to /api/memory/remember

let response = client.remember()
    .body(body)
    .send()
    .await;
Source

pub fn rerank(&self) -> Rerank<'_>

Rerank candidate memory documents

Sends a POST request to /api/memory/rerank

let response = client.rerank()
    .body(body)
    .send()
    .await;
Source

pub fn schedules_list(&self) -> SchedulesList<'_>

List Temporal memory schedule status

Sends a GET request to /api/memory/schedules

let response = client.schedules_list()
    .agent_wallets(agent_wallets)
    .send()
    .await;
Source

pub fn schedules_create(&self) -> SchedulesCreate<'_>

Create or replace memory maintenance schedules

Sends a POST request to /api/memory/schedules

let response = client.schedules_create()
    .body(body)
    .send()
    .await;
Source

pub fn schedules_delete(&self) -> SchedulesDelete<'_>

Delete memory maintenance schedules

Sends a DELETE request to /api/memory/schedules

let response = client.schedules_delete()
    .agent_wallets(agent_wallets)
    .send()
    .await;
Source

pub fn schedules_pause(&self) -> SchedulesPause<'_>

Pause one memory maintenance schedule

Sends a POST request to /api/memory/schedules/{scheduleId}/pause

let response = client.schedules_pause()
    .schedule_id(schedule_id)
    .send()
    .await;
Source

pub fn schedules_resume(&self) -> SchedulesResume<'_>

Resume one memory maintenance schedule

Sends a POST request to /api/memory/schedules/{scheduleId}/resume

let response = client.schedules_resume()
    .schedule_id(schedule_id)
    .send()
    .await;
Source

pub fn schedules_trigger(&self) -> SchedulesTrigger<'_>

Trigger one memory maintenance schedule immediately

Sends a POST request to /api/memory/schedules/{scheduleId}/trigger

let response = client.schedules_trigger()
    .schedule_id(schedule_id)
    .send()
    .await;

Search graph memory through the configured graph provider

Sends a POST request to /api/memory/search

let response = client.graph_search()
    .body(body)
    .send()
    .await;
Source

pub fn sessions_compress(&self) -> SessionsCompress<'_>

Compress a long transcript into durable archive memory

Sends a POST request to /api/memory/sessions/{sessionId}/compress

let response = client.sessions_compress()
    .session_id(session_id)
    .body(body)
    .send()
    .await;
Source

pub fn sessions_working_get(&self) -> SessionsWorkingGet<'_>

Fetch hot working memory for a session

Sends a GET request to /api/memory/sessions/{sessionId}/working

let response = client.sessions_working_get()
    .session_id(session_id)
    .agent_wallet(agent_wallet)
    .send()
    .await;
Source

pub fn sessions_working_update(&self) -> SessionsWorkingUpdate<'_>

Update hot working memory for a session

Sends a PATCH request to /api/memory/sessions/{sessionId}/working

let response = client.sessions_working_update()
    .session_id(session_id)
    .body(body)
    .send()
    .await;
Source

pub fn skills_list(&self) -> SkillsList<'_>

List learned memory skills

Sends a GET request to /api/memory/skills

let response = client.skills_list()
    .agent_wallet(agent_wallet)
    .category(category)
    .limit(limit)
    .send()
    .await;
Source

pub fn skills_get(&self) -> SkillsGet<'_>

Fetch one learned memory skill

Sends a GET request to /api/memory/skills/{skillId}

let response = client.skills_get()
    .skill_id(skill_id)
    .agent_wallet(agent_wallet)
    .send()
    .await;
Source

pub fn stats_get(&self) -> StatsGet<'_>

Get memory statistics for an agent wallet

Sends a GET request to /api/memory/stats/{agentWallet}

let response = client.stats_get()
    .agent_wallet(agent_wallet)
    .send()
    .await;
Source

pub fn transcript_get(&self) -> TranscriptGet<'_>

Fetch a transcript by session or thread id

Sends a GET request to /api/memory/transcript-get/{id}

let response = client.transcript_get()
    .id(id)
    .agent_wallet(agent_wallet)
    .type_(type_)
    .user_address(user_address)
    .send()
    .await;
Source

pub fn transcript_store(&self) -> TranscriptStore<'_>

Store a session transcript

Sends a POST request to /api/memory/transcript-store

let response = client.transcript_store()
    .body(body)
    .send()
    .await;
Source

pub fn transcripts_index(&self) -> TranscriptsIndex<'_>

Store, index, and optionally update working memory from a transcript

Sends a POST request to /api/memory/transcripts/index

let response = client.transcripts_index()
    .body(body)
    .send()
    .await;
Source

pub fn turn_record(&self) -> TurnRecord<'_>

Persist the completed turn

Agent-first memory loop step. Call after the assistant final answer to store transcript, working memory, and vector memory for later retrieval.

Sends a POST request to /api/memory/turns/record

let response = client.turn_record()
    .body(body)
    .send()
    .await;
Source

pub fn vector_index(&self) -> VectorIndex<'_>

Index a memory vector

Sends a POST request to /api/memory/vector-index

let response = client.vector_index()
    .body(body)
    .send()
    .await;

Search vector memory

Sends a POST request to /api/memory/vector-search

let response = client.vector_search()
    .body(body)
    .send()
    .await;
Source

pub fn list(&self) -> List<'_>

List memories for an agent wallet

Sends a GET request to /api/memory/{agentWallet}

let response = client.list()
    .agent_wallet(agent_wallet)
    .limit(limit)
    .user_address(user_address)
    .send()
    .await;

Trait Implementations§

Source§

impl ClientHooks for &Client

Source§

async fn pre<E>( &self, request: &mut Request, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs prior to the execution of the request. This may be used to modify the request before it is transmitted.
Source§

async fn post<E>( &self, result: &Result<Response, Error>, info: &OperationInfo, ) -> Result<(), Error<E>>

Runs after completion of the request.
Source§

async fn exec( &self, request: Request, info: &OperationInfo, ) -> Result<Response, Error>

Execute the request. Note that for almost any reasonable implementation this will include code equivalent to this: Read more
Source§

impl ClientInfo<()> for Client

Source§

fn api_version() -> &'static str

Get the version of this API. Read more
Source§

fn baseurl(&self) -> &str

Get the base URL to which requests are made.
Source§

fn client(&self) -> &Client

Get the internal reqwest::Client used to make requests.
Source§

fn inner(&self) -> &()

Get the inner value of type T if one is specified.
Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more