@retrivora-ai/rag-engine 0.1.4 → 0.1.6

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 (50) hide show
  1. package/dist/DocumentChunker-BEyzadsv.d.mts +93 -0
  2. package/dist/DocumentChunker-BEyzadsv.d.ts +93 -0
  3. package/dist/{LLMFactory-XC55FTD2.mjs → LLMFactory-JFOY2V4X.mjs} +2 -1
  4. package/dist/{PineconeProvider-NJ675H7U.mjs → PineconeProvider-ZRAFNFEC.mjs} +1 -1
  5. package/dist/{PostgreSQLProvider-ISNMD3BE.mjs → PostgreSQLProvider-ZNXA67IM.mjs} +1 -1
  6. package/dist/{QdrantProvider-LJWOIGES.mjs → QdrantProvider-NYGHAA7C.mjs} +1 -1
  7. package/dist/{Pipeline-Bo6CUCox.d.mts → RagConfig-hBGXJmSx.d.mts} +23 -93
  8. package/dist/{Pipeline-Bo6CUCox.d.ts → RagConfig-hBGXJmSx.d.ts} +23 -93
  9. package/dist/{chunk-6FODXNUF.mjs → chunk-5K23H7JL.mjs} +27 -1
  10. package/dist/chunk-HSBXE2WV.mjs +1758 -0
  11. package/dist/{chunk-S5DRHETN.mjs → chunk-IUTAZ7QR.mjs} +31 -2
  12. package/dist/{chunk-GD3QJFNN.mjs → chunk-JI6VD5TJ.mjs} +4 -41
  13. package/dist/chunk-UKDXCXW7.mjs +49 -0
  14. package/dist/{chunk-AALIF3AL.mjs → chunk-ZM6TYIDH.mjs} +3 -3
  15. package/dist/handlers/index.d.mts +3 -44
  16. package/dist/handlers/index.d.ts +3 -44
  17. package/dist/handlers/index.js +1322 -57
  18. package/dist/handlers/index.mjs +3 -3
  19. package/dist/index-Bx182KKn.d.ts +64 -0
  20. package/dist/index-Ck2pt7-8.d.mts +64 -0
  21. package/dist/index.d.mts +4 -3
  22. package/dist/index.d.ts +4 -3
  23. package/dist/index.js +19 -1646
  24. package/dist/index.mjs +1 -11
  25. package/dist/server.d.mts +188 -11
  26. package/dist/server.d.ts +188 -11
  27. package/dist/server.js +1322 -57
  28. package/dist/server.mjs +10 -11
  29. package/package.json +20 -2
  30. package/src/config/serverConfig.ts +3 -0
  31. package/src/core/BatchProcessor.ts +347 -0
  32. package/src/core/ConfigValidator.ts +560 -0
  33. package/src/core/Pipeline.ts +91 -49
  34. package/src/core/ProviderHealthCheck.ts +565 -0
  35. package/src/core/VectorPlugin.ts +51 -9
  36. package/src/handlers/index.ts +2 -2
  37. package/src/index.ts +1 -7
  38. package/src/providers/vectordb/BaseVectorProvider.ts +1 -1
  39. package/src/providers/vectordb/MilvusProvider.ts +1 -1
  40. package/src/providers/vectordb/MongoDBProvider.ts +1 -1
  41. package/src/providers/vectordb/PineconeProvider.ts +4 -4
  42. package/src/providers/vectordb/PostgreSQLProvider.ts +35 -3
  43. package/src/providers/vectordb/QdrantProvider.ts +32 -2
  44. package/src/rag/DocumentChunker.ts +2 -2
  45. package/src/server.ts +1 -1
  46. package/src/types/index.ts +13 -2
  47. package/dist/DocumentChunker-BQ5kQD7B.d.ts +0 -155
  48. package/dist/DocumentChunker-D9-fObJp.d.mts +0 -155
  49. package/dist/chunk-AIAB2IEE.mjs +0 -394
  50. package/dist/chunk-FGGSVVSY.mjs +0 -162
