RAG Sync

Interfaces

Interfaces

ConnectionConfig

Configuration for connection status display

Properties:

PropertyTypeRequiredDescription
surrealdbUrlstringYes
rxdbUrlstringYes
redisUrlstringYes
ollamaUrlstringYes
ollamaModelstringYes

ErrorEntry

Error entry stored in the recent errors ring buffer

Properties:

PropertyTypeRequiredDescription
documentIdstringYes
errorstringYes
timestampstringYes
attemptsnumberYes

PipelineMetrics

Pipeline metrics for sync processing

Properties:

PropertyTypeRequiredDescription
queueDepthnumberYes
activeProcessingnumberYes
maxConcurrencynumberYes
totalProcessednumberYes
totalSkippednumberYes
totalErrorsnumberYes
totalRetriesnumberYes
processedByCollectionRecord<string, number>Yes
skippedByCollectionRecord<string, number>Yes
recentErrorsErrorEntry[]Yes

ServiceMetrics

Service metrics for health status

Properties:

PropertyTypeRequiredDescription
uptimenumberYes
startedAtstringYes
versionstringYes

MetricsSnapshot

Complete metrics snapshot

Properties:

PropertyTypeRequiredDescription
serviceServiceMetricsYes
pipelinePipelineMetricsYes

AMSMemoryClientConfig

Configuration for AMS Memory Client connection

Properties:

PropertyTypeRequiredDescription
redisUrlstringYesRedis connection URL (e.g., 'redis://localhost:6379')

MemoryEvent

Memory event from AMS Redis pub/sub channel

Properties:

PropertyTypeRequiredDescription
type"create" | "update" | "delete"YesEvent type: create, update, or delete
namespacestringYesNamespace for the memory (e.g., user ID or session group)
sessionIdstringYesSession ID associated with the memory
memoryIdstring | undefinedNoMemory ID (optional for some event types)
contentstring | undefinedNoMemory text content
topicsstring[] | undefinedNoExtracted topics from the memory
entitiesstring[] | undefinedNoExtracted entities from the memory

Memory

Long-term memory stored in AMS

Properties:

PropertyTypeRequiredDescription
idstringYesUnique memory identifier
contentstringYesMemory text content
topicsstring[]YesExtracted topics
entitiesstring[]YesExtracted entities
sessionIdstringYesSession ID that created the memory
namespacestringYesNamespace for the memory
createdAtstringYesCreation timestamp

NativeRxDBClientConfig

Configuration for Native RxDB Client

Properties:

PropertyTypeRequiredDescription
wsUrlstringYesWebSocket URL to RxDB server
tokenstring | undefinedNoAuthentication token for service accounts
batchSizenumber | undefinedNoBatch size for replication pulls

RxDBReplicationClientConfig

Configuration for RxDB Replication Client

Properties:

PropertyTypeRequiredDescription
wsUrlstringYesWebSocket URL to RxDB server (e.g., 'ws://localhost:3002/ws/replication')
collectionsstring[]YesCollection names to subscribe to for document changes
tokenstring | undefinedNoOptional authentication token for service accounts

DocumentChangeEvent

Document change event from RxDB replication

Properties:

PropertyTypeRequiredDescription
collectionstringYesCollection name (e.g., 'tasks', 'projects')
operation"INSERT" | "UPDATE" | "DELETE"YesOperation type
documentIdstringYesDocument ID from RxDB
documentRecord<string, unknown> | nullYesNew/current document data (null for DELETE)
previousDocumentRecord<string, unknown> | undefinedNoPrevious document data (for UPDATE operations)

SurrealDBConfig

Configuration for SurrealDB connection

Properties:

PropertyTypeRequiredDescription
urlstringYesWebSocket URL to SurrealDB instance
usernamestringYesUsername for authentication
passwordstringYesPassword for authentication
namespacestringYesNamespace to use
databasestringYesDatabase to use

RAGDocument

Document to be stored in RAG vector database

Properties:

PropertyTypeRequiredDescription
collectionstringYesSource collection name (e.g., 'tasks', 'projects')
docIdstringYesOriginal document ID from RxDB
contentstringYesText content for this chunk
chunkIndexnumberYesChunk index for multi-chunk documents
embeddingnumber[]YesVector embedding for semantic search
metadataRecord<string, unknown>YesAdditional metadata from source document
orgIdstringYesOrganization ID for multi-tenancy
workspaceIdstringYesWorkspace ID for multi-tenancy
contentHashstringYesMD5 hash of source document content for deduplication

VectorSearchOptions

Options for vector similarity search

Properties:

PropertyTypeRequiredDescription
queryVectornumber[]YesQuery vector to search against
workspaceIdstring | undefinedNoFilter by workspace ID
orgIdstring | undefinedNoFilter by organization ID
collectionsstring[] | undefinedNoFilter by specific collections
limitnumber | undefinedNoMaximum number of results to return
minScorenumber | undefinedNoMinimum similarity score (0-1)

SearchResult

Vector search result with metadata

Properties:

PropertyTypeRequiredDescription
idstringYesRecord ID in SurrealDB
collectionstringYesSource collection name
docIdstringYesOriginal document ID
contentstringYesText content
chunkIndexnumberYesChunk index
metadataRecord<string, unknown>YesDocument metadata
scorenumberYesSimilarity score (0-1, higher is better)

LocalDatabaseConfig

Configuration for local database creation

Properties:

PropertyTypeRequiredDescription
namestringYesDatabase name (should be unique per instance)
collectionNamesstring[]YesCollection names to include in the database

ChunkConfig

Configuration for chunking and processing documents from a specific collection. Defines which fields to extract, how to split the text, and how to format the content for embedding generation.

Properties:

PropertyTypeRequiredDescription
fieldsstring[]YesThe document fields to include in processing
chunkSizenumberYesMaximum size of each text chunk in characters
chunkOverlapnumberYesNumber of overlapping characters between consecutive chunks
template(doc: Record<string, unknown>) => stringYesFunction that formats document fields into a single text string

ProcessedChunk

Represents a single chunk of processed document content with its embedding. Each chunk contains a portion of the original document text, its position index, the vector embedding for semantic search, and associated metadata.

Properties:

PropertyTypeRequiredDescription
contentstringYesThe text content of this chunk
chunkIndexnumberYesThe zero-based index indicating this chunk's position in the document
embeddingnumber[]YesThe vector embedding representation of the chunk content
metadataRecord<string, unknown>YesAdditional metadata associated with this chunk

ProcessedDocument

Represents a fully processed document ready for storage in the vector database. Contains the original document identifiers and all processed chunks with embeddings.

Properties:

PropertyTypeRequiredDescription
docIdstringYesThe unique identifier of the source document
collectionstringYesThe collection type this document belongs to
orgIdstringYesThe organization identifier
workspaceIdstringYesThe workspace identifier
chunksProcessedChunk[]YesArray of processed chunks with embeddings

EmbeddingServiceConfig

Configuration for EmbeddingService

Properties:

PropertyTypeRequiredDescription
ollamaUrlstringYesOllama server URL (e.g., 'http://localhost:11434')
modelstringYesEmbedding model to use (e.g., 'nomic-embed-text')
timeoutnumber | undefinedNoRequest timeout in milliseconds (default: 120000 = 2 minutes)
Previous
API Reference
Next
Types