@retrivora-ai/rag-engine 1.9.7 → 1.9.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/README.md +136 -136
  2. package/dist/{ILLMProvider-Bhk6zJOK.d.mts → ILLMProvider-DMxLyTdq.d.mts} +59 -4
  3. package/dist/{ILLMProvider-Bhk6zJOK.d.ts → ILLMProvider-DMxLyTdq.d.ts} +59 -4
  4. package/dist/handlers/index.d.mts +2 -2
  5. package/dist/handlers/index.d.ts +2 -2
  6. package/dist/handlers/index.js +2327 -474
  7. package/dist/handlers/index.mjs +2329 -473
  8. package/dist/{index-B9J_XEh0.d.ts → index-CfkqZd2Y.d.ts} +12 -2
  9. package/dist/{index-C3SVtPYg.d.mts → index-DXd29KMq.d.mts} +27 -52
  10. package/dist/{index-Bu7T6xgr.d.ts → index-D_bOdJML.d.ts} +27 -52
  11. package/dist/{index-BJ4cd-t5.d.mts → index-xygonxpW.d.mts} +12 -2
  12. package/dist/index.css +783 -550
  13. package/dist/index.d.mts +35 -7
  14. package/dist/index.d.ts +35 -7
  15. package/dist/index.js +419 -282
  16. package/dist/index.mjs +426 -292
  17. package/dist/server.d.mts +65 -6
  18. package/dist/server.d.ts +65 -6
  19. package/dist/server.js +2185 -317
  20. package/dist/server.mjs +2185 -317
  21. package/package.json +13 -8
  22. package/src/app/constants.tsx +37 -7
  23. package/src/app/page.tsx +2 -0
  24. package/src/components/ChatWidget.tsx +2 -1
  25. package/src/components/ChatWindow.tsx +4 -1
  26. package/src/components/CodeViewer.tsx +19 -14
  27. package/src/components/MarkdownComponents.tsx +44 -1
  28. package/src/components/MessageBubble.tsx +162 -50
  29. package/src/components/constants.tsx +228 -0
  30. package/src/config/RagConfig.ts +48 -2
  31. package/src/config/constants.ts +4 -0
  32. package/src/config/serverConfig.ts +15 -0
  33. package/src/core/ConfigResolver.ts +38 -6
  34. package/src/core/DatabaseStorage.ts +469 -0
  35. package/src/core/LicenseVerifier.ts +260 -0
  36. package/src/core/MultiAgentCoordinator.ts +239 -0
  37. package/src/core/Pipeline.ts +151 -18
  38. package/src/core/Retrivora.ts +7 -0
  39. package/src/core/VectorPlugin.ts +12 -3
  40. package/src/core/mcp.ts +261 -0
  41. package/src/handlers/index.ts +449 -63
  42. package/src/hooks/useRagChat.ts +96 -42
  43. package/src/hooks/useStoredMessages.ts +15 -4
  44. package/src/index.ts +3 -0
  45. package/src/llm/LLMFactory.ts +9 -1
  46. package/src/llm/providers/GroqProvider.ts +176 -0
  47. package/src/llm/providers/QwenProvider.ts +191 -0
  48. package/src/server.ts +7 -0
  49. package/src/types/chat.ts +14 -0
  50. package/src/types/props.ts +12 -0
  51. package/.env.example +0 -80
  52. package/LICENSE.txt +0 -21
  53. package/src/components/AmbientBackground.tsx +0 -29
  54. package/src/components/ArchitectureCard.tsx +0 -17
  55. package/src/components/ArchitectureCardsSection.tsx +0 -15
  56. package/src/components/DocViewer.tsx +0 -103
  57. package/src/components/Documentation.tsx +0 -121
  58. package/src/components/Hero.tsx +0 -59
  59. package/src/components/Lifecycle.tsx +0 -37
  60. package/src/components/Navbar.tsx +0 -55