@@ -3,9 +3,9 @@ import {
3
3
  createHealthHandler,
4
4
  createIngestHandler,
5
5
  createUploadHandler
6
- } from "../chunk-FGGSVVSY.mjs";
7
- import "../chunk-AIAB2IEE.mjs";
8
- import "../chunk-GD3QJFNN.mjs";
6
+ } from "../chunk-HSBXE2WV.mjs";
7
+ import "../chunk-JI6VD5TJ.mjs";
8
+ import "../chunk-UKDXCXW7.mjs";
9
9
  import "../chunk-I4E63NIC.mjs";
10
10
  export {
11
11
  createChatHandler,
@@ -0,0 +1,64 @@
1
+ import { a as RagConfig, C as ChatResponse } from './RagConfig-hBGXJmSx.js';
2
+ import { NextRequest, NextResponse } from 'next/server';
3
+
4
+ /**
5
+ * ProviderHealthCheck.ts — Pre-flight validation for vector DB and LLM providers.
6
+ *
7
+ * Performs connectivity tests, credential validation, and capability checks
8
+ * before initializing providers.
9
+ */
10
+
11
+ interface HealthCheckResult {
12
+ healthy: boolean;
13
+ provider: string;
14
+ version?: string;
15
+ capabilities?: Record<string, unknown>;
16
+ error?: string;
17
+ timestamp: number;
18
+ }
19
+
20
+ /**
21
+ * createChatHandler — factory that returns a Next.js App Router POST handler
22
+ */
23
+ declare function createChatHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
24
+ error: string;
25
+ }> | NextResponse<ChatResponse>>;
26
+ /**
27
+ * createIngestHandler — factory for the document ingestion endpoint.
28
+ */
29
+ declare function createIngestHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
30
+ error: string;
31
+ }> | NextResponse<{
32
+ results: {
33
+ docId: string | number;
34
+ chunksIngested: number;
35
+ }[];
36
+ }>>;
37
+ /**
38
+ * createHealthHandler — factory for the health-check endpoint.
39
+ */
40
+ declare function createHealthHandler(config?: Partial<RagConfig>): () => Promise<NextResponse<{
41
+ timestamp: string;
42
+ vectorDb: HealthCheckResult;
43
+ llm: HealthCheckResult;
44
+ embedding?: HealthCheckResult;
45
+ allHealthy: boolean;
46
+ status: string;
47
+ }> | NextResponse<{
48
+ status: string;
49
+ error: string;
50
+ }>>;
51
+ /**
52
+ * createUploadHandler — factory for the file upload ingestion endpoint.
53
+ */
54
+ declare function createUploadHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
55
+ error: string;
56
+ }> | NextResponse<{
57
+ message: string;
58
+ results: {
59
+ docId: string | number;
60
+ chunksIngested: number;
61
+ }[];
62
+ }>>;
63
+
64
+ export { type HealthCheckResult as H, createHealthHandler as a, createIngestHandler as b, createChatHandler as c, createUploadHandler as d };
@@ -0,0 +1,64 @@
1
+ import { a as RagConfig, C as ChatResponse } from './RagConfig-hBGXJmSx.mjs';
2
+ import { NextRequest, NextResponse } from 'next/server';
3
+
4
+ /**
5
+ * ProviderHealthCheck.ts — Pre-flight validation for vector DB and LLM providers.
6
+ *
7
+ * Performs connectivity tests, credential validation, and capability checks
8
+ * before initializing providers.
9
+ */
10
+
11
+ interface HealthCheckResult {
12
+ healthy: boolean;
13
+ provider: string;
14
+ version?: string;
15
+ capabilities?: Record<string, unknown>;
16
+ error?: string;
17
+ timestamp: number;
18
+ }
19
+
20
+ /**
21
+ * createChatHandler — factory that returns a Next.js App Router POST handler
22
+ */
23
+ declare function createChatHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
24
+ error: string;
25
+ }> | NextResponse<ChatResponse>>;
26
+ /**
27
+ * createIngestHandler — factory for the document ingestion endpoint.
28
+ */
29
+ declare function createIngestHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
30
+ error: string;
31
+ }> | NextResponse<{
32
+ results: {
33
+ docId: string | number;
34
+ chunksIngested: number;
35
+ }[];
36
+ }>>;
37
+ /**
38
+ * createHealthHandler — factory for the health-check endpoint.
39
+ */
40
+ declare function createHealthHandler(config?: Partial<RagConfig>): () => Promise<NextResponse<{
41
+ timestamp: string;
42
+ vectorDb: HealthCheckResult;
43
+ llm: HealthCheckResult;
44
+ embedding?: HealthCheckResult;
45
+ allHealthy: boolean;
46
+ status: string;
47
+ }> | NextResponse<{
48
+ status: string;
49
+ error: string;
50
+ }>>;
51
+ /**
52
+ * createUploadHandler — factory for the file upload ingestion endpoint.
53
+ */
54
+ declare function createUploadHandler(config?: Partial<RagConfig>): (req: NextRequest) => Promise<NextResponse<{
55
+ error: string;
56
+ }> | NextResponse<{
57
+ message: string;
58
+ results: {
59
+ docId: string | number;
60
+ chunksIngested: number;
61
+ }[];
62
+ }>>;
63
+
64
+ export { type HealthCheckResult as H, createHealthHandler as a, createIngestHandler as b, createChatHandler as c, createUploadHandler as d };
package/dist/index.d.mts CHANGED
@@ -1,8 +1,9 @@
1
- export { C as Chunk, a as ChunkOptions, b as ConfigResolver, P as ProviderRegistry, V as VectorPlugin } from './DocumentChunker-D9-fObJp.mjs';
2
- import { C as ChatMessage, V as VectorMatch, U as UIConfig } from './Pipeline-Bo6CUCox.mjs';
3
- export { a as ChatOptions, b as ChatResponse, E as EmbedOptions, c as EmbeddingConfig, I as ILLMProvider, d as IngestDocument, L as LLMConfig, P as Pipeline, R as RAGConfig, e as RagConfig, f as UpsertDocument, g as VectorDBConfig } from './Pipeline-Bo6CUCox.mjs';
4
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
2
  import React$1, { ReactNode } from 'react';
