Skip to main content

PostgresConversationStore

Struct PostgresConversationStore 

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

PostgreSQL-backed append-only conversation and semantic-memory store.

Implementations§

Source§

impl PostgresConversationStore

Source

pub async fn ensure_schema(&self) -> Result<(), PostgresConversationStoreError>

Explicitly creates conversation, transcript, and semantic-memory tables.

Runtime operations never perform hidden migrations.

§Errors

Propagates PostgreSQL DDL failures.

Source

pub async fn ensure_semantic_memory_vector_schema( &self, dimensions: NonZeroU32, ) -> Result<(), PostgresConversationStoreError>

Adds a nullable pgvector column and cosine HNSW index for semantic memory.

Call this explicitly after Self::ensure_schema and before enabling a vector-configured store in production.

§Errors

Propagates extension and DDL failures.

Source§

impl PostgresConversationStore

Source

pub async fn connect( connection: &str, table: &str, ) -> Result<Self, PostgresConversationStoreError>

Connects without creating or changing schema.

§Errors

Rejects unsafe table identifiers and propagates connection failures.

Source

pub fn with_semantic_memory_embedder( self, embedder: Arc<dyn EmbeddingModel>, ) -> Self

Enables vector semantic-memory writes and searches for scoped operations.

Trait Implementations§

Source§

impl ArtifactStore for PostgresConversationStore

Source§

fn put( &self, write: ArtifactWrite, ) -> ArtifactFuture<'_, Result<ArtifactRef, ArtifactError>>

Idempotently writes content and returns its integrity-bound reference.
Source§

fn get( &self, reference: &ArtifactRef, ) -> ArtifactFuture<'_, Result<Artifact, ArtifactError>>

Loads and verifies one artifact.
Source§

fn list( &self, scope: &ArtifactScope, after: Option<&str>, limit: u32, ) -> ArtifactFuture<'_, Result<ArtifactPage, ArtifactError>>

Lists one stable, bounded page inside one scope.
Source§

fn delete( &self, scope: &ArtifactScope, artifact_id: &str, ) -> ArtifactFuture<'_, Result<bool, ArtifactError>>

Idempotently deletes one artifact and its idempotency records.
Source§

fn purge_expired( &self, scope: &ArtifactScope, now_unix_ms: u64, limit: u32, ) -> ArtifactFuture<'_, Result<u32, ArtifactError>>

Deletes at most limit expired artifacts in one scope.
Source§

impl CheckpointStore for PostgresConversationStore

Source§

fn load(&self, id: CheckpointId) -> Result<Checkpoint, CheckpointError>

Loads the latest checkpoint revision. Read more
Source§

fn compare_and_swap( &self, checkpoint: &Checkpoint, expected_revision: Option<u64>, ) -> Result<(), CheckpointError>

Creates or atomically replaces a checkpoint. Read more
Source§

impl Clone for PostgresConversationStore

Source§

fn clone(&self) -> PostgresConversationStore

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 ConversationStore for PostgresConversationStore

Source§

fn create( &self, conversation_id: ConversationId, namespace: MemoryNamespace, ) -> ConversationStoreFuture<'_, Result<ConversationCreateOutcome, ConversationStoreError>>

Idempotently creates one empty conversation.
Source§

fn load_view( &self, conversation_id: ConversationId, namespace: MemoryNamespace, window: ConversationWindow, summary_batch: ConversationSummaryBatch, ) -> ConversationStoreFuture<'_, Result<ConversationView, ConversationStoreError>>

Loads a bounded view without deleting or rewriting transcript entries.
Source§

fn list_transcript( &self, conversation_id: ConversationId, namespace: MemoryNamespace, after: Option<ConversationSequence>, limit: ConversationWindow, ) -> ConversationStoreFuture<'_, Result<Vec<ConversationTranscriptEntry>, ConversationStoreError>>

Lists immutable transcript entries strictly after an optional sequence.
Source§

fn append( &self, namespace: MemoryNamespace, command: ConversationAppend, ) -> ConversationStoreFuture<'_, Result<ConversationVersion, ConversationStoreError>>

Atomically appends canonical messages under the expected version.
Source§

fn commit_summary( &self, namespace: MemoryNamespace, command: ConversationSummaryCommit, ) -> ConversationStoreFuture<'_, Result<ConversationSummary, ConversationStoreError>>

Monotonically replaces the lossy summary under the expected transcript version.
Source§

fn upsert_memory( &self, command: SemanticMemoryUpsert, ) -> ConversationStoreFuture<'_, Result<SemanticMemory, ConversationStoreError>>

Creates or compare-and-swaps one explicitly curated semantic memory.
Source§

fn search_memory( &self, query: SemanticMemoryQuery, ) -> ConversationStoreFuture<'_, Result<Vec<SemanticMemory>, ConversationStoreError>>

Searches semantic memory without reading transcript or journal storage.
Source§

fn upsert_memory_scoped( &self, command: SemanticMemoryUpsert, context: RetrievalContext, ) -> ConversationStoreFuture<'_, Result<SemanticMemoryUpsertOutcome, ConversationStoreError>>

Writes memory under an explicit cancellation/deadline scope. Read more
Source§

fn search_memory_scoped( &self, query: SemanticMemoryQuery, context: RetrievalContext, ) -> ConversationStoreFuture<'_, Result<SemanticMemorySearchOutcome, ConversationStoreError>>

Searches memory under an explicit cancellation/deadline scope. Read more
Source§

impl Debug for PostgresConversationStore

Source§

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

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

impl DurableConversationStore for PostgresConversationStore

Source§

fn commit_durable_turn( &self, command: DurableConversationCommit, ) -> ConversationStoreFuture<'_, Result<ConversationVersion, ConversationStoreError>>

Atomically appends a transcript turn and advances its checkpoint.
Source§

impl EffectStore for PostgresConversationStore

Source§

fn load( &self, id: EffectId, ) -> Result<Option<EffectRecord>, EffectExecutorError>

Loads a record by effect identity. Read more
Source§

fn find_by_idempotency( &self, capability_id: CapabilityId, key: &str, ) -> Result<Option<EffectRecord>, EffectExecutorError>

Resolves a logical effect by capability-scoped idempotency key. Read more
Source§

fn compare_and_swap( &self, record: &EffectRecord, expected_revision: Option<u64>, ) -> Result<(), EffectExecutorError>

Creates or atomically replaces a record. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.