@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/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, MouseEvent, ReactNode } from 'react';
3
- import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-Bhk6zJOK.mjs';
4
- export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievalConfig, m as RetrievedChunk, T as TokenUsage, n as UniversalRagConfig, o as UpsertDocument, p as VectorDBConfig, q as VectorDBProvider, W as WorkflowConfig } from './ILLMProvider-Bhk6zJOK.mjs';
5
- export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, E as EmbeddingFailedException, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode } from './index-BJ4cd-t5.mjs';
3
+ import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-DMxLyTdq.mjs';
4
+ export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievalConfig, m as RetrievedChunk, T as TokenUsage, n as UniversalRagConfig, o as UpsertDocument, p as VectorDBConfig, q as VectorDBProvider, W as WorkflowConfig } from './ILLMProvider-DMxLyTdq.mjs';
5
+ export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, E as EmbeddingFailedException, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode } from './index-xygonxpW.mjs';
6
6
 
7
7
  type ChatViewportSize = 'compact' | 'medium' | 'large';
8
8
  interface ChatWindowProps {
@@ -28,6 +28,11 @@ interface ChatWindowProps {
28
28
  onAddToCart?: (product: Product) => void;
29
29
  /** Optional custom API URL to send chat messages to */
30
30
  apiUrl?: string;
31
+ /**
32
+ * Base URL for Retrivora SDK history/feedback/sessions endpoints.
33
+ * Defaults to '/api/retrivora'. Set this to match your catch-all route location.
34
+ */
35
+ retrivoraApiBase?: string;
31
36
  /** Optional custom headers to send with the chat request */
32
37
  headers?: Record<string, string>;
33
38
  }
@@ -38,6 +43,11 @@ interface ChatWidgetProps {
38
43
  onAddToCart?: (product: Product) => void;
39
44
  /** Optional custom API URL to send chat messages to */
40
45
  apiUrl?: string;
46
+ /**
47
+ * Base URL for Retrivora SDK history/feedback/sessions endpoints.
48
+ * Defaults to '/api/retrivora'.
49
+ */
50
+ retrivoraApiBase?: string;
41
51
  /** Optional custom headers to send with the chat request */
42
52
  headers?: Record<string, string>;
43
53
  }
@@ -49,6 +59,8 @@ interface MessageBubbleProps {
49
59
  accentColor: string;
50
60
  onAddToCart?: (product: Product) => void;
51
61
  viewportSize?: ChatViewportSize;
62
+ /** Called when the user clicks thumbs up or thumbs down on an assistant message */
63
+ onFeedback?: (messageId: string, rating: 'thumbs_up' | 'thumbs_down') => void;
52
64
  }
53
65
  interface ProductCardProps {
54
66
  product: Product;
@@ -92,13 +104,13 @@ interface ConfigProviderProps {
92
104
  children: ReactNode;
93
105
  }
94
106
 
95
- declare function ChatWidget({ position, onAddToCart, apiUrl, headers }: ChatWidgetProps): react_jsx_runtime.JSX.Element | null;
107
+ declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, headers }: ChatWidgetProps): react_jsx_runtime.JSX.Element | null;
96
108
 
97
- declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, headers }: ChatWindowProps): react_jsx_runtime.JSX.Element;
109
+ declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, retrivoraApiBase, headers }: ChatWindowProps): react_jsx_runtime.JSX.Element;
98
110
 
99
111
  declare function DocumentUpload({ namespace, onUploadComplete, className }: DocumentUploadProps): react_jsx_runtime.JSX.Element;
100
112
 
101
- declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
113
+ declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, onFeedback, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
102
114
 
103
115
  declare function SourceCard({ source, index }: SourceCardProps): react_jsx_runtime.JSX.Element;
104
116
 
@@ -111,6 +123,22 @@ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelP
111
123
  declare function ConfigProvider({ config, children, }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
112
124
  declare function useConfig(): ClientConfig;
113
125
 
126
+ interface Snippet {
127
+ id: string;
128
+ title: string;
129
+ description: string;
130
+ code: string;
131
+ language: string;
132
+ }
133
+
134
+ declare function CodeViewer({ snippet }: {
135
+ snippet: Snippet;
136
+ }): react_jsx_runtime.JSX.Element;
137
+
138
+ declare function ProductCard({ product, primaryColor, onAddToCart }: ProductCardProps): react_jsx_runtime.JSX.Element;
139
+
140
+ declare function ProductCarousel({ products, primaryColor, onAddToCart }: ProductCarouselProps): react_jsx_runtime.JSX.Element | null;
141
+
114
142
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
115
143
 
116
144
  /**
@@ -119,4 +147,4 @@ declare function useRagChat(projectId: string, options?: UseRagChatOptions): Use
119
147
  */
120
148
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
121
149
 
122
- export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, type ProductCardProps, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };
150
+ export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, type ProductCardProps, ProductCarousel, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { CSSProperties, MouseEvent, ReactNode } from 'react';
3
- import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-Bhk6zJOK.js';
4
- export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievalConfig, m as RetrievedChunk, T as TokenUsage, n as UniversalRagConfig, o as UpsertDocument, p as VectorDBConfig, q as VectorDBProvider, W as WorkflowConfig } from './ILLMProvider-Bhk6zJOK.js';
5
- export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, E as EmbeddingFailedException, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode } from './index-B9J_XEh0.js';
3
+ import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-DMxLyTdq.js';
4
+ export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievalConfig, m as RetrievedChunk, T as TokenUsage, n as UniversalRagConfig, o as UpsertDocument, p as VectorDBConfig, q as VectorDBProvider, W as WorkflowConfig } from './ILLMProvider-DMxLyTdq.js';
5
+ export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, E as EmbeddingFailedException, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode } from './index-CfkqZd2Y.js';
6
6
 
