@retrivora-ai/rag-engine 1.8.1 → 1.8.2

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 (55) hide show
  1. package/dist/{ILLMProvider-BfRgI1Xh.d.mts → ILLMProvider-BOJFz3Na.d.mts} +47 -1
  2. package/dist/{ILLMProvider-BfRgI1Xh.d.ts → ILLMProvider-BOJFz3Na.d.ts} +47 -1
  3. package/dist/{MultiTablePostgresProvider-YY7LPNJK.mjs → MultiTablePostgresProvider-ZLGSKTJR.mjs} +1 -1
  4. package/dist/chunk-ICKRMZQK.mjs +76 -0
  5. package/dist/{chunk-BFYLQYQU.mjs → chunk-LZVVLSDN.mjs} +192 -100
  6. package/dist/{chunk-R3RGUMHE.mjs → chunk-OZFBG4BA.mjs} +121 -48
  7. package/dist/handlers/index.d.mts +2 -2
  8. package/dist/handlers/index.d.ts +2 -2
  9. package/dist/handlers/index.js +368 -147
  10. package/dist/handlers/index.mjs +4 -1
  11. package/dist/{index-BV0z5mb6.d.mts → index-BwpcaziY.d.ts} +4 -2
  12. package/dist/{index-1Z4GuYBi.d.ts → index-D3V9Et2M.d.mts} +4 -2
  13. package/dist/index.d.mts +23 -3
  14. package/dist/index.d.ts +23 -3
  15. package/dist/index.js +1143 -790
  16. package/dist/index.mjs +1065 -770
  17. package/dist/server.d.mts +15 -25
  18. package/dist/server.d.ts +15 -25
  19. package/dist/server.js +366 -147
  20. package/dist/server.mjs +3 -2
  21. package/package.json +4 -2
  22. package/src/app/api/upload/route.ts +4 -0
  23. package/src/app/constants.tsx +2 -2
  24. package/src/app/page.tsx +12 -321
  25. package/src/components/AmbientBackground.tsx +29 -0
  26. package/src/components/ArchitectureCard.tsx +17 -0
  27. package/src/components/ArchitectureCardsSection.tsx +15 -0
  28. package/src/components/ChatWindow.tsx +32 -0
  29. package/src/components/CodeViewer.tsx +51 -0
  30. package/src/components/ConfigProvider.tsx +1 -0
  31. package/src/components/DocViewer.tsx +37 -0
  32. package/src/components/DocumentUpload.tsx +44 -1
  33. package/src/components/Documentation.tsx +58 -0
  34. package/src/components/DynamicChart.tsx +27 -2
  35. package/src/components/Hero.tsx +59 -0
  36. package/src/components/HourglassLoader.tsx +87 -0
  37. package/src/components/Lifecycle.tsx +37 -0
  38. package/src/components/MarkdownComponents.tsx +140 -0
  39. package/src/components/MessageBubble.tsx +88 -1010
  40. package/src/components/Navbar.tsx +55 -0
  41. package/src/components/ObservabilityPanel.tsx +374 -0
  42. package/src/components/ProductCard.tsx +3 -1
  43. package/src/components/UIDispatcher.tsx +344 -0
  44. package/src/components/VisualizationRenderer.tsx +48 -26
  45. package/src/core/Pipeline.ts +186 -76
  46. package/src/handlers/index.ts +72 -12
  47. package/src/hooks/useRagChat.ts +19 -9
  48. package/src/index.ts +9 -1
  49. package/src/providers/vectordb/MultiTablePostgresProvider.ts +150 -64
  50. package/src/types/chat.ts +2 -0
  51. package/src/types/index.ts +52 -0
  52. package/src/types/props.ts +9 -1
  53. package/src/utils/ProductExtractor.ts +347 -0
  54. package/src/utils/UITransformer.ts +4 -53
  55. package/src/utils/synonyms.ts +78 -0
@@ -8,9 +8,11 @@ import {
8
8
  sseErrorFrame,
9
9
  sseFrame,
10
10
  sseMetaFrame,
11
+ sseObservabilityFrame,
11
12
  sseTextFrame,
12
13
  sseUIFrame
13
- } from "../chunk-BFYLQYQU.mjs";
14
+ } from "../chunk-LZVVLSDN.mjs";
15
+ import "../chunk-ICKRMZQK.mjs";
14
16
  import "../chunk-YLTMFW4M.mjs";
15
17
  import "../chunk-X4TOT24V.mjs";
