symfonic.memory.backends.postgres_conversation¶
postgres_conversation ¶
Durable, exact-conversation append/tail storage on the shared Postgres pool.
The cursor row is locked for the whole append transaction. Two processes publishing to one conversation therefore receive distinct monotonically increasing positions; UUIDs and wall-clock timestamps never order a window. The caller must authorize the conversation before passing its key here.
PostgresConversationLog ¶
A durable log; all identities have already passed an authorizer.
Since 11.3.0 a log used on its own needs erase_anchor= (a
PostgresEraseAnchor with a name unique to this database) and
receipt_key=; composed beside raw PostgreSQL v1 memory, memory's
eraser guards its pool instead. Otherwise every read and write refuses
(postgres_conversation_anchor).
Source code in src/symfonic/memory/backends/postgres_conversation.py
proof
property
¶
The conversation erase proof, or None when memory's anchor must guard the pool.
append_final
async
¶
append_final(key: ConversationKey, run_id: str, user: str, assistant: str, *, generation: tuple[tuple[str, int], ...] | None = None) -> int
Publish one exchange; generation is the turn's captured erase token.
Source code in src/symfonic/memory/backends/postgres_conversation.py
154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
export
async
¶
Return rows owned by this scope or descendants for a privacy export.
forget
async
¶
Erase this scope's log and descendants; FK cascade removes turns.
An anchored log logs the erase in its transaction and returns only once
the anchor has recorded it, else NOT_ANCHORED; inside a caller
transaction it cannot, so it refuses UNANCHORABLE first.
Source code in src/symfonic/memory/backends/postgres_conversation.py
fork
async
¶
Atomically clone an authorized transcript into an unused session.