Skip to main content

RawDocument

Struct RawDocument 

Source
pub struct RawDocument {
Show 24 fields pub source: String, pub source_id: String, pub title: String, pub summary: Option<String>, pub content: String, pub url: Option<String>, pub last_modified: i64, pub metadata: HashMap<String, String>, pub memory_type: Option<String>, pub domain: Option<String>, pub source_agent: Option<String>, pub confidence: Option<f32>, pub confirmed: Option<bool>, pub stability: Option<String>, pub supersedes: Option<String>, pub pending_revision: bool, pub entity_id: Option<String>, pub quality: Option<String>, pub is_recap: bool, pub enrichment_status: String, pub supersede_mode: String, pub structured_fields: Option<String>, pub retrieval_cue: Option<String>, pub source_text: Option<String>,
}
Expand description

A raw document fetched from any source, ready for chunking and embedding.

Fields§

§source: String

Source identifier (“gmail”, “notion”, “local_files”, etc.)

§source_id: String

Unique ID within the source (message ID, page ID, file path)

§title: String

Document title (filename, subject line, page title)

§summary: Option<String>

LLM-generated summary (stored separately from chunk content)

§content: String

Plain text content

§url: Option<String>

Deep link back to the source (URL, file path)

§last_modified: i64

Unix timestamp of last modification

§metadata: HashMap<String, String>

Additional metadata

§memory_type: Option<String>

Memory category: “preference”, “decision”, “fact”, “goal”, “relationship”

§domain: Option<String>

Domain context: “work”, “personal”, “health”, or “project:

§source_agent: Option<String>

Which AI agent stored this memory (e.g. “claude-code”, “chatgpt”)

§confidence: Option<f32>

Confidence score (0.0-1.0) assigned by the storing agent

§confirmed: Option<bool>

Whether a human has confirmed this memory

§stability: Option<String>

Stability tier: “new”, “learned”, or “confirmed”

§supersedes: Option<String>

source_id of the memory this entry supersedes (version chain)

§pending_revision: bool

Whether this is a pending revision awaiting human approval (Protected tier supersede)

§entity_id: Option<String>

Link to a knowledge graph entity (nullable, cascade handled manually)

§quality: Option<String>

Quality assessment: “low”, “medium”, “high” (NULL = unassessed)

§is_recap: bool

Whether this memory is a recap/summary of other memories

§enrichment_status: String

Deprecated: enrichment status is now derived from the enrichment_steps table. This field is ignored on INSERT. Kept for API compatibility with downstream consumers.

§supersede_mode: String

How superseded content is handled: “hide” (default) or “archive” (visible but muted)

§structured_fields: Option<String>

JSON object with type-specific structured fields (e.g. {“claim”: “…”, “context”: “…”})

§retrieval_cue: Option<String>

LLM-generated question this memory answers – embedded for vector search

§source_text: Option<String>

Original prose content, preserved when structured_fields are promoted to primary content

Trait Implementations§

Source§

impl Clone for RawDocument

Source§

fn clone(&self) -> RawDocument

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for RawDocument

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for RawDocument

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RawDocument

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for RawDocument

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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, 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> 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,