16
18
  export {
@@ -23,6 +25,7 @@ export {
23
25
  sseErrorFrame,
24
26
  sseFrame,
25
27
  sseMetaFrame,
28
+ sseObservabilityFrame,
26
29
  sseTextFrame,
27
30
  sseUIFrame
28
31
  };
@@ -1,4 +1,4 @@
1
- import { j as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-BfRgI1Xh.mjs';
1
+ import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-BOJFz3Na.js';
2
2
  import { NextRequest, NextResponse } from 'next/server';
3
3
 
4
4
  interface ValidationError {
@@ -135,6 +135,8 @@ declare function sseTextFrame(text: string): string;
135
135
  declare function sseMetaFrame(meta: unknown): string;
136
136
  /** Encode the UI transformation result as an SSE frame. */
137
137
  declare function sseUIFrame(uiTransformation: unknown): string;
138
+ /** Encode the observability trace as an SSE frame. */
139
+ declare function sseObservabilityFrame(trace: unknown): string;
138
140
  /** Encode a stream error as an SSE frame. */
139
141
  declare function sseErrorFrame(message: string): string;
140
142
  /**
@@ -223,4 +225,4 @@ declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> |
223
225
  suggestions: string[];
224
226
  }>>;
225
227
 
226
- export { ConfigValidator as C, type HealthCheckResult as H, type IProviderValidator as I, type ValidationError as V, type IProviderHealthChecker as a, VectorPlugin as b, createChatHandler as c, createHealthHandler as d, createIngestHandler as e, createStreamHandler as f, createUploadHandler as g, sseFrame as h, sseMetaFrame as i, sseTextFrame as j, createSuggestionsHandler as k, sseUIFrame as l, sseErrorFrame as s };
228
+ export { ConfigValidator as C, type HealthCheckResult as H, type IProviderValidator as I, type ValidationError as V, type IProviderHealthChecker as a, VectorPlugin as b, createChatHandler as c, createHealthHandler as d, createIngestHandler as e, createStreamHandler as f, createUploadHandler as g, sseFrame as h, sseMetaFrame as i, sseTextFrame as j, createSuggestionsHandler as k, sseObservabilityFrame as l, sseUIFrame as m, sseErrorFrame as s };
@@ -1,4 +1,4 @@
1
- import { j as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-BfRgI1Xh.js';
1
+ import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-BOJFz3Na.mjs';
2
2
  import { NextRequest, NextResponse } from 'next/server';
3
3
 
4
4
  interface ValidationError {
@@ -135,6 +135,8 @@ declare function sseTextFrame(text: string): string;
135
135
  declare function sseMetaFrame(meta: unknown): string;
136
136
  /** Encode the UI transformation result as an SSE frame. */
137
137
  declare function sseUIFrame(uiTransformation: unknown): string;
138
+ /** Encode the observability trace as an SSE frame. */
139
+ declare function sseObservabilityFrame(trace: unknown): string;
138
140
  /** Encode a stream error as an SSE frame. */
139
141
  declare function sseErrorFrame(message: string): string;
140
142
  /**
@@ -223,4 +225,4 @@ declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> |
223
225
  suggestions: string[];
224
226
  }>>;
225
227
 
226
- export { ConfigValidator as C, type HealthCheckResult as H, type IProviderValidator as I, type ValidationError as V, type IProviderHealthChecker as a, VectorPlugin as b, createChatHandler as c, createHealthHandler as d, createIngestHandler as e, createStreamHandler as f, createUploadHandler as g, sseFrame as h, sseMetaFrame as i, sseTextFrame as j, createSuggestionsHandler as k, sseUIFrame as l, sseErrorFrame as s };
228
+ export { ConfigValidator as C, type HealthCheckResult as H, type IProviderValidator as I, type ValidationError as V, type IProviderHealthChecker as a, VectorPlugin as b, createChatHandler as c, createHealthHandler as d, createIngestHandler as e, createStreamHandler as f, createUploadHandler as g, sseFrame as h, sseMetaFrame as i, sseTextFrame as j, createSuggestionsHandler as k, sseObservabilityFrame as l, sseUIFrame as m, sseErrorFrame as s };
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { CSSProperties, MouseEvent, ReactNode } from 'react';
2
- import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-BfRgI1Xh.mjs';
3
- 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 RAGConfig, j as RagConfig, k as UpsertDocument, l as VectorDBConfig, m as VectorDBProvider } from './ILLMProvider-BfRgI1Xh.mjs';
2
+ import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-BOJFz3Na.mjs';
3
+ 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 RetrievedChunk, T as TokenUsage, m as UpsertDocument, n as VectorDBConfig, o as VectorDBProvider } from './ILLMProvider-BOJFz3Na.mjs';
4
4
  export { C as Chunk, a as ChunkOptions } from './DocumentChunker-Dh9TvmGG.mjs';
5
5
 
6
6
  type ChatViewportSize = 'compact' | 'medium' | 'large';
@@ -66,11 +66,19 @@ interface SourceCardProps {
66
66
  interface ClientConfig {
67
67
  projectId: string;
68
68
  ui: Required<UIConfig>;
69
+ embedding?: {
70
+ model?: string;
71
+ dimensions?: number;
72
+ };
69
73
  }
70
74
  interface ConfigProviderProps {
71
75
  config?: {
72
76
  projectId?: string;
73
77
  ui?: Partial<UIConfig>;
78
+ embedding?: {
79
+ model?: string;
80
+ dimensions?: number;
81
+ };
74
82
  };
75
83
  children: ReactNode;
76
84
  }
@@ -85,6 +93,12 @@ declare function MessageBubble({ message, sources, isStreaming, primaryColor, ac
85
93
 
86
94
  declare function SourceCard({ source, index }: SourceCardProps): React.JSX.Element;
87
95
 
96
+ interface ObservabilityPanelProps {
97
+ trace: ObservabilityTrace;
98
+ primaryColor?: string;
99
+ }
100
+ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelProps): React.JSX.Element;
101
+
88
102
  /**
89
103
  * ConfigProvider — React Context that makes RagConfig (UI subset) available
90
104
  * to all child components without prop drilling.
@@ -97,4 +111,10 @@ declare function useConfig(): ClientConfig;
97
111
 
98
112
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
99
113
 
100
- export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, type ProductCardProps, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, useConfig, useRagChat };
114
+ /**
115
+ * Dynamically registers new synonyms into the global FIELD_SYNONYMS dictionary.
116
+ * You can call this during your app initialization to support custom schema fields.
117
+ */
118
+ declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
119
+
120
+ 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 };
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import React, { CSSProperties, MouseEvent, ReactNode } from 'react';
2
- import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-BfRgI1Xh.js';
3
- 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 RAGConfig, j as RagConfig, k as UpsertDocument, l as VectorDBConfig, m as VectorDBProvider } from './ILLMProvider-BfRgI1Xh.js';
2
+ import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-BOJFz3Na.js';
3
+ 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 RetrievedChunk, T as TokenUsage, m as UpsertDocument, n as VectorDBConfig, o as VectorDBProvider } from './ILLMProvider-BOJFz3Na.js';
4
4
  export { C as Chunk, a as ChunkOptions } from './DocumentChunker-Dh9TvmGG.js';
5
5
 
6
6
  type ChatViewportSize = 'compact' | 'medium' | 'large';
@@ -66,11 +66,19 @@ interface SourceCardProps {
66
66
  interface ClientConfig {
67
67
  projectId: string;
68
68
  ui: Required<UIConfig>;
69
+ embedding?: {
70
+ model?: string;
71
+ dimensions?: number;
72
+ };
69
73
  }
70
74
  interface ConfigProviderProps {
71
75
  config?: {
72
76
  projectId?: string;
73
77
  ui?: Partial<UIConfig>;
78
+ embedding?: {
79
+ model?: string;
80
+ dimensions?: number;
81
+ };
74
82
  };
75
83
  children: ReactNode;
76
84
  }
@@ -85,6 +93,12 @@ declare function MessageBubble({ message, sources, isStreaming, primaryColor, ac
85
93
 
86
94
  declare function SourceCard({ source, index }: SourceCardProps): React.JSX.Element;
87
95
 
96
+ interface ObservabilityPanelProps {
97
+ trace: ObservabilityTrace;
98
+ primaryColor?: string;
99
+ }
100
+ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelProps): React.JSX.Element;
101
+
88
102
  /**
89
103
  * ConfigProvider — React Context that makes RagConfig (UI subset) available
90
104
  * to all child components without prop drilling.
@@ -97,4 +111,10 @@ declare function useConfig(): ClientConfig;
97
111
 
98
112
  declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
99
113
 
100
- export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, type ProductCardProps, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, useConfig, useRagChat };
114
+ /**
115
+ * Dynamically registers new synonyms into the global FIELD_SYNONYMS dictionary.
116
+ * You can call this during your app initialization to support custom schema fields.
117
+ */
118
+ declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
119
+
120
+ 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 };