package/dist/server.d.mts CHANGED
@@ -1,10 +1,34 @@
1
- import { p as VectorDBConfig, L as LLMConfig, e as EmbeddingConfig, k as RagConfig, n as UniversalRagConfig, o as UpsertDocument, V as VectorMatch, G as GraphDBConfig, r as GraphNode, s as Edge, t as GraphSearchResult, I as ILLMProvider, q as VectorDBProvider, h as LLMProvider, f as EmbeddingProvider, j as RAGConfig, U as UIConfig, C as ChatMessage, c as ChatOptions, E as EmbedOptions } from './ILLMProvider-Bhk6zJOK.mjs';
2
- export { d as ChatResponse, g as IngestDocument, l as RetrievalConfig, W as WorkflowConfig } from './ILLMProvider-Bhk6zJOK.mjs';
3
- export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, D as DocumentChunker, E as EmbeddingFailedException, g as Pipeline, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode, w as wrapError } from './index-BJ4cd-t5.mjs';
4
- import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-C3SVtPYg.mjs';
5
- export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createHealthHandler, e as createIngestHandler, f as createRagHandler, g as createStreamHandler, h as createUploadHandler, s as sseErrorFrame, i as sseFrame, j as sseMetaFrame, k as sseTextFrame } from './index-C3SVtPYg.mjs';
1
+ import { p as VectorDBConfig, L as LLMConfig, e as EmbeddingConfig, k as RagConfig, n as UniversalRagConfig, o as UpsertDocument, V as VectorMatch, G as GraphDBConfig, r as GraphNode, s as Edge, t as GraphSearchResult, I as ILLMProvider, q as VectorDBProvider, h as LLMProvider, f as EmbeddingProvider, j as RAGConfig, U as UIConfig, C as ChatMessage, c as ChatOptions, E as EmbedOptions } from './ILLMProvider-DMxLyTdq.mjs';
2
+ export { d as ChatResponse, g as IngestDocument, l as RetrievalConfig, W as WorkflowConfig } from './ILLMProvider-DMxLyTdq.mjs';
3
+ export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, D as DocumentChunker, E as EmbeddingFailedException, g as Pipeline, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode, w as wrapError } from './index-xygonxpW.mjs';
4
+ import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-DXd29KMq.mjs';
5
+ export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createFeedbackHandler, e as createHealthHandler, f as createHistoryHandler, g as createIngestHandler, h as createRagHandler, i as createSessionsHandler, j as createStreamHandler, k as createUploadHandler, s as sseErrorFrame, l as sseFrame, m as sseMetaFrame, n as sseTextFrame } from './index-DXd29KMq.mjs';
6
6
  import 'next/server';
7
7
 
8
+ interface LicensePayload {
9
+ projectId: string;
10
+ expiresAt: number;
11
+ tier: string;
12
+ }
13
+ /**
14
+ * LicenseVerifier — handles cryptographic validation of signed JWT license keys.
15
+ * Enables zero-latency local license validation without external network calls.
16
+ */
17
+ declare class LicenseVerifier {
18
+ private static readonly cache;
19
+ private static readonly CACHE_TTL_MS;
20
+ private static readonly PUBLIC_KEY;
21
+ /**
22
+ * Decodes, verifies signature, and checks metadata of a license key.
23
+ *
24
+ * @param licenseKey - Base64url signed JWT license key.
25
+ * @param currentProjectId - Project namespace ID.
26
+ * @param publicKeyOverride - Optional override for unit/integration tests.
27
+ */
28
+ static verify(licenseKey: string | undefined, currentProjectId: string, provider?: string, publicKeyOverride?: string): LicensePayload;
29
+ static verifyIP(licenseKey: string | undefined): Promise<void>;
30
+ }
31
+
8
32
  /**
9
33
  * BatchProcessor.ts — Handles batch operations with retry logic.
10
34
  *
@@ -901,6 +925,41 @@ declare class OllamaProvider implements ILLMProvider {
901
925
  ping(): Promise<boolean>;
902
926
  }
903
927
 
928
+ /**
929
+ * Groq LLM Provider
930
+ */
931
+
932
+ declare class GroqProvider implements ILLMProvider {
933
+ private readonly client;
934
+ private readonly llmConfig;
935
+ constructor(llmConfig: LLMConfig, embeddingConfig?: EmbeddingConfig);
936
+ static getValidator(): IProviderValidator;
937
+ static getHealthChecker(): IProviderHealthChecker;
938
+ chat(messages: ChatMessage[], context: string, options?: ChatOptions): Promise<string>;
939
+ chatStream(messages: ChatMessage[], context: string, options?: ChatOptions): AsyncIterable<string>;
940
+ embed(text: string, options?: EmbedOptions): Promise<number[]>;
941
+ batchEmbed(texts: string[], options?: EmbedOptions): Promise<number[][]>;
942
+ ping(): Promise<boolean>;
943
+ }
944
+
945
+ /**
946
+ * Qwen LLM Provider (via Alibaba DashScope / ModelStudio compatible mode)
947
+ */
948
+
949
+ declare class QwenProvider implements ILLMProvider {
950
+ private readonly client;
951
+ private readonly llmConfig;
952
+ private readonly embeddingConfig?;
953
+ constructor(llmConfig: LLMConfig, embeddingConfig?: EmbeddingConfig);
954
+ static getValidator(): IProviderValidator;
955
+ static getHealthChecker(): IProviderHealthChecker;
956
+ chat(messages: ChatMessage[], context: string, options?: ChatOptions): Promise<string>;
957
+ chatStream(messages: ChatMessage[], context: string, options?: ChatOptions): AsyncIterable<string>;
958
+ embed(text: string, options?: EmbedOptions): Promise<number[]>;
959
+ batchEmbed(texts: string[], options?: EmbedOptions): Promise<number[][]>;
960
+ ping(): Promise<boolean>;
961
+ }
962
+
904
963
  declare class UniversalLLMAdapter implements ILLMProvider {
905
964
  private readonly http;
906
965
  private readonly model;
@@ -924,4 +983,4 @@ declare class UniversalLLMAdapter implements ILLMProvider {
924
983
  ping(): Promise<boolean>;
925
984
  }
926
985
 
927
- export { AnthropicProvider, BaseVectorProvider, type BatchOptions, BatchProcessor, type BatchResult, ChatMessage, ChatOptions, ChromaDBProvider, ConfigBuilder, ConfigResolver, DocumentParser, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, MilvusProvider, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, PRESETS, PineconeProvider, PostgreSQLProvider, ProviderHealthCheck, ProviderRegistry, QdrantProvider, RAGConfig, RagConfig, RedisProvider, UIConfig, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, WeaviateProvider, createFromPreset, getRagConfig };
986
+ export { AnthropicProvider, BaseVectorProvider, type BatchOptions, BatchProcessor, type BatchResult, ChatMessage, ChatOptions, ChromaDBProvider, ConfigBuilder, ConfigResolver, DocumentParser, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, GroqProvider, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, type LicensePayload, LicenseVerifier, MilvusProvider, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, PRESETS, PineconeProvider, PostgreSQLProvider, ProviderHealthCheck, ProviderRegistry, QdrantProvider, QwenProvider, RAGConfig, RagConfig, RedisProvider, UIConfig, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, WeaviateProvider, createFromPreset, getRagConfig };
package/dist/server.d.ts CHANGED
@@ -1,10 +1,34 @@
1
- import { p as VectorDBConfig, L as LLMConfig, e as EmbeddingConfig, k as RagConfig, n as UniversalRagConfig, o as UpsertDocument, V as VectorMatch, G as GraphDBConfig, r as GraphNode, s as Edge, t as GraphSearchResult, I as ILLMProvider, q as VectorDBProvider, h as LLMProvider, f as EmbeddingProvider, j as RAGConfig, U as UIConfig, C as ChatMessage, c as ChatOptions, E as EmbedOptions } from './ILLMProvider-Bhk6zJOK.js';
2
- export { d as ChatResponse, g as IngestDocument, l as RetrievalConfig, W as WorkflowConfig } from './ILLMProvider-Bhk6zJOK.js';
3
- export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, D as DocumentChunker, E as EmbeddingFailedException, g as Pipeline, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode, w as wrapError } from './index-B9J_XEh0.js';
4
- import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-Bu7T6xgr.js';
5
- export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createHealthHandler, e as createIngestHandler, f as createRagHandler, g as createStreamHandler, h as createUploadHandler, s as sseErrorFrame, i as sseFrame, j as sseMetaFrame, k as sseTextFrame } from './index-Bu7T6xgr.js';
1
+ import { p as VectorDBConfig, L as LLMConfig, e as EmbeddingConfig, k as RagConfig, n as UniversalRagConfig, o as UpsertDocument, V as VectorMatch, G as GraphDBConfig, r as GraphNode, s as Edge, t as GraphSearchResult, I as ILLMProvider, q as VectorDBProvider, h as LLMProvider, f as EmbeddingProvider, j as RAGConfig, U as UIConfig, C as ChatMessage, c as ChatOptions, E as EmbedOptions } from './ILLMProvider-DMxLyTdq.js';
2
+ export { d as ChatResponse, g as IngestDocument, l as RetrievalConfig, W as WorkflowConfig } from './ILLMProvider-DMxLyTdq.js';
3
+ export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, D as DocumentChunker, E as EmbeddingFailedException, g as Pipeline, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode, w as wrapError } from './index-CfkqZd2Y.js';
4
+ import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-D_bOdJML.js';
5
+ export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createFeedbackHandler, e as createHealthHandler, f as createHistoryHandler, g as createIngestHandler, h as createRagHandler, i as createSessionsHandler, j as createStreamHandler, k as createUploadHandler, s as sseErrorFrame, l as sseFrame, m as sseMetaFrame, n as sseTextFrame } from './index-D_bOdJML.js';
6
6
  import 'next/server';
7
7
 