7
7
  type ChatViewportSize = 'compact' | 'medium' | 'large';
8
8
  interface ChatWindowProps {
@@ -28,6 +28,11 @@ interface ChatWindowProps {
28
28
  onAddToCart?: (product: Product) => void;
29
29
  /** Optional custom API URL to send chat messages to */
30
30
  apiUrl?: string;
31
+ /**
32
+ * Base URL for Retrivora SDK history/feedback/sessions endpoints.
33
+ * Defaults to '/api/retrivora'. Set this to match your catch-all route location.
34
+ */
35
+ retrivoraApiBase?: string;
31
36
  /** Optional custom headers to send with the chat request */
32
37
  headers?: Record<string, string>;
33
38
  }
@@ -38,6 +43,11 @@ interface ChatWidgetProps {
38
43
  onAddToCart?: (product: Product) => void;
39
44
  /** Optional custom API URL to send chat messages to */
40
45
  apiUrl?: string;
46
+ /**
47
+ * Base URL for Retrivora SDK history/feedback/sessions endpoints.
48
+ * Defaults to '/api/retrivora'.
49
+ */
50
+ retrivoraApiBase?: string;
41
51
  /** Optional custom headers to send with the chat request */
42
52
  headers?: Record<string, string>;
43
53
  }
@@ -49,6 +59,8 @@ interface MessageBubbleProps {
49
59
  accentColor: string;
50
60
  onAddToCart?: (product: Product) => void;
51
61
  viewportSize?: ChatViewportSize;
62
+ /** Called when the user clicks thumbs up or thumbs down on an assistant message */
63
+ onFeedback?: (messageId: string, rating: 'thumbs_up' | 'thumbs_down') => void;
52
64
  }
53
65
  interface ProductCardProps {
54
66
  product: Product;
@@ -92,13 +104,13 @@ interface ConfigProviderProps {
92
104
  children: ReactNode;
93
105
  }
94
106
 
95
- declare function ChatWidget({ position, onAddToCart, apiUrl, headers }: ChatWidgetProps): react_jsx_runtime.JSX.Element | null;
107
+ declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, headers }: ChatWidgetProps): react_jsx_runtime.JSX.Element | null;
96
108
 
97
- declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, headers }: ChatWindowProps): react_jsx_runtime.JSX.Element;
109
+ declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, retrivoraApiBase, headers }: ChatWindowProps): react_jsx_runtime.JSX.Element;
98
110
 
99
111
  declare function DocumentUpload({ namespace, onUploadComplete, className }: DocumentUploadProps): react_jsx_runtime.JSX.Element;
100
112
 
101
- declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
113
+ declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, onFeedback, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
102
114
 
103
115
  declare function SourceCard({ source, index }: SourceCardProps): react_jsx_runtime.JSX.Element;
104
116
 
@@ -111,6 +123,22 @@ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelP
111
123
  declare function ConfigProvider({ config, children, }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
112
124
  declare function useConfig(): ClientConfig;
113
125
 
126
+ interface Snippet {
127
+ id: string;
128
+ title: string;
129
+ description: string;
130
+ code: string;
131
+ language: string;
132
+ }
133
+
134
+ declare function CodeViewer({ snippet }: {
135
+ snippet: Snippet;
136
+ }): react_jsx_runtime.JSX.Element;
137
+
138
+ declare function ProductCard({ product, primaryColor, onAddToCart }: ProductCardProps): react_jsx_runtime.JSX.Element;
139
+
140
+ declare function ProductCarousel({ products, primaryColor, onAddToCart }: ProductCarouselProps): react_jsx_runtime.JSX.Element | null;
141
+
114
142
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
115
143
 
116
144
  /**
@@ -119,4 +147,4 @@ declare function useRagChat(projectId: string, options?: UseRagChatOptions): Use
119
147
  */
120
148
  declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
121
149
 
122
- export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, type ProductCardProps, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };
150
+ export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, type ProductCardProps, ProductCarousel, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };