@retrivora-ai/rag-engine 1.9.7 → 1.9.8
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/README.md +127 -135
- package/dist/{ILLMProvider-Bhk6zJOK.d.mts → ILLMProvider-B8ROITYK.d.mts} +57 -2
- package/dist/{ILLMProvider-Bhk6zJOK.d.ts → ILLMProvider-B8ROITYK.d.ts} +57 -2
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +2198 -457
- package/dist/handlers/index.mjs +2195 -457
- package/dist/{index-BJ4cd-t5.d.mts → index-B8PbEFSY.d.mts} +12 -2
- package/dist/{index-Bu7T6xgr.d.ts → index-BCPKUAVL.d.ts} +27 -52
- package/dist/{index-C3SVtPYg.d.mts → index-CrxCy36A.d.mts} +27 -52
- package/dist/{index-B9J_XEh0.d.ts → index-DNvoi-sV.d.ts} +12 -2
- package/dist/index.css +578 -273
- package/dist/index.d.mts +29 -7
- package/dist/index.d.ts +29 -7
- package/dist/index.js +1160 -282
- package/dist/index.mjs +1185 -292
- package/dist/server.d.mts +62 -6
- package/dist/server.d.ts +62 -6
- package/dist/server.js +2061 -306
- package/dist/server.mjs +2055 -306
- package/package.json +11 -7
- package/src/app/constants.tsx +37 -7
- package/src/components/AmbientBackground.tsx +10 -10
- package/src/components/ArchitectureCard.tsx +43 -7
- package/src/components/ArchitectureCardsSection.tsx +37 -4
- package/src/components/ChatWidget.tsx +2 -1
- package/src/components/ChatWindow.tsx +4 -1
- package/src/components/CodeViewer.tsx +19 -14
- package/src/components/DocViewer.tsx +43 -49
- package/src/components/Documentation.tsx +71 -51
- package/src/components/Hero.tsx +103 -20
- package/src/components/Lifecycle.tsx +65 -25
- package/src/components/MarkdownComponents.tsx +44 -1
- package/src/components/MessageBubble.tsx +162 -50
- package/src/components/constants.tsx +4 -0
- package/src/config/RagConfig.ts +46 -0
- package/src/config/constants.ts +4 -0
- package/src/config/serverConfig.ts +15 -0
- package/src/core/ConfigResolver.ts +6 -0
- package/src/core/DatabaseStorage.ts +469 -0
- package/src/core/LicenseVerifier.ts +154 -0
- package/src/core/MultiAgentCoordinator.ts +239 -0
- package/src/core/Pipeline.ts +146 -15
- package/src/core/Retrivora.ts +6 -0
- package/src/core/VectorPlugin.ts +12 -3
- package/src/core/mcp.ts +261 -0
- package/src/handlers/index.ts +449 -63
- package/src/hooks/useRagChat.ts +96 -42
- package/src/hooks/useStoredMessages.ts +15 -4
- package/src/index.ts +5 -0
- package/src/llm/LLMFactory.ts +9 -1
- package/src/llm/providers/GroqProvider.ts +176 -0
- package/src/llm/providers/QwenProvider.ts +191 -0
- package/src/server.ts +7 -0
- package/src/types/chat.ts +14 -0
- package/src/types/props.ts +12 -0
- package/.env.example +0 -80
- package/LICENSE.txt +0 -21
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, u as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-
|
|
1
|
+
import { k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, u as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-B8ROITYK.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* DocumentChunker — splits long text into overlapping chunks
|
|
@@ -68,9 +68,13 @@ declare class Pipeline {
|
|
|
68
68
|
private entityExtractor?;
|
|
69
69
|
private reranker;
|
|
70
70
|
private agent?;
|
|
71
|
+
private mcpRegistry?;
|
|
72
|
+
private multiAgentCoordinator?;
|
|
71
73
|
/** LRU-bounded cache: avoids re-embedding identical queries within the same process. */
|
|
72
74
|
private embeddingCache;
|
|
73
75
|
private initialised;
|
|
76
|
+
/** Namespace-specific static cold context cache for CAG */
|
|
77
|
+
private coldContexts;
|
|
74
78
|
constructor(config: RagConfig);
|
|
75
79
|
/**
|
|
76
80
|
* Expose the underlying LLM provider (set after initialize()).
|
|
@@ -78,6 +82,7 @@ declare class Pipeline {
|
|
|
78
82
|
*/
|
|
79
83
|
getLLMProvider(): ILLMProvider | undefined;
|
|
80
84
|
initialize(): Promise<void>;
|
|
85
|
+
private loadColdContext;
|
|
81
86
|
/**
|
|
82
87
|
* Ingest documents with automatic chunking, embedding, and batch upsert.
|
|
83
88
|
*/
|
|
@@ -96,7 +101,12 @@ declare class Pipeline {
|
|
|
96
101
|
private processUpserts;
|
|
97
102
|
/** Step 4: Optional graph-based entity extraction and ingestion. */
|
|
98
103
|
private processGraphIngestion;
|
|
104
|
+
runNormalQuery(question: string, history?: ChatMessage[], namespace?: string): Promise<{
|
|
105
|
+
reply: string;
|
|
106
|
+
sources: any[];
|
|
107
|
+
}>;
|
|
99
108
|
ask(question: string, history?: ChatMessage[], namespace?: string): Promise<ChatResponse>;
|
|
109
|
+
askStream(question: string, history?: ChatMessage[], namespace?: string): AsyncIterable<string | ChatResponse>;
|
|
100
110
|
/**
|
|
101
111
|
* High-performance streaming RAG flow.
|
|
102
112
|
* Yields text chunks first, then the retrieval metadata + observability trace at the end.
|
|
@@ -107,7 +117,7 @@ declare class Pipeline {
|
|
|
107
117
|
* - UITransformation is computed after text streaming and emitted with metadata
|
|
108
118
|
* - SchemaMapper.train runs while answer generation streams
|
|
109
119
|
*/
|
|
110
|
-
|
|
120
|
+
askStreamInternal(question: string, history?: ChatMessage[], namespace?: string): AsyncIterable<string | ChatResponse>;
|
|
111
121
|
/**
|
|
112
122
|
* Universal retrieval method combining all enabled providers.
|
|
113
123
|
* Uses an LRU-bounded embedding cache to avoid re-embedding the same query.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { NextRequest } from 'next/server';
|
|
2
|
+
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-B8ROITYK.js';
|
|
3
3
|
|
|
4
4
|
interface ValidationError {
|
|
5
5
|
field: string;
|
|
@@ -124,6 +124,9 @@ declare class VectorPlugin {
|
|
|
124
124
|
getSuggestions(query: string, namespace?: string): Promise<string[]>;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
interface HandlerOptions {
|
|
128
|
+
onAuthorize?: (req: NextRequest) => boolean | Promise<boolean> | Response | Promise<Response>;
|
|
129
|
+
}
|
|
127
130
|
/**
|
|
128
131
|
* Encode a payload as a Server-Sent Events frame.
|
|
129
132
|
* data: <json>\n\n
|
|
@@ -153,9 +156,7 @@ declare function sseErrorFrame(message: string): string;
|
|
|
153
156
|
* const plugin = new VectorPlugin(getRagConfig());
|
|
154
157
|
* export const POST = createChatHandler(plugin);
|
|
155
158
|
*/
|
|
156
|
-
declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
157
|
-
error: string;
|
|
158
|
-
}> | NextResponse<ChatResponse>>;
|
|
159
|
+
declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
159
160
|
/**
|
|
160
161
|
* createStreamHandler — factory for a streaming SSE Next.js App Router POST handler.
|
|
161
162
|
*
|
|
@@ -178,68 +179,42 @@ declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorP
|
|
|
178
179
|
* // }
|
|
179
180
|
* // }
|
|
180
181
|
*/
|
|
181
|
-
declare function createStreamHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
182
|
+
declare function createStreamHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
182
183
|
/**
|
|
183
184
|
* createIngestHandler — factory for the document ingestion endpoint.
|
|
184
185
|
*/
|
|
185
|
-
declare function createIngestHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
186
|
-
error: string;
|
|
187
|
-
}> | NextResponse<{
|
|
188
|
-
results: {
|
|
189
|
-
docId: string | number;
|
|
190
|
-
chunksIngested: number;
|
|
191
|
-
}[];
|
|
192
|
-
}>>;
|
|
186
|
+
declare function createIngestHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
193
187
|
/**
|
|
194
188
|
* createHealthHandler — factory for the health-check endpoint.
|
|
195
189
|
*/
|
|
196
|
-
declare function createHealthHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): () => Promise<
|
|
197
|
-
timestamp: string;
|
|
198
|
-
vectorDb: HealthCheckResult;
|
|
199
|
-
llm: HealthCheckResult;
|
|
200
|
-
embedding?: HealthCheckResult;
|
|
201
|
-
allHealthy: boolean;
|
|
202
|
-
status: string;
|
|
203
|
-
}> | NextResponse<{
|
|
204
|
-
status: string;
|
|
205
|
-
error: string;
|
|
206
|
-
}>>;
|
|
190
|
+
declare function createHealthHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req?: NextRequest) => Promise<any>;
|
|
207
191
|
/**
|
|
208
192
|
* createUploadHandler — factory for the file upload ingestion endpoint.
|
|
209
193
|
*/
|
|
210
|
-
declare function createUploadHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
211
|
-
error: string;
|
|
212
|
-
}> | NextResponse<{
|
|
213
|
-
message: string;
|
|
214
|
-
results: {
|
|
215
|
-
docId: string | number;
|
|
216
|
-
chunksIngested: number;
|
|
217
|
-
}[];
|
|
218
|
-
}>>;
|
|
194
|
+
declare function createUploadHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
219
195
|
/**
|
|
220
196
|
* createSuggestionsHandler — factory for the auto-suggestions endpoint.
|
|
221
197
|
*/
|
|
222
|
-
declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
198
|
+
declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
199
|
+
/**
|
|
200
|
+
* createHistoryHandler — factory for GET /api/retrivora/history and POST /api/retrivora/history/clear.
|
|
201
|
+
*/
|
|
202
|
+
declare function createHistoryHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
203
|
+
/**
|
|
204
|
+
* createFeedbackHandler — factory for POST /api/retrivora/feedback.
|
|
205
|
+
*/
|
|
206
|
+
declare function createFeedbackHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
207
|
+
/**
|
|
208
|
+
* createSessionsHandler — factory for GET /api/retrivora/sessions.
|
|
209
|
+
*/
|
|
210
|
+
declare function createSessionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req?: NextRequest) => Promise<any>;
|
|
227
211
|
/**
|
|
228
212
|
* createRagHandler — factory that returns GET and POST handlers for a catch-all route
|
|
229
213
|
* (e.g. `src/app/api/retrivora/[[...retrivora]]/route.ts`).
|
|
230
214
|
*/
|
|
231
|
-
declare function createRagHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): {
|
|
232
|
-
GET: (req: NextRequest, context: any) => Promise<
|
|
233
|
-
|
|
234
|
-
vectorDb: HealthCheckResult;
|
|
235
|
-
llm: HealthCheckResult;
|
|
236
|
-
embedding?: HealthCheckResult;
|
|
237
|
-
allHealthy: boolean;
|
|
238
|
-
status: string;
|
|
239
|
-
}> | NextResponse<{
|
|
240
|
-
error: string;
|
|
241
|
-
}>>;
|
|
242
|
-
POST: (req: NextRequest, context: any) => Promise<Response>;
|
|
215
|
+
declare function createRagHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): {
|
|
216
|
+
GET: (req: NextRequest, context: any) => Promise<any>;
|
|
217
|
+
POST: (req: NextRequest, context: any) => Promise<any>;
|
|
243
218
|
};
|
|
244
219
|
|
|
245
|
-
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,
|
|
220
|
+
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, createFeedbackHandler as d, createHealthHandler as e, createHistoryHandler as f, createIngestHandler as g, createRagHandler as h, createSessionsHandler as i, createStreamHandler as j, createUploadHandler as k, sseFrame as l, sseMetaFrame as m, sseTextFrame as n, type HandlerOptions as o, createSuggestionsHandler as p, sseObservabilityFrame as q, sseUIFrame as r, sseErrorFrame as s };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { NextRequest } from 'next/server';
|
|
2
|
+
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-B8ROITYK.mjs';
|
|
3
3
|
|
|
4
4
|
interface ValidationError {
|
|
5
5
|
field: string;
|
|
@@ -124,6 +124,9 @@ declare class VectorPlugin {
|
|
|
124
124
|
getSuggestions(query: string, namespace?: string): Promise<string[]>;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
interface HandlerOptions {
|
|
128
|
+
onAuthorize?: (req: NextRequest) => boolean | Promise<boolean> | Response | Promise<Response>;
|
|
129
|
+
}
|
|
127
130
|
/**
|
|
128
131
|
* Encode a payload as a Server-Sent Events frame.
|
|
129
132
|
* data: <json>\n\n
|
|
@@ -153,9 +156,7 @@ declare function sseErrorFrame(message: string): string;
|
|
|
153
156
|
* const plugin = new VectorPlugin(getRagConfig());
|
|
154
157
|
* export const POST = createChatHandler(plugin);
|
|
155
158
|
*/
|
|
156
|
-
declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
157
|
-
error: string;
|
|
158
|
-
}> | NextResponse<ChatResponse>>;
|
|
159
|
+
declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
159
160
|
/**
|
|
160
161
|
* createStreamHandler — factory for a streaming SSE Next.js App Router POST handler.
|
|
161
162
|
*
|
|
@@ -178,68 +179,42 @@ declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorP
|
|
|
178
179
|
* // }
|
|
179
180
|
* // }
|
|
180
181
|
*/
|
|
181
|
-
declare function createStreamHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
182
|
+
declare function createStreamHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
182
183
|
/**
|
|
183
184
|
* createIngestHandler — factory for the document ingestion endpoint.
|
|
184
185
|
*/
|
|
185
|
-
declare function createIngestHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
186
|
-
error: string;
|
|
187
|
-
}> | NextResponse<{
|
|
188
|
-
results: {
|
|
189
|
-
docId: string | number;
|
|
190
|
-
chunksIngested: number;
|
|
191
|
-
}[];
|
|
192
|
-
}>>;
|
|
186
|
+
declare function createIngestHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
193
187
|
/**
|
|
194
188
|
* createHealthHandler — factory for the health-check endpoint.
|
|
195
189
|
*/
|
|
196
|
-
declare function createHealthHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): () => Promise<
|
|
197
|
-
timestamp: string;
|
|
198
|
-
vectorDb: HealthCheckResult;
|
|
199
|
-
llm: HealthCheckResult;
|
|
200
|
-
embedding?: HealthCheckResult;
|
|
201
|
-
allHealthy: boolean;
|
|
202
|
-
status: string;
|
|
203
|
-
}> | NextResponse<{
|
|
204
|
-
status: string;
|
|
205
|
-
error: string;
|
|
206
|
-
}>>;
|
|
190
|
+
declare function createHealthHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req?: NextRequest) => Promise<any>;
|
|
207
191
|
/**
|
|
208
192
|
* createUploadHandler — factory for the file upload ingestion endpoint.
|
|
209
193
|
*/
|
|
210
|
-
declare function createUploadHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
211
|
-
error: string;
|
|
212
|
-
}> | NextResponse<{
|
|
213
|
-
message: string;
|
|
214
|
-
results: {
|
|
215
|
-
docId: string | number;
|
|
216
|
-
chunksIngested: number;
|
|
217
|
-
}[];
|
|
218
|
-
}>>;
|
|
194
|
+
declare function createUploadHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
219
195
|
/**
|
|
220
196
|
* createSuggestionsHandler — factory for the auto-suggestions endpoint.
|
|
221
197
|
*/
|
|
222
|
-
declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): (req: NextRequest) => Promise<
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
198
|
+
declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
199
|
+
/**
|
|
200
|
+
* createHistoryHandler — factory for GET /api/retrivora/history and POST /api/retrivora/history/clear.
|
|
201
|
+
*/
|
|
202
|
+
declare function createHistoryHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
203
|
+
/**
|
|
204
|
+
* createFeedbackHandler — factory for POST /api/retrivora/feedback.
|
|
205
|
+
*/
|
|
206
|
+
declare function createFeedbackHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
207
|
+
/**
|
|
208
|
+
* createSessionsHandler — factory for GET /api/retrivora/sessions.
|
|
209
|
+
*/
|
|
210
|
+
declare function createSessionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req?: NextRequest) => Promise<any>;
|
|
227
211
|
/**
|
|
228
212
|
* createRagHandler — factory that returns GET and POST handlers for a catch-all route
|
|
229
213
|
* (e.g. `src/app/api/retrivora/[[...retrivora]]/route.ts`).
|
|
230
214
|
*/
|
|
231
|
-
declare function createRagHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin): {
|
|
232
|
-
GET: (req: NextRequest, context: any) => Promise<
|
|
233
|
-
|
|
234
|
-
vectorDb: HealthCheckResult;
|
|
235
|
-
llm: HealthCheckResult;
|
|
236
|
-
embedding?: HealthCheckResult;
|
|
237
|
-
allHealthy: boolean;
|
|
238
|
-
status: string;
|
|
239
|
-
}> | NextResponse<{
|
|
240
|
-
error: string;
|
|
241
|
-
}>>;
|
|
242
|
-
POST: (req: NextRequest, context: any) => Promise<Response>;
|
|
215
|
+
declare function createRagHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): {
|
|
216
|
+
GET: (req: NextRequest, context: any) => Promise<any>;
|
|
217
|
+
POST: (req: NextRequest, context: any) => Promise<any>;
|
|
243
218
|
};
|
|
244
219
|
|
|
245
|
-
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,
|
|
220
|
+
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, createFeedbackHandler as d, createHealthHandler as e, createHistoryHandler as f, createIngestHandler as g, createRagHandler as h, createSessionsHandler as i, createStreamHandler as j, createUploadHandler as k, sseFrame as l, sseMetaFrame as m, sseTextFrame as n, type HandlerOptions as o, createSuggestionsHandler as p, sseObservabilityFrame as q, sseUIFrame as r, sseErrorFrame as s };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, u as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-
|
|
1
|
+
import { k as RagConfig, I as ILLMProvider, g as IngestDocument, C as ChatMessage, d as ChatResponse, u as RetrievalResult, n as UniversalRagConfig } from './ILLMProvider-B8ROITYK.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* DocumentChunker — splits long text into overlapping chunks
|
|
@@ -68,9 +68,13 @@ declare class Pipeline {
|
|
|
68
68
|
private entityExtractor?;
|
|
69
69
|
private reranker;
|
|
70
70
|
private agent?;
|
|
71
|
+
private mcpRegistry?;
|
|
72
|
+
private multiAgentCoordinator?;
|
|
71
73
|
/** LRU-bounded cache: avoids re-embedding identical queries within the same process. */
|
|
72
74
|
private embeddingCache;
|
|
73
75
|
private initialised;
|
|
76
|
+
/** Namespace-specific static cold context cache for CAG */
|
|
77
|
+
private coldContexts;
|
|
74
78
|
constructor(config: RagConfig);
|
|
75
79
|
/**
|
|
76
80
|
* Expose the underlying LLM provider (set after initialize()).
|
|
@@ -78,6 +82,7 @@ declare class Pipeline {
|
|
|
78
82
|
*/
|
|
79
83
|
getLLMProvider(): ILLMProvider | undefined;
|
|
80
84
|
initialize(): Promise<void>;
|
|
85
|
+
private loadColdContext;
|
|
81
86
|
/**
|
|
82
87
|
* Ingest documents with automatic chunking, embedding, and batch upsert.
|
|
83
88
|
*/
|
|
@@ -96,7 +101,12 @@ declare class Pipeline {
|
|
|
96
101
|
private processUpserts;
|
|
97
102
|
/** Step 4: Optional graph-based entity extraction and ingestion. */
|
|
98
103
|
private processGraphIngestion;
|
|
104
|
+
runNormalQuery(question: string, history?: ChatMessage[], namespace?: string): Promise<{
|
|
105
|
+
reply: string;
|
|
106
|
+
sources: any[];
|
|
107
|
+
}>;
|
|
99
108
|
ask(question: string, history?: ChatMessage[], namespace?: string): Promise<ChatResponse>;
|
|
109
|
+
askStream(question: string, history?: ChatMessage[], namespace?: string): AsyncIterable<string | ChatResponse>;
|
|
100
110
|
/**
|
|
101
111
|
* High-performance streaming RAG flow.
|
|
102
112
|
* Yields text chunks first, then the retrieval metadata + observability trace at the end.
|
|
@@ -107,7 +117,7 @@ declare class Pipeline {
|
|
|
107
117
|
* - UITransformation is computed after text streaming and emitted with metadata
|
|
108
118
|
* - SchemaMapper.train runs while answer generation streams
|
|
109
119
|
*/
|
|
110
|
-
|
|
120
|
+
askStreamInternal(question: string, history?: ChatMessage[], namespace?: string): AsyncIterable<string | ChatResponse>;
|
|
111
121
|
/**
|
|
112
122
|
* Universal retrieval method combining all enabled providers.
|
|
113
123
|
* Uses an LRU-bounded embedding cache to avoid re-embedding the same query.
|