Interface: IMigrationTarget
Defined in: packages/agentos/src/cognition/rag/migration/types.ts:125
Adapter for writing data to a migration target backend. Implementations exist for SQLite, Postgres, and Qdrant.
Methods
clearScopeIdForm()?
optionalclearScopeIdForm(brainId):Promise<void>
Defined in: packages/agentos/src/cognition/rag/migration/types.ts:149
Removes one brain's scope-id form record, when the handshake gives the copy the source's plain form.
Parameters
brainId
string
Returns
Promise<void>
close()
close():
Promise<void>
Defined in: packages/agentos/src/cognition/rag/migration/types.ts:151
Close the connection and release resources.
Returns
Promise<void>
ensureTable()
ensureTable(
table,sampleRow):Promise<void>
Defined in: packages/agentos/src/cognition/rag/migration/types.ts:132
Ensure the target schema/collection exists for a table. Creates it if it doesn't exist, using a sample row to infer column types.
Parameters
table
string
Table name to create.
sampleRow
Record<string, unknown>
A sample row to derive schema from.
Returns
Promise<void>
scopeIdForms()?
optionalscopeIdForms(brainIds?):Promise<Map<string,BrainScopeIdForm>>
Defined in: packages/agentos/src/cognition/rag/migration/types.ts:147
These brains as the target holds them, with their scope-id forms, for the handshake the engine runs before it copies any table; a brain the target does not hold reads as holding nothing. With no ids, every brain the target holds. A Qdrant target reads its sidecar, and counts a brain the sidecar holds as holding traces whose scope ids the two forms read apart, since its traces are in Qdrant; one with no sidecar leaves it out.
Parameters
brainIds?
readonly string[]
Returns
Promise<Map<string, BrainScopeIdForm>>
writeBatch()
writeBatch(
table,rows):Promise<number>
Defined in: packages/agentos/src/cognition/rag/migration/types.ts:140
Write a batch of rows to the target. Uses INSERT OR REPLACE / upsert semantics to handle duplicates.
Parameters
table
string
Table name to write to.
rows
Record<string, unknown>[]
Array of row objects.
Returns
Promise<number>
Number of rows successfully written.