3
+ import { C as ChatMessage } from './DocumentChunker-BEyzadsv.mjs';
4
+ export { a as ChatOptions, b as Chunk, c as ChunkOptions, E as EmbedOptions, I as ILLMProvider } from './DocumentChunker-BEyzadsv.mjs';
5
+ import { V as VectorMatch, U as UIConfig } from './RagConfig-hBGXJmSx.mjs';
6
+ export { C as ChatResponse, E as EmbeddingConfig, I as IngestDocument, L as LLMConfig, R as RAGConfig, a as RagConfig, b as UpsertDocument, c as VectorDBConfig } from './RagConfig-hBGXJmSx.mjs';
6
7
 
7
8
  interface ChatWidgetProps {
8
9
  /** Position of the floating button. Defaults to bottom-right. */
package/dist/index.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- export { C as Chunk, a as ChunkOptions, b as ConfigResolver, P as ProviderRegistry, V as VectorPlugin } from './DocumentChunker-BQ5kQD7B.js';
2
- import { C as ChatMessage, V as VectorMatch, U as UIConfig } from './Pipeline-Bo6CUCox.js';
3
- export { a as ChatOptions, b as ChatResponse, E as EmbedOptions, c as EmbeddingConfig, I as ILLMProvider, d as IngestDocument, L as LLMConfig, P as Pipeline, R as RAGConfig, e as RagConfig, f as UpsertDocument, g as VectorDBConfig } from './Pipeline-Bo6CUCox.js';
4
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
2
  import React$1, { ReactNode } from 'react';
3
+ import { C as ChatMessage } from './DocumentChunker-BEyzadsv.js';
4
+ export { a as ChatOptions, b as Chunk, c as ChunkOptions, E as EmbedOptions, I as ILLMProvider } from './DocumentChunker-BEyzadsv.js';
5
+ import { V as VectorMatch, U as UIConfig } from './RagConfig-hBGXJmSx.js';
6
+ export { C as ChatResponse, E as EmbeddingConfig, I as IngestDocument, L as LLMConfig, R as RAGConfig, a as RagConfig, b as UpsertDocument, c as VectorDBConfig } from './RagConfig-hBGXJmSx.js';
6
7
 
7
8
  interface ChatWidgetProps {
8
9
  /** Position of the floating button. Defaults to bottom-right. */