@retrivora-ai/rag-engine 2.0.2 → 2.0.4
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.
- package/FREE_TIER_ARCHITECTURE.md +232 -0
- package/README.md +9 -0
- package/dist/{ILLMProvider-DMxLyTdq.d.mts → ILLMProvider-0rRBYbVW.d.mts} +133 -1
- package/dist/{ILLMProvider-DMxLyTdq.d.ts → ILLMProvider-0rRBYbVW.d.ts} +133 -1
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +681 -17
- package/dist/handlers/index.mjs +681 -17
- package/dist/index-B1wGUlSL.d.mts +532 -0
- package/dist/{index-tzwc7UhY.d.ts → index-BIHHp_f6.d.ts} +1 -1
- package/dist/{index-DHsFLJXQ.d.mts → index-BvODr57d.d.mts} +1 -1
- package/dist/index-DcklhThn.d.ts +532 -0
- package/dist/index.css +51 -3
- package/dist/index.d.mts +6 -105
- package/dist/index.d.ts +6 -105
- package/dist/index.js +1918 -8
- package/dist/index.mjs +1913 -8
- package/dist/server.d.mts +51 -7
- package/dist/server.d.ts +51 -7
- package/dist/server.js +723 -17
- package/dist/server.mjs +706 -17
- package/package.json +9 -7
- package/src/app/page.tsx +54 -18
- package/src/components/ChatWindow.tsx +2 -2
- package/src/components/DocumentUpload.tsx +5 -4
- package/src/components/MessageBubble.tsx +2 -4
- package/src/core/DatabaseStorage.ts +5 -1
- package/src/core/LicenseVerifier.ts +1 -1
- package/src/core/Pipeline.ts +23 -5
- package/src/handlers/index.ts +48 -1
- package/src/index.ts +22 -4
- package/src/rendering/IntentClassifier.ts +167 -0
- package/src/rendering/RendererRegistry.ts +164 -0
- package/src/rendering/RuleEngine.ts +67 -0
- package/src/rendering/VisualizationDecisionEngine.ts +164 -0
- package/src/rendering/__tests__/VisualizationDecisionEngine.test.ts +237 -0
- package/src/rendering/index.ts +12 -0
- package/src/rendering/rules/Rule1SpecificInfoRule.ts +28 -0
- package/src/rendering/rules/Rule2ComparisonRule.ts +24 -0
- package/src/rendering/rules/Rule3ProductDiscoveryRule.ts +28 -0
- package/src/rendering/rules/Rule4AnalyticalRule.ts +38 -0
- package/src/rendering/rules/Rule5MixedResponseRule.ts +29 -0
- package/src/rendering/rules/Rule6SmallResultSetRule.ts +24 -0
- package/src/rendering/rules/Rule7LargeTableRule.ts +35 -0
- package/src/rendering/types.ts +96 -0
- package/src/server.ts +3 -2
- package/src/types/index.ts +48 -0
- package/src/utils/DocumentParser.ts +64 -28
- package/src/utils/UITransformer.ts +15 -4
- package/dist/index-CfkqZd2Y.d.ts +0 -197
- package/dist/index-xygonxpW.d.mts +0 -197
package/dist/server.d.mts
CHANGED
|
@@ -1,10 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { V as VectorDBConfig, L as LLMConfig, d as EmbeddingConfig, i as RagConfig, n as UniversalRagConfig, o as UpsertDocument, q as VectorMatch, G as GraphDBConfig, r as GraphNode, s as Edge, t as GraphSearchResult, I as ILLMProvider, p as VectorDBProvider, g as LLMProvider, e as EmbeddingProvider, R as RAGConfig, m as UIConfig, C as ChatMessage, b as ChatOptions, E as EmbedOptions } from './ILLMProvider-0rRBYbVW.mjs';
|
|
2
|
+
export { B as BarChartData, u as CarouselProduct, c as ChatResponse, v as IRetriever, f as IngestDocument, h as LatencyBreakdown, w as LineChartDataPoint, M as MessageRole, x as MetricCardData, O as ObservabilityTrace, P as PieChartData, y as Product, j as RagMessage, k as RetrievalConfig, z as RetrievalResult, l as RetrievedChunk, A as RetrivoraChunkMetadata, D as RetrivoraIngestedDocument, S as ScatterPlotDataPoint, F as SuggestionsResponse, H as TableData, T as TokenUsage, J as UITransformationResponse, U as UseRagChatOptions, a as UseRagChatReturn, K as VisualizationType, W as WorkflowConfig } from './ILLMProvider-0rRBYbVW.mjs';
|
|
3
|
+
import { I as IRenderRule, i as DecisionContext, k as IntentCategory, n as RenderDecision } from './index-B1wGUlSL.mjs';
|
|
4
|
+
export { w as ArchitectureCardProps, A as AuthenticationException, x as CarouselRendererStrategy, y as ChartRendererStrategy, e as ChartType, z as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, f as Chunk, g as ChunkOptions, c as ClientConfig, b as ConfigProviderProps, h as ConfigurationException, B as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, j as IRendererStrategy, l as IntentClassifier, M as MessageBubbleProps, F as MixedRendererStrategy, G as Pipeline, H as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, m as ProviderNotFoundException, J as ProviderPill, R as RateLimitException, K as RenderSectionDecision, o as RenderType, p as RendererRegistry, q as RetrievalException, r as Retrivora, s as RetrivoraError, t as RetrivoraErrorCode, u as RuleEngine, L as Snippet, S as SourceCardProps, T as TableRendererStrategy, N as TextRendererStrategy, V as VisualizationDecisionEngine, v as decideVisualization, O as wrapError } from './index-B1wGUlSL.mjs';
|
|
5
|
+
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-BvODr57d.mjs';
|
|
6
|
+
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-BvODr57d.mjs';
|
|
7
|
+
import 'react';
|
|
6
8
|
import 'next/server';
|
|
7
9
|
|
|
10
|
+
declare class Rule1SpecificInfoRule implements IRenderRule {
|
|
11
|
+
readonly name = "Rule1SpecificInfo";
|
|
12
|
+
readonly priority = 100;
|
|
13
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare class Rule2ComparisonRule implements IRenderRule {
|
|
17
|
+
readonly name = "Rule2Comparison";
|
|
18
|
+
readonly priority = 90;
|
|
19
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare class Rule3ProductDiscoveryRule implements IRenderRule {
|
|
23
|
+
readonly name = "Rule3ProductDiscovery";
|
|
24
|
+
readonly priority = 85;
|
|
25
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class Rule4AnalyticalRule implements IRenderRule {
|
|
29
|
+
readonly name = "Rule4Analytical";
|
|
30
|
+
readonly priority = 80;
|
|
31
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare class Rule5MixedResponseRule implements IRenderRule {
|
|
35
|
+
readonly name = "Rule5MixedResponse";
|
|
36
|
+
readonly priority = 95;
|
|
37
|
+
evaluate(context: DecisionContext, _intent: IntentCategory): RenderDecision | null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare class Rule6SmallResultSetRule implements IRenderRule {
|
|
41
|
+
readonly name = "Rule6SmallResultSet";
|
|
42
|
+
readonly priority = 110;
|
|
43
|
+
evaluate(context: DecisionContext, _intent: IntentCategory): RenderDecision | null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class Rule7LargeTableRule implements IRenderRule {
|
|
47
|
+
readonly name = "Rule7LargeTable";
|
|
48
|
+
readonly priority = 75;
|
|
49
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
8
52
|
interface LicensePayload {
|
|
9
53
|
projectId: string;
|
|
10
54
|
expiresAt: number;
|
|
@@ -556,7 +600,7 @@ declare const VECTOR_PROFILES: {
|
|
|
556
600
|
|
|
557
601
|
/**
|
|
558
602
|
* DocumentParser — handles text extraction from various file formats.
|
|
559
|
-
* Supported: .txt, .md, .json, .csv, .pdf
|
|
603
|
+
* Supported: .txt, .md, .json, .csv, .pdf, .docx, .doc, .xlsx, .xls
|
|
560
604
|
*/
|
|
561
605
|
declare class DocumentParser {
|
|
562
606
|
/**
|
|
@@ -983,4 +1027,4 @@ declare class UniversalLLMAdapter implements ILLMProvider {
|
|
|
983
1027
|
ping(): Promise<boolean>;
|
|
984
1028
|
}
|
|
985
1029
|
|
|
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 };
|
|
1030
|
+
export { AnthropicProvider, BaseVectorProvider, type BatchOptions, BatchProcessor, type BatchResult, ChatMessage, ChatOptions, ChromaDBProvider, ConfigBuilder, ConfigResolver, DecisionContext, DocumentParser, Edge, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, GraphNode, GraphSearchResult, GroqProvider, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, IRenderRule, IntentCategory, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, type LicensePayload, LicenseVerifier, MilvusProvider, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, PRESETS, PineconeProvider, PostgreSQLProvider, ProviderHealthCheck, ProviderRegistry, QdrantProvider, QwenProvider, RAGConfig, RagConfig, RedisProvider, RenderDecision, Rule1SpecificInfoRule, Rule2ComparisonRule, Rule3ProductDiscoveryRule, Rule4AnalyticalRule, Rule5MixedResponseRule, Rule6SmallResultSetRule, Rule7LargeTableRule, UIConfig, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, WeaviateProvider, createFromPreset, getRagConfig };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,10 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { V as VectorDBConfig, L as LLMConfig, d as EmbeddingConfig, i as RagConfig, n as UniversalRagConfig, o as UpsertDocument, q as VectorMatch, G as GraphDBConfig, r as GraphNode, s as Edge, t as GraphSearchResult, I as ILLMProvider, p as VectorDBProvider, g as LLMProvider, e as EmbeddingProvider, R as RAGConfig, m as UIConfig, C as ChatMessage, b as ChatOptions, E as EmbedOptions } from './ILLMProvider-0rRBYbVW.js';
|
|
2
|
+
export { B as BarChartData, u as CarouselProduct, c as ChatResponse, v as IRetriever, f as IngestDocument, h as LatencyBreakdown, w as LineChartDataPoint, M as MessageRole, x as MetricCardData, O as ObservabilityTrace, P as PieChartData, y as Product, j as RagMessage, k as RetrievalConfig, z as RetrievalResult, l as RetrievedChunk, A as RetrivoraChunkMetadata, D as RetrivoraIngestedDocument, S as ScatterPlotDataPoint, F as SuggestionsResponse, H as TableData, T as TokenUsage, J as UITransformationResponse, U as UseRagChatOptions, a as UseRagChatReturn, K as VisualizationType, W as WorkflowConfig } from './ILLMProvider-0rRBYbVW.js';
|
|
3
|
+
import { I as IRenderRule, i as DecisionContext, k as IntentCategory, n as RenderDecision } from './index-DcklhThn.js';
|
|
4
|
+
export { w as ArchitectureCardProps, A as AuthenticationException, x as CarouselRendererStrategy, y as ChartRendererStrategy, e as ChartType, z as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, f as Chunk, g as ChunkOptions, c as ClientConfig, b as ConfigProviderProps, h as ConfigurationException, B as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, j as IRendererStrategy, l as IntentClassifier, M as MessageBubbleProps, F as MixedRendererStrategy, G as Pipeline, H as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, m as ProviderNotFoundException, J as ProviderPill, R as RateLimitException, K as RenderSectionDecision, o as RenderType, p as RendererRegistry, q as RetrievalException, r as Retrivora, s as RetrivoraError, t as RetrivoraErrorCode, u as RuleEngine, L as Snippet, S as SourceCardProps, T as TableRendererStrategy, N as TextRendererStrategy, V as VisualizationDecisionEngine, v as decideVisualization, O as wrapError } from './index-DcklhThn.js';
|
|
5
|
+
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-BIHHp_f6.js';
|
|
6
|
+
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-BIHHp_f6.js';
|
|
7
|
+
import 'react';
|
|
6
8
|
import 'next/server';
|
|
7
9
|
|
|
10
|
+
declare class Rule1SpecificInfoRule implements IRenderRule {
|
|
11
|
+
readonly name = "Rule1SpecificInfo";
|
|
12
|
+
readonly priority = 100;
|
|
13
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
declare class Rule2ComparisonRule implements IRenderRule {
|
|
17
|
+
readonly name = "Rule2Comparison";
|
|
18
|
+
readonly priority = 90;
|
|
19
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
declare class Rule3ProductDiscoveryRule implements IRenderRule {
|
|
23
|
+
readonly name = "Rule3ProductDiscovery";
|
|
24
|
+
readonly priority = 85;
|
|
25
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
declare class Rule4AnalyticalRule implements IRenderRule {
|
|
29
|
+
readonly name = "Rule4Analytical";
|
|
30
|
+
readonly priority = 80;
|
|
31
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare class Rule5MixedResponseRule implements IRenderRule {
|
|
35
|
+
readonly name = "Rule5MixedResponse";
|
|
36
|
+
readonly priority = 95;
|
|
37
|
+
evaluate(context: DecisionContext, _intent: IntentCategory): RenderDecision | null;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare class Rule6SmallResultSetRule implements IRenderRule {
|
|
41
|
+
readonly name = "Rule6SmallResultSet";
|
|
42
|
+
readonly priority = 110;
|
|
43
|
+
evaluate(context: DecisionContext, _intent: IntentCategory): RenderDecision | null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class Rule7LargeTableRule implements IRenderRule {
|
|
47
|
+
readonly name = "Rule7LargeTable";
|
|
48
|
+
readonly priority = 75;
|
|
49
|
+
evaluate(context: DecisionContext, intent: IntentCategory): RenderDecision | null;
|
|
50
|
+
}
|
|
51
|
+
|
|
8
52
|
interface LicensePayload {
|
|
9
53
|
projectId: string;
|
|
10
54
|
expiresAt: number;
|
|
@@ -556,7 +600,7 @@ declare const VECTOR_PROFILES: {
|
|
|
556
600
|
|
|
557
601
|
/**
|
|
558
602
|
* DocumentParser — handles text extraction from various file formats.
|
|
559
|
-
* Supported: .txt, .md, .json, .csv, .pdf
|
|
603
|
+
* Supported: .txt, .md, .json, .csv, .pdf, .docx, .doc, .xlsx, .xls
|
|
560
604
|
*/
|
|
561
605
|
declare class DocumentParser {
|
|
562
606
|
/**
|
|
@@ -983,4 +1027,4 @@ declare class UniversalLLMAdapter implements ILLMProvider {
|
|
|
983
1027
|
ping(): Promise<boolean>;
|
|
984
1028
|
}
|
|
985
1029
|
|
|
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 };
|
|
1030
|
+
export { AnthropicProvider, BaseVectorProvider, type BatchOptions, BatchProcessor, type BatchResult, ChatMessage, ChatOptions, ChromaDBProvider, ConfigBuilder, ConfigResolver, DecisionContext, DocumentParser, Edge, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, GraphNode, GraphSearchResult, GroqProvider, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, IRenderRule, IntentCategory, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, type LicensePayload, LicenseVerifier, MilvusProvider, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, PRESETS, PineconeProvider, PostgreSQLProvider, ProviderHealthCheck, ProviderRegistry, QdrantProvider, QwenProvider, RAGConfig, RagConfig, RedisProvider, RenderDecision, Rule1SpecificInfoRule, Rule2ComparisonRule, Rule3ProductDiscoveryRule, Rule4AnalyticalRule, Rule5MixedResponseRule, Rule6SmallResultSetRule, Rule7LargeTableRule, UIConfig, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, WeaviateProvider, createFromPreset, getRagConfig };
|