8
+ interface LicensePayload {
9
+ projectId: string;
10
+ expiresAt: number;
11
+ tier: string;
12
+ }
13
+ /**
14
+ * LicenseVerifier — handles cryptographic validation of signed JWT license keys.
15
+ * Enables zero-latency local license validation without external network calls.
16
+ */
17
+ declare class LicenseVerifier {
18
+ private static readonly cache;
19
+ private static readonly CACHE_TTL_MS;
20
+ private static readonly PUBLIC_KEY;
21
+ /**
22
+ * Decodes, verifies signature, and checks metadata of a license key.
23
+ *
24
+ * @param licenseKey - Base64url signed JWT license key.
25
+ * @param currentProjectId - Project namespace ID.
26
+ * @param publicKeyOverride - Optional override for unit/integration tests.
27
+ */
28
+ static verify(licenseKey: string | undefined, currentProjectId: string, provider?: string, publicKeyOverride?: string): LicensePayload;
29
+ static verifyIP(licenseKey: string | undefined): Promise<void>;
30
+ }
31
+
8
32
  /**
9
33
  * BatchProcessor.ts — Handles batch operations with retry logic.
10
34
  *
@@ -901,6 +925,41 @@ declare class OllamaProvider implements ILLMProvider {
901
925
  ping(): Promise<boolean>;
902
926
  }
903
927
 
928
+ /**
929
+ * Groq LLM Provider
930
+ */
931
+
932
+ declare class GroqProvider implements ILLMProvider {
933
+ private readonly client;
934
+ private readonly llmConfig;
935
+ constructor(llmConfig: LLMConfig, embeddingConfig?: EmbeddingConfig);
936
+ static getValidator(): IProviderValidator;
937
+ static getHealthChecker(): IProviderHealthChecker;
938
+ chat(messages: ChatMessage[], context: string, options?: ChatOptions): Promise<string>;
939
+ chatStream(messages: ChatMessage[], context: string, options?: ChatOptions): AsyncIterable<string>;
940
+ embed(text: string, options?: EmbedOptions): Promise<number[]>;
941
+ batchEmbed(texts: string[], options?: EmbedOptions): Promise<number[][]>;
942
+ ping(): Promise<boolean>;
943
+ }
944
+
945
+ /**
946
+ * Qwen LLM Provider (via Alibaba DashScope / ModelStudio compatible mode)
947
+ */
948
+
949
+ declare class QwenProvider implements ILLMProvider {
950
+ private readonly client;
951
+ private readonly llmConfig;
952
+ private readonly embeddingConfig?;
953
+ constructor(llmConfig: LLMConfig, embeddingConfig?: EmbeddingConfig);
954
+ static getValidator(): IProviderValidator;
955
+ static getHealthChecker(): IProviderHealthChecker;
956
+ chat(messages: ChatMessage[], context: string, options?: ChatOptions): Promise<string>;
957
+ chatStream(messages: ChatMessage[], context: string, options?: ChatOptions): AsyncIterable<string>;
958
+ embed(text: string, options?: EmbedOptions): Promise<number[]>;
959
+ batchEmbed(texts: string[], options?: EmbedOptions): Promise<number[][]>;
960
+ ping(): Promise<boolean>;
961
+ }
962
+
904
963
  declare class UniversalLLMAdapter implements ILLMProvider {
905
964
  private readonly http;
906
965
  private readonly model;
@@ -924,4 +983,4 @@ declare class UniversalLLMAdapter implements ILLMProvider {
924
983
  ping(): Promise<boolean>;
925
984
  }
926
985
 
927
- export { AnthropicProvider, BaseVectorProvider, type BatchOptions, BatchProcessor, type BatchResult, ChatMessage, ChatOptions, ChromaDBProvider, ConfigBuilder, ConfigResolver, DocumentParser, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, MilvusProvider, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, PRESETS, PineconeProvider, PostgreSQLProvider, ProviderHealthCheck, ProviderRegistry, QdrantProvider, RAGConfig, RagConfig, RedisProvider, UIConfig, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, WeaviateProvider, createFromPreset, getRagConfig };
986
+ export { AnthropicProvider, BaseVectorProvider, type BatchOptions, BatchProcessor, type BatchResult, ChatMessage, ChatOptions, ChromaDBProvider, ConfigBuilder, ConfigResolver, DocumentParser, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, GroqProvider, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, type LicensePayload, LicenseVerifier, MilvusProvider, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, PRESETS, PineconeProvider, PostgreSQLProvider, ProviderHealthCheck, ProviderRegistry, QdrantProvider, QwenProvider, RAGConfig, RagConfig, RedisProvider, UIConfig, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, WeaviateProvider, createFromPreset, getRagConfig };