pub struct CreateMemory {Show 22 fields
pub tier: Tier,
pub namespace: String,
pub title: String,
pub content: String,
pub tags: Vec<String>,
pub priority: i32,
pub confidence: Option<f64>,
pub source: String,
pub expires_at: Option<String>,
pub ttl_secs: Option<i64>,
pub metadata: Value,
pub agent_id: Option<String>,
pub scope: Option<String>,
pub on_conflict: Option<String>,
pub detect_conflicts: Option<bool>,
pub force: bool,
pub citations: Vec<Citation>,
pub source_uri: Option<String>,
pub source_span: Option<SourceSpan>,
pub kind: Option<String>,
pub signature: Option<String>,
pub created_at: Option<String>,
}Fields§
§tier: Tier§namespace: String§title: String§content: String§priority: i32§confidence: Option<f64>Confidence 0.0–1.0. None (caller omitted the field) resolves
to DEFAULT_CONFIDENCE with truthful
confidence_source = "default" provenance (#1591) via
CreateMemory::resolved_confidence /
CreateMemory::resolved_confidence_source.
source: String§expires_at: Option<String>§ttl_secs: Option<i64>§metadata: Value§agent_id: Option<String>Optional agent identifier. When unset, the server resolves a default
via crate::identity (NHI-hardened precedence chain).
scope: Option<String>Optional visibility scope (Task 1.5). One of VALID_SCOPES. When
unset, treated as private by the query layer.
on_conflict: Option<String>v0.6.3.1 P2 (G6) — collision policy when (title, namespace) already
exists. One of error | merge | version. When unset, the
daemon defaults to error for HTTP callers (HTTP is not legacy
like MCP v1; clients that want the legacy silent-merge contract
must opt in explicitly).
detect_conflicts: Option<bool>v0.7.0 (issue #519) — when Some(true), run a proactive
detect_contradiction LLM probe against same-namespace memories
BEFORE returning 201, regardless of autonomous_hooks. When
Some(false), force-disable detection even if autonomous_hooks
is on. When None, defer to autonomous_hooks.
Surface: the 201 response body grows a conflicts: [{...}] array
listing every same-namespace candidate the LLM flags as
contradictory. Each entry carries the candidate id, title, and
(when LLM produces one) a suggested_merge content string the
caller can pass to a follow-up memory_consolidate.
force: boolv0.7.0 (issue #519) — proactive contradiction detection bypass.
When true, the substrate-level proactive_conflict_check is
skipped on this write so a near-duplicate-with-differing-content
row is inserted anyway. Default false preserves the new v0.7.0
refuse-by-default posture; callers that explicitly want the
conflicting fact to land alongside the existing one set
force=true.
citations: Vec<Citation>v0.7.0 Form 4 (issue #757) — fact-provenance citations
supplied at write time. Each entry must satisfy
validate::validate_citation. Empty by default.
source_uri: Option<String>v0.7.0 Form 4 — optional URI-form pointer to the cited source
body. Must satisfy validate::validate_source_uri when set.
source_span: Option<SourceSpan>v0.7.0 Form 4 — optional byte-range into the parent source
body. Must satisfy validate::validate_source_span when set.
kind: Option<String>v0.7.x Form 6 (#1385) — Batman-taxonomy memory-kind selector for
the new row. Accepts any MemoryKind wire token
(observation | reflection | persona | concept | entity
| claim | relation | event | conversation | decision).
Unknown values are silently ignored (treated as omission) for
forward-compat with future variants, mirroring the MCP
memory_store params["kind"] contract at
src/mcp/tools/store/validation.rs:207-213. Absent / unknown
→ handler defaults to MemoryKind::Observation. Stored as
Option<String> (not Option<MemoryKind>) so unknown future
tokens deserialise without breaking the request envelope.
Pre-#1385 this field did not exist on CreateMemory, so HTTP
POST /api/v1/memories silently dropped the caller’s kind
and every HTTP-created row landed as Observation. The Form 6
recall kinds filter then returned zero rows against HTTP-
written data even when the caller had stored kind: "claim"
(the v3 NHI assessment defect D-v3-3 reproducible against the
alice lan-parity postgres-backed daemon).
signature: Option<String>#626 Layer-3 (C7) — detached Ed25519 agent-attestation signature,
standard base64, over the SignableWrite envelope
(agent_id + namespace + title + kind + created_at + sha256(content)). When present, created_at MUST also be supplied
(the signer cannot predict the server clock); a signature that
fails to verify against the agent’s bound public key is rejected
with 403. Absent ⇒ legacy unsigned write unless the operator set
AI_MEMORY_REQUIRE_AGENT_ATTESTATION, in which case the gate
rejects the unsigned store.
created_at: Option<String>#626 Layer-3 (C7) — RFC3339 timestamp the caller signed. Required
when signature is present; the server validates it against the
±300s attestation freshness window and then adopts it verbatim so
the verifier re-derives the identical signed envelope.
Implementations§
Source§impl CreateMemory
impl CreateMemory
Sourcepub fn resolved_confidence(&self) -> f64
pub fn resolved_confidence(&self) -> f64
#1591 — effective confidence for this request: the caller’s
explicit value, else the compiled DEFAULT_CONFIDENCE.
Sourcepub fn resolved_confidence_source(&self) -> ConfidenceSource
pub fn resolved_confidence_source(&self) -> ConfidenceSource
#1591 — truthful confidence provenance for this request:
ConfidenceSource::CallerProvided only when the caller
actually sent a confidence value;
ConfidenceSource::Default when the compiled fallback was
stamped.
Trait Implementations§
Source§impl Debug for CreateMemory
impl Debug for CreateMemory
Source§impl<'de> Deserialize<'de> for CreateMemory
impl<'de> Deserialize<'de> for CreateMemory
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for CreateMemory
impl RefUnwindSafe for CreateMemory
impl Send for CreateMemory
impl Sync for CreateMemory
impl Unpin for CreateMemory
impl UnsafeUnpin for CreateMemory
impl UnwindSafe for CreateMemory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more