UNPKG

@escher-dbai/rag-module

Version:

Enterprise RAG module with chat context storage, vector search, and session management. Complete chat history retrieval and streaming content extraction for Electron apps.

92 lines (83 loc) 3.91 kB
/** * Core types for the RAG Desktop Module */ /** * @typedef {Object} RagConfig * @property {string} basePath - Base folder path for RAG operations * @property {string} embeddingModel - Model name (e.g., 'sentence-transformers/all-MiniLM-L6-v2') * @property {string} vectorStore - Vector store type ('qdrant' | 'chroma') * @property {number} chunkSize - Document chunk size in characters * @property {number} searchTopK - Number of top results to return * @property {string} privacyLevel - Privacy level ('anonymous' | 'minimal-aws' | 'minimal-azure' | 'minimal-gcp') * @property {boolean} backendMapping - Enable backend mapping service * @property {Object} s3Config - S3 configuration for sync * @property {Object} azureBlobConfig - Azure Blob storage configuration * @property {Object} gcsConfig - Google Cloud Storage configuration */ /** * @typedef {Object} CloudDocument * @property {string} id - Resource ARN/URI (AWS: arn:aws:ec2:..., Azure: /subscriptions/..., GCP: projects/.../...) * @property {string} content - Document content/description * @property {Object} metadata - Resource metadata * @property {string} metadata.cloud - Cloud provider ('aws' | 'azure' | 'gcp') * @property {string} metadata.service - Service type (e.g., 'ec2', 'vm', 'compute-engine') * @property {string} metadata.region - Region/location * @property {string} metadata.environment - Environment (prod, staging, dev) * @property {string} metadata.resourceType - Specific resource type * @property {Date} createdAt - Creation timestamp * @property {Date} updatedAt - Last update timestamp */ /** * @typedef {Object} KBDocument * @property {string} id - Document ID * @property {string} title - Document title * @property {string} content - Document content * @property {Object} metadata - Document metadata * @property {string} metadata.category - Document category * @property {string[]} metadata.tags - Document tags * @property {string} metadata.source - Document source * @property {Date} createdAt - Creation timestamp * @property {Date} updatedAt - Last update timestamp */ /** * @typedef {Object} SearchResult * @property {string} id - Document ID * @property {string} content - Document content * @property {Object} metadata - Document metadata * @property {number} score - Similarity score (0-1) * @property {string} type - Document type ('estate' | 'kb') */ /** * @typedef {Object} ExternalIdentifier * @property {string} [anonymousId] - Anonymous identifier (privacy level: anonymous) * @property {string} [resourceId] - Resource ID (privacy level: minimal-*) * @property {string} [region] - Region (privacy level: minimal-*) * @property {string} [serviceType] - Service type (privacy level: minimal-*) * @property {string} [cloud] - Cloud provider (privacy level: minimal-*) */ /** * @typedef {Object} SearchOptions * @property {number} [limit] - Maximum results to return * @property {string[]} [clouds] - Filter by cloud providers * @property {string[]} [services] - Filter by services * @property {string[]} [regions] - Filter by regions * @property {string[]} [environments] - Filter by environments * @property {boolean} [externalFormat] - Return external identifiers * @property {Object} [metadata] - Additional metadata filters */ /** * @typedef {Object} BulkOperation * @property {string} operation - Operation type ('create' | 'update' | 'delete') * @property {string} [id] - Document ID (for update/delete) * @property {Object} [document] - Document data (for create/update) */ /** * @typedef {Object} SyncOptions * @property {boolean} encrypt - Enable encryption * @property {string} encryptionKey - Encryption key * @property {string} [cloud] - Cloud provider for sync ('aws' | 'azure' | 'gcp') * @property {boolean} [incremental] - Incremental sync only */ module.exports = { // Export types for TypeScript users };