RAG Sync
Interfaces
Interfaces
ConnectionConfig
Configuration for connection status display
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
surrealdbUrl | string | Yes | |
rxdbUrl | string | Yes | |
redisUrl | string | Yes | |
ollamaUrl | string | Yes | |
ollamaModel | string | Yes |
ErrorEntry
Error entry stored in the recent errors ring buffer
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
documentId | string | Yes | |
error | string | Yes | |
timestamp | string | Yes | |
attempts | number | Yes |
PipelineMetrics
Pipeline metrics for sync processing
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
queueDepth | number | Yes | |
activeProcessing | number | Yes | |
maxConcurrency | number | Yes | |
totalProcessed | number | Yes | |
totalSkipped | number | Yes | |
totalErrors | number | Yes | |
totalRetries | number | Yes | |
processedByCollection | Record<string, number> | Yes | |
skippedByCollection | Record<string, number> | Yes | |
recentErrors | ErrorEntry[] | Yes |
ServiceMetrics
Service metrics for health status
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
uptime | number | Yes | |
startedAt | string | Yes | |
version | string | Yes |
MetricsSnapshot
Complete metrics snapshot
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
service | ServiceMetrics | Yes | |
pipeline | PipelineMetrics | Yes |
AMSMemoryClientConfig
Configuration for AMS Memory Client connection
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
redisUrl | string | Yes | Redis connection URL (e.g., 'redis://localhost:6379') |
MemoryEvent
Memory event from AMS Redis pub/sub channel
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
type | "create" | "update" | "delete" | Yes | Event type: create, update, or delete |
namespace | string | Yes | Namespace for the memory (e.g., user ID or session group) |
sessionId | string | Yes | Session ID associated with the memory |
memoryId | string | undefined | No | Memory ID (optional for some event types) |
content | string | undefined | No | Memory text content |
topics | string[] | undefined | No | Extracted topics from the memory |
entities | string[] | undefined | No | Extracted entities from the memory |
Memory
Long-term memory stored in AMS
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Unique memory identifier |
content | string | Yes | Memory text content |
topics | string[] | Yes | Extracted topics |
entities | string[] | Yes | Extracted entities |
sessionId | string | Yes | Session ID that created the memory |
namespace | string | Yes | Namespace for the memory |
createdAt | string | Yes | Creation timestamp |
NativeRxDBClientConfig
Configuration for Native RxDB Client
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
wsUrl | string | Yes | WebSocket URL to RxDB server |
token | string | undefined | No | Authentication token for service accounts |
batchSize | number | undefined | No | Batch size for replication pulls |
RxDBReplicationClientConfig
Configuration for RxDB Replication Client
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
wsUrl | string | Yes | WebSocket URL to RxDB server (e.g., 'ws://localhost:3002/ws/replication') |
collections | string[] | Yes | Collection names to subscribe to for document changes |
token | string | undefined | No | Optional authentication token for service accounts |
DocumentChangeEvent
Document change event from RxDB replication
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | Collection name (e.g., 'tasks', 'projects') |
operation | "INSERT" | "UPDATE" | "DELETE" | Yes | Operation type |
documentId | string | Yes | Document ID from RxDB |
document | Record<string, unknown> | null | Yes | New/current document data (null for DELETE) |
previousDocument | Record<string, unknown> | undefined | No | Previous document data (for UPDATE operations) |
SurrealDBConfig
Configuration for SurrealDB connection
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
url | string | Yes | WebSocket URL to SurrealDB instance |
username | string | Yes | Username for authentication |
password | string | Yes | Password for authentication |
namespace | string | Yes | Namespace to use |
database | string | Yes | Database to use |
RAGDocument
Document to be stored in RAG vector database
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
collection | string | Yes | Source collection name (e.g., 'tasks', 'projects') |
docId | string | Yes | Original document ID from RxDB |
content | string | Yes | Text content for this chunk |
chunkIndex | number | Yes | Chunk index for multi-chunk documents |
embedding | number[] | Yes | Vector embedding for semantic search |
metadata | Record<string, unknown> | Yes | Additional metadata from source document |
orgId | string | Yes | Organization ID for multi-tenancy |
workspaceId | string | Yes | Workspace ID for multi-tenancy |
contentHash | string | Yes | MD5 hash of source document content for deduplication |
VectorSearchOptions
Options for vector similarity search
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
queryVector | number[] | Yes | Query vector to search against |
workspaceId | string | undefined | No | Filter by workspace ID |
orgId | string | undefined | No | Filter by organization ID |
collections | string[] | undefined | No | Filter by specific collections |
limit | number | undefined | No | Maximum number of results to return |
minScore | number | undefined | No | Minimum similarity score (0-1) |
SearchResult
Vector search result with metadata
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Record ID in SurrealDB |
collection | string | Yes | Source collection name |
docId | string | Yes | Original document ID |
content | string | Yes | Text content |
chunkIndex | number | Yes | Chunk index |
metadata | Record<string, unknown> | Yes | Document metadata |
score | number | Yes | Similarity score (0-1, higher is better) |
LocalDatabaseConfig
Configuration for local database creation
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Database name (should be unique per instance) |
collectionNames | string[] | Yes | Collection 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:
| Property | Type | Required | Description |
|---|---|---|---|
fields | string[] | Yes | The document fields to include in processing |
chunkSize | number | Yes | Maximum size of each text chunk in characters |
chunkOverlap | number | Yes | Number of overlapping characters between consecutive chunks |
template | (doc: Record<string, unknown>) => string | Yes | Function 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:
| Property | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The text content of this chunk |
chunkIndex | number | Yes | The zero-based index indicating this chunk's position in the document |
embedding | number[] | Yes | The vector embedding representation of the chunk content |
metadata | Record<string, unknown> | Yes | Additional 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:
| Property | Type | Required | Description |
|---|---|---|---|
docId | string | Yes | The unique identifier of the source document |
collection | string | Yes | The collection type this document belongs to |
orgId | string | Yes | The organization identifier |
workspaceId | string | Yes | The workspace identifier |
chunks | ProcessedChunk[] | Yes | Array of processed chunks with embeddings |
EmbeddingServiceConfig
Configuration for EmbeddingService
Properties:
| Property | Type | Required | Description |
|---|---|---|---|
ollamaUrl | string | Yes | Ollama server URL (e.g., 'http://localhost:11434') |
model | string | Yes | Embedding model to use (e.g., 'nomic-embed-text') |
timeout | number | undefined | No | Request timeout in milliseconds (default: 120000 = 2 minutes) |