@absolutejs/rag 0.0.19 → 0.0.21
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/dist/adapter-kit/index.js +31179 -0
- package/dist/adapter-kit/index.js.map +27 -0
- package/dist/index.js +139 -2170
- package/dist/index.js.map +5 -8
- package/dist/src/adapter-kit/index.d.ts +8 -0
- package/dist/src/adapters/sync.d.ts +21 -0
- package/dist/src/index.d.ts +2 -4
- package/dist/src/sync/sync.d.ts +1 -1
- package/dist/src/vue/useRAG.d.ts +58 -18
- package/dist/src/vue/useRAGIndexAdmin.d.ts +56 -16
- package/dist/src/vue/useRAGOps.d.ts +2 -2
- package/dist/types/adapters.d.ts +13 -30
- package/dist/types/index.d.ts +0 -1
- package/package.json +13 -3
- package/dist/src/adapters/postgres.d.ts +0 -3
- package/dist/src/adapters/sqlite.d.ts +0 -3
- package/dist/src/internal/resolveAbsoluteSQLiteVec.d.ts +0 -3
- package/dist/types/sync.d.ts +0 -23
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createRAGVector, normalizeVector, querySimilarity } from "../adapters/utils";
|
|
2
|
+
export { matchesMetadataFilterRecord } from "../adapters/filtering";
|
|
3
|
+
export { planNativeCandidateSearchBackfillK, planNativeCandidateSearchK, resolveAdaptiveNativeCandidateLimit, summarizeSQLiteCandidateCoverage, } from "../adapters/queryPlanning";
|
|
4
|
+
export { rankRAGLexicalMatches } from "../retrieval/lexical";
|
|
5
|
+
export { createRAGCollection } from "../retrieval/collection";
|
|
6
|
+
export { ragChat, ragChat as ragPlugin } from "../chat/chat";
|
|
7
|
+
export { RAG_NATIVE_QUERY_CANDIDATE_LIMIT, RAG_VECTOR_DIMENSIONS_DEFAULT, } from "../constants";
|
|
8
|
+
export type { RAGBackendCapabilities, RAGCollection, RAGEmbeddingInput, RAGLexicalQueryInput, RAGPostgresNativeDiagnostics, RAGQueryInput, RAGQueryResult, RAGSQLiteNativeDiagnostics, RAGUpsertInput, RAGVectorCountInput, RAGVectorDeleteInput, RAGVectorStore, RAGVectorStoreStatus, SQLiteVecResolution, } from "@absolutejs/ai";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SyncEngine } from "@absolutejs/sync/engine";
|
|
2
|
+
import type { RAGVectorStore } from "@absolutejs/ai";
|
|
3
|
+
import type { SyncRAGStoreOptions } from "../../types/adapters";
|
|
4
|
+
/**
|
|
5
|
+
* A {@link RAGVectorStore} backed by the @absolutejs/sync engine: a drop-in for
|
|
6
|
+
* `createInMemoryRAGStore`, but retrieval is also **live**. Ingested chunks flow
|
|
7
|
+
* through the engine's change feed, so a registered search collection re-ranks as
|
|
8
|
+
* the corpus changes — subscribe to `store.retrievalCollection` over
|
|
9
|
+
* `store.engine`'s `syncSocket` and a query's results update with no refetch.
|
|
10
|
+
*
|
|
11
|
+
* Built on sync's `createVectorIndex` (one-shot semantic `query`) + a shared
|
|
12
|
+
* `createTextIndex` (one-shot `queryLexical` AND the live lexical collection). The
|
|
13
|
+
* vector stays in a server-side map keyed by chunk id, so emitted rows are light.
|
|
14
|
+
*/
|
|
15
|
+
export type SyncRAGStore = RAGVectorStore & {
|
|
16
|
+
/** The engine to mount with `syncSocket` for live retrieval. */
|
|
17
|
+
engine: SyncEngine;
|
|
18
|
+
/** Collection name to subscribe to (params = the query string) for live retrieval. */
|
|
19
|
+
retrievalCollection: string;
|
|
20
|
+
};
|
|
21
|
+
export declare const createSyncRAGStore: (options?: SyncRAGStoreOptions) => SyncRAGStore;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -20,13 +20,11 @@ export { createRAGBunS3SyncClient, createRAGDirectorySyncSource, createRAGEmailS
|
|
|
20
20
|
export { createRAGFileJobStateStore } from "./internal/jobState";
|
|
21
21
|
export { createRAGCollection, ingestDocuments, ingestRAGDocuments, searchDocuments, } from "./retrieval/collection";
|
|
22
22
|
export { createInMemoryRAGStore } from "./adapters/inMemory";
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export { resolveAbsoluteSQLiteVec, resolveAbsoluteSQLiteVecExtensionPath, } from "./internal/resolveAbsoluteSQLiteVec";
|
|
23
|
+
export { createSyncRAGStore } from "./adapters/sync";
|
|
24
|
+
export type { SyncRAGStore } from "./adapters/sync";
|
|
26
25
|
export { createRAGVector, normalizeVector, querySimilarity, } from "./adapters/utils";
|
|
27
26
|
export type { SQLiteRAGSearchTraceStoreOptions } from "./quality/quality";
|
|
28
27
|
export type { AnthropicOCRConfig, CrossEncoderRerankerConfig, GeminiEmbeddingsConfig, GeminiOCRConfig, GmailEmailSyncConfig, GraphEmailSyncConfig, IMAPEmailSyncConfig, OllamaEmbeddingsConfig, OllamaOCRConfig, OllamaTranscriptionConfig, OpenAICompatibleEmbeddingsConfig, OpenAICompatibleOCRConfig, OpenAICompatibleTranscriptionConfig, OpenAIEmbeddingsConfig, OpenAIOCRConfig, OpenAITranscriptionConfig, } from "../types/providers";
|
|
29
|
-
export type { NativeSQLiteRAGStoreOptions, SQLiteRAGStoreOptions, } from "../types/adapters";
|
|
30
28
|
export type { AIHTMXRenderConfig, RAGAnswerWorkflowState, RAGBackendCapabilities, RAGCitation, RAGCitationReferenceMap, RAGGroundedAnswer, RAGGroundedAnswerPart, RAGGroundingReference, RAGChunkingOptions, RAGChunkingStrategy, RAGDocumentChunk, RAGDocumentChunkPreview, RAGArchiveEntry, RAGArchiveExpander, RAGArchiveExpansionResult, RAGExtractedFileDocument, RAGFileExtractionInput, RAGFileExtractor, RAGPDFOCRExtractorOptions, RAGDocumentFileInput, RAGDirectoryIngestInput, RAGDocumentIngestInput, RAGDocumentUploadIngestInput, RAGDocumentUploadInput, RAGDocumentUrlIngestInput, RAGDocumentUrlInput, RAGEmailSyncAttachment, RAGEmailSyncClient, RAGEmailSyncListInput, RAGEmailSyncListResult, RAGEmailSyncMessage, RAGEmailSyncSourceOptions, RAGLinkedConnectorSyncSourceOptions, RAGConnectorCheckpoint, RAGConnectorItem, RAGConnectorRuntime, RAGConnectorSyncInput, RAGConnectorSyncResult, RAGFeedSyncInput, RAGFeedSyncSourceOptions, RAGGitHubRepoSyncInput, RAGGitHubSyncSourceOptions, RAGSitemapSyncInput, RAGSitemapSyncSourceOptions, RAGSiteDiscoveryInput, RAGSiteDiscoverySyncSourceOptions, RAGStorageSyncClient, RAGStorageSyncFile, RAGStorageSyncListInput, RAGStorageSyncListResult, RAGStorageSyncObject, RAGStorageSyncSourceOptions, RAGEmbeddingFunction, RAGEmbeddingInput, RAGEmbeddingProvider, RAGEmbeddingProviderLike, RAGBackendDescriptor, RAGCollection, RAGCollectionSearchParams, RAGContentFormat, RAGAnswerGroundingEvaluationCase, RAGAnswerGroundingEvaluationCaseResult, RAGAnswerGroundingEvaluationInput, RAGAnswerGroundingEvaluationResponse, RAGAnswerGroundingEvaluationSummary, RAGEvaluationCase, RAGEvaluationCaseResult, RAGEvaluationLeaderboardEntry, RAGEvaluationInput, RAGEvaluationResponse, RAGEvaluationSummary, RAGEvaluationSuite, RAGEvaluationSuiteRun, RAGRetrievalCandidate, RAGRetrievalComparison, RAGRetrievalComparisonEntry, RAGRetrievalComparisonSummary, RAGHTMXConfig, RAGHTMXWorkflowRenderConfig, RAGIngestDocument, RAGIngestResponse, RAGIndexedDocument, RAGHybridFusionMode, RAGHybridRetrievalMode, RAGHybridSearchOptions, RAGMediaTranscriber, RAGMediaTranscriptSegment, RAGMediaTranscriptionResult, RAGMutationResponse, RAGLexicalQueryInput, RAGOCRProvider, RAGOCRResult, RAGQueryInput, RAGQueryResult, RAGQueryTransformInput, RAGQueryTransformProvider, RAGQueryTransformProviderLike, RAGQueryTransformResult, RAGQueryTransformer, RAGPreparedDocument, RAGReranker, RAGRerankerCandidate, RAGRerankerComparison, RAGRerankerComparisonEntry, RAGRerankerComparisonSummary, RAGRerankerInput, RAGRerankerProvider, RAGRerankerProviderLike, RAGSearchRequest, RAGSyncManager, RAGSyncSchedule, RAGSyncScheduler, RAGSyncResponse, RAGSyncRunOptions, RAGSyncStateStore, RAGSyncSourceContext, RAGSyncSourceDefinition, RAGSyncSourceRecord, RAGSyncSourceRunResult, RAGDirectorySyncSourceOptions, RAGUrlSyncSourceOptions, RAGSource, RAGSourceGroup, RAGSourceSummary, RAGSQLiteNativeDiagnostics, RAGStatusResponse, RAGUpsertInput, RAGVectorStore, RAGVectorStoreStatus, SQLiteVecResolution, } from "../types";
|
|
31
29
|
export type { RAGJobState, RAGJobStateStore, RAGPostgresNativeDiagnostics, RAGRetrievalComparisonCandidateInput, RAGRetrievalComparisonHistoryResponse, RAGRetrievalComparisonHistoryStore, RAGRetrievalComparisonRequest, RAGRetrievalComparisonResponse, RAGRetrievalComparisonRun, RAGSearchTraceGroupHistoryResponse, RAGSearchTraceHistoryResponse, RAGSearchTracePrunePreviewResponse, RAGSearchTracePruneHistoryResponse, RAGSearchTracePruneResponse, RAGSearchTracePruneInput, RAGSearchTracePrunePreview, RAGSearchTracePruneResult, RAGSearchTracePruneHistoryStore, RAGSearchTracePruneRun, RAGSearchTraceRetentionRuntime, RAGSearchTraceRetentionSchedule, RAGSearchTraceStats, RAGSearchTraceStatsResponse, } from "@absolutejs/ai";
|
|
32
30
|
export type * from "@absolutejs/ai";
|
package/dist/src/sync/sync.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S3Client } from "bun";
|
|
2
2
|
import type { CreateRAGSyncManagerOptions, RAGSyncSourceDiagnostics, RAGSyncExtractionRecoveryHandlers, RAGSyncExtractionRecoveryPreview, RAGSyncExtractionRecoveryResult, RAGSyncConflictResolutionPreview, RAGSyncConflictResolutionResult, RAGSyncConflictResolutionStrategy, RAGDirectorySyncSourceOptions, RAGStorageSyncClient, RAGStorageSyncSourceOptions, RAGEmailSyncClient, RAGEmailSyncMessage, RAGEmailSyncSourceOptions, RAGGmailLinkedEmailSyncSourceOptions, RAGFeedSyncSourceOptions, RAGGitHubSyncSourceOptions, RAGSitemapSyncSourceOptions, RAGSiteDiscoverySyncSourceOptions, RAGSyncSchedule, RAGSyncScheduler, RAGSyncStateStore, RAGSyncManager, RAGSyncSourceDefinition, RAGSyncSourceReconciliationSummary, RAGUrlSyncSourceOptions } from "@absolutejs/ai";
|
|
3
|
-
import type { RAGLinkedConnectorSyncSourceOptions } from "
|
|
3
|
+
import type { RAGLinkedConnectorSyncSourceOptions } from "@absolutejs/ai";
|
|
4
4
|
export declare const previewRAGSyncExtractionRecovery: (input: {
|
|
5
5
|
diagnostics?: RAGSyncSourceDiagnostics;
|
|
6
6
|
}) => RAGSyncExtractionRecoveryPreview;
|
package/dist/src/vue/useRAG.d.ts
CHANGED
|
@@ -1275,8 +1275,13 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
1275
1275
|
reason?: string | undefined;
|
|
1276
1276
|
lastSeedMs?: number | undefined;
|
|
1277
1277
|
status?: {
|
|
1278
|
-
backend: "in_memory"
|
|
1279
|
-
vectorMode: "in_memory"
|
|
1278
|
+
backend: "in_memory";
|
|
1279
|
+
vectorMode: "in_memory";
|
|
1280
|
+
dimensions?: number | undefined;
|
|
1281
|
+
native?: undefined | undefined;
|
|
1282
|
+
} | {
|
|
1283
|
+
backend: "sqlite";
|
|
1284
|
+
vectorMode: "json_fallback" | "native_vec0";
|
|
1280
1285
|
dimensions?: number | undefined;
|
|
1281
1286
|
native?: {
|
|
1282
1287
|
requested: boolean;
|
|
@@ -1337,7 +1342,12 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
1337
1342
|
candidateCoverage?: "empty" | "under_target" | "target_sized" | "broad" | undefined;
|
|
1338
1343
|
queryMode: "json_fallback" | "native_vec0";
|
|
1339
1344
|
} | undefined;
|
|
1340
|
-
} |
|
|
1345
|
+
} | undefined;
|
|
1346
|
+
} | {
|
|
1347
|
+
backend: "postgres";
|
|
1348
|
+
vectorMode: "native_pgvector";
|
|
1349
|
+
dimensions?: number | undefined;
|
|
1350
|
+
native?: {
|
|
1341
1351
|
requested: boolean;
|
|
1342
1352
|
available: boolean;
|
|
1343
1353
|
active: boolean;
|
|
@@ -1425,8 +1435,13 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
1425
1435
|
reason?: string | undefined;
|
|
1426
1436
|
lastSeedMs?: number | undefined;
|
|
1427
1437
|
status?: {
|
|
1428
|
-
backend: "in_memory"
|
|
1429
|
-
vectorMode: "in_memory"
|
|
1438
|
+
backend: "in_memory";
|
|
1439
|
+
vectorMode: "in_memory";
|
|
1440
|
+
dimensions?: number | undefined;
|
|
1441
|
+
native?: undefined | undefined;
|
|
1442
|
+
} | {
|
|
1443
|
+
backend: "sqlite";
|
|
1444
|
+
vectorMode: "json_fallback" | "native_vec0";
|
|
1430
1445
|
dimensions?: number | undefined;
|
|
1431
1446
|
native?: {
|
|
1432
1447
|
requested: boolean;
|
|
@@ -1487,7 +1502,12 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
1487
1502
|
candidateCoverage?: "empty" | "under_target" | "target_sized" | "broad" | undefined;
|
|
1488
1503
|
queryMode: "json_fallback" | "native_vec0";
|
|
1489
1504
|
} | undefined;
|
|
1490
|
-
} |
|
|
1505
|
+
} | undefined;
|
|
1506
|
+
} | {
|
|
1507
|
+
backend: "postgres";
|
|
1508
|
+
vectorMode: "native_pgvector";
|
|
1509
|
+
dimensions?: number | undefined;
|
|
1510
|
+
native?: {
|
|
1491
1511
|
requested: boolean;
|
|
1492
1512
|
available: boolean;
|
|
1493
1513
|
active: boolean;
|
|
@@ -1615,8 +1635,13 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
1615
1635
|
}[];
|
|
1616
1636
|
} | undefined;
|
|
1617
1637
|
workflowStatus?: {
|
|
1618
|
-
backend: "in_memory"
|
|
1619
|
-
vectorMode: "in_memory"
|
|
1638
|
+
backend: "in_memory";
|
|
1639
|
+
vectorMode: "in_memory";
|
|
1640
|
+
dimensions?: number | undefined;
|
|
1641
|
+
native?: undefined | undefined;
|
|
1642
|
+
} | {
|
|
1643
|
+
backend: "sqlite";
|
|
1644
|
+
vectorMode: "json_fallback" | "native_vec0";
|
|
1620
1645
|
dimensions?: number | undefined;
|
|
1621
1646
|
native?: {
|
|
1622
1647
|
requested: boolean;
|
|
@@ -1677,7 +1702,12 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
1677
1702
|
candidateCoverage?: "empty" | "under_target" | "target_sized" | "broad" | undefined;
|
|
1678
1703
|
queryMode: "json_fallback" | "native_vec0";
|
|
1679
1704
|
} | undefined;
|
|
1680
|
-
} |
|
|
1705
|
+
} | undefined;
|
|
1706
|
+
} | {
|
|
1707
|
+
backend: "postgres";
|
|
1708
|
+
vectorMode: "native_pgvector";
|
|
1709
|
+
dimensions?: number | undefined;
|
|
1710
|
+
native?: {
|
|
1681
1711
|
requested: boolean;
|
|
1682
1712
|
available: boolean;
|
|
1683
1713
|
active: boolean;
|
|
@@ -1837,8 +1867,13 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
1837
1867
|
}[];
|
|
1838
1868
|
} | undefined;
|
|
1839
1869
|
workflowStatus?: {
|
|
1840
|
-
backend: "in_memory"
|
|
1841
|
-
vectorMode: "in_memory"
|
|
1870
|
+
backend: "in_memory";
|
|
1871
|
+
vectorMode: "in_memory";
|
|
1872
|
+
dimensions?: number | undefined;
|
|
1873
|
+
native?: undefined | undefined;
|
|
1874
|
+
} | {
|
|
1875
|
+
backend: "sqlite";
|
|
1876
|
+
vectorMode: "json_fallback" | "native_vec0";
|
|
1842
1877
|
dimensions?: number | undefined;
|
|
1843
1878
|
native?: {
|
|
1844
1879
|
requested: boolean;
|
|
@@ -1899,7 +1934,12 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
1899
1934
|
candidateCoverage?: "empty" | "under_target" | "target_sized" | "broad" | undefined;
|
|
1900
1935
|
queryMode: "json_fallback" | "native_vec0";
|
|
1901
1936
|
} | undefined;
|
|
1902
|
-
} |
|
|
1937
|
+
} | undefined;
|
|
1938
|
+
} | {
|
|
1939
|
+
backend: "postgres";
|
|
1940
|
+
vectorMode: "native_pgvector";
|
|
1941
|
+
dimensions?: number | undefined;
|
|
1942
|
+
native?: {
|
|
1903
1943
|
requested: boolean;
|
|
1904
1944
|
available: boolean;
|
|
1905
1945
|
active: boolean;
|
|
@@ -2065,7 +2105,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
2065
2105
|
source: {
|
|
2066
2106
|
id: string;
|
|
2067
2107
|
label: string;
|
|
2068
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
2108
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
2069
2109
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
2070
2110
|
description?: string | undefined;
|
|
2071
2111
|
target?: string | undefined;
|
|
@@ -2138,7 +2178,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
2138
2178
|
sources: {
|
|
2139
2179
|
id: string;
|
|
2140
2180
|
label: string;
|
|
2141
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
2181
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
2142
2182
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
2143
2183
|
description?: string | undefined;
|
|
2144
2184
|
target?: string | undefined;
|
|
@@ -2216,7 +2256,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
2216
2256
|
source: {
|
|
2217
2257
|
id: string;
|
|
2218
2258
|
label: string;
|
|
2219
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
2259
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
2220
2260
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
2221
2261
|
description?: string | undefined;
|
|
2222
2262
|
target?: string | undefined;
|
|
@@ -2289,7 +2329,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
2289
2329
|
sources: {
|
|
2290
2330
|
id: string;
|
|
2291
2331
|
label: string;
|
|
2292
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
2332
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
2293
2333
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
2294
2334
|
description?: string | undefined;
|
|
2295
2335
|
target?: string | undefined;
|
|
@@ -2471,7 +2511,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
2471
2511
|
syncSources: import("vue").Ref<{
|
|
2472
2512
|
id: string;
|
|
2473
2513
|
label: string;
|
|
2474
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
2514
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
2475
2515
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
2476
2516
|
description?: string | undefined;
|
|
2477
2517
|
target?: string | undefined;
|
|
@@ -2540,7 +2580,7 @@ export declare const useRAG: (path: string, options?: UseRAGOptions) => {
|
|
|
2540
2580
|
}[], import("@absolutejs/ai").RAGSyncSourceRecord[] | {
|
|
2541
2581
|
id: string;
|
|
2542
2582
|
label: string;
|
|
2543
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
2583
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
2544
2584
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
2545
2585
|
description?: string | undefined;
|
|
2546
2586
|
target?: string | undefined;
|
|
@@ -12,8 +12,13 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
12
12
|
reason?: string | undefined;
|
|
13
13
|
lastSeedMs?: number | undefined;
|
|
14
14
|
status?: {
|
|
15
|
-
backend: "in_memory"
|
|
16
|
-
vectorMode: "in_memory"
|
|
15
|
+
backend: "in_memory";
|
|
16
|
+
vectorMode: "in_memory";
|
|
17
|
+
dimensions?: number | undefined;
|
|
18
|
+
native?: undefined | undefined;
|
|
19
|
+
} | {
|
|
20
|
+
backend: "sqlite";
|
|
21
|
+
vectorMode: "json_fallback" | "native_vec0";
|
|
17
22
|
dimensions?: number | undefined;
|
|
18
23
|
native?: {
|
|
19
24
|
requested: boolean;
|
|
@@ -74,7 +79,12 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
74
79
|
candidateCoverage?: "empty" | "under_target" | "target_sized" | "broad" | undefined;
|
|
75
80
|
queryMode: "json_fallback" | "native_vec0";
|
|
76
81
|
} | undefined;
|
|
77
|
-
} |
|
|
82
|
+
} | undefined;
|
|
83
|
+
} | {
|
|
84
|
+
backend: "postgres";
|
|
85
|
+
vectorMode: "native_pgvector";
|
|
86
|
+
dimensions?: number | undefined;
|
|
87
|
+
native?: {
|
|
78
88
|
requested: boolean;
|
|
79
89
|
available: boolean;
|
|
80
90
|
active: boolean;
|
|
@@ -162,8 +172,13 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
162
172
|
reason?: string | undefined;
|
|
163
173
|
lastSeedMs?: number | undefined;
|
|
164
174
|
status?: {
|
|
165
|
-
backend: "in_memory"
|
|
166
|
-
vectorMode: "in_memory"
|
|
175
|
+
backend: "in_memory";
|
|
176
|
+
vectorMode: "in_memory";
|
|
177
|
+
dimensions?: number | undefined;
|
|
178
|
+
native?: undefined | undefined;
|
|
179
|
+
} | {
|
|
180
|
+
backend: "sqlite";
|
|
181
|
+
vectorMode: "json_fallback" | "native_vec0";
|
|
167
182
|
dimensions?: number | undefined;
|
|
168
183
|
native?: {
|
|
169
184
|
requested: boolean;
|
|
@@ -224,7 +239,12 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
224
239
|
candidateCoverage?: "empty" | "under_target" | "target_sized" | "broad" | undefined;
|
|
225
240
|
queryMode: "json_fallback" | "native_vec0";
|
|
226
241
|
} | undefined;
|
|
227
|
-
} |
|
|
242
|
+
} | undefined;
|
|
243
|
+
} | {
|
|
244
|
+
backend: "postgres";
|
|
245
|
+
vectorMode: "native_pgvector";
|
|
246
|
+
dimensions?: number | undefined;
|
|
247
|
+
native?: {
|
|
228
248
|
requested: boolean;
|
|
229
249
|
available: boolean;
|
|
230
250
|
active: boolean;
|
|
@@ -352,8 +372,13 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
352
372
|
}[];
|
|
353
373
|
} | undefined;
|
|
354
374
|
workflowStatus?: {
|
|
355
|
-
backend: "in_memory"
|
|
356
|
-
vectorMode: "in_memory"
|
|
375
|
+
backend: "in_memory";
|
|
376
|
+
vectorMode: "in_memory";
|
|
377
|
+
dimensions?: number | undefined;
|
|
378
|
+
native?: undefined | undefined;
|
|
379
|
+
} | {
|
|
380
|
+
backend: "sqlite";
|
|
381
|
+
vectorMode: "json_fallback" | "native_vec0";
|
|
357
382
|
dimensions?: number | undefined;
|
|
358
383
|
native?: {
|
|
359
384
|
requested: boolean;
|
|
@@ -414,7 +439,12 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
414
439
|
candidateCoverage?: "empty" | "under_target" | "target_sized" | "broad" | undefined;
|
|
415
440
|
queryMode: "json_fallback" | "native_vec0";
|
|
416
441
|
} | undefined;
|
|
417
|
-
} |
|
|
442
|
+
} | undefined;
|
|
443
|
+
} | {
|
|
444
|
+
backend: "postgres";
|
|
445
|
+
vectorMode: "native_pgvector";
|
|
446
|
+
dimensions?: number | undefined;
|
|
447
|
+
native?: {
|
|
418
448
|
requested: boolean;
|
|
419
449
|
available: boolean;
|
|
420
450
|
active: boolean;
|
|
@@ -574,8 +604,13 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
574
604
|
}[];
|
|
575
605
|
} | undefined;
|
|
576
606
|
workflowStatus?: {
|
|
577
|
-
backend: "in_memory"
|
|
578
|
-
vectorMode: "in_memory"
|
|
607
|
+
backend: "in_memory";
|
|
608
|
+
vectorMode: "in_memory";
|
|
609
|
+
dimensions?: number | undefined;
|
|
610
|
+
native?: undefined | undefined;
|
|
611
|
+
} | {
|
|
612
|
+
backend: "sqlite";
|
|
613
|
+
vectorMode: "json_fallback" | "native_vec0";
|
|
579
614
|
dimensions?: number | undefined;
|
|
580
615
|
native?: {
|
|
581
616
|
requested: boolean;
|
|
@@ -636,7 +671,12 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
636
671
|
candidateCoverage?: "empty" | "under_target" | "target_sized" | "broad" | undefined;
|
|
637
672
|
queryMode: "json_fallback" | "native_vec0";
|
|
638
673
|
} | undefined;
|
|
639
|
-
} |
|
|
674
|
+
} | undefined;
|
|
675
|
+
} | {
|
|
676
|
+
backend: "postgres";
|
|
677
|
+
vectorMode: "native_pgvector";
|
|
678
|
+
dimensions?: number | undefined;
|
|
679
|
+
native?: {
|
|
640
680
|
requested: boolean;
|
|
641
681
|
available: boolean;
|
|
642
682
|
active: boolean;
|
|
@@ -802,7 +842,7 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
802
842
|
source: {
|
|
803
843
|
id: string;
|
|
804
844
|
label: string;
|
|
805
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
845
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
806
846
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
807
847
|
description?: string | undefined;
|
|
808
848
|
target?: string | undefined;
|
|
@@ -875,7 +915,7 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
875
915
|
sources: {
|
|
876
916
|
id: string;
|
|
877
917
|
label: string;
|
|
878
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
918
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
879
919
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
880
920
|
description?: string | undefined;
|
|
881
921
|
target?: string | undefined;
|
|
@@ -953,7 +993,7 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
953
993
|
source: {
|
|
954
994
|
id: string;
|
|
955
995
|
label: string;
|
|
956
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
996
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
957
997
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
958
998
|
description?: string | undefined;
|
|
959
999
|
target?: string | undefined;
|
|
@@ -1026,7 +1066,7 @@ export declare const useRAGIndexAdmin: (path: string) => {
|
|
|
1026
1066
|
sources: {
|
|
1027
1067
|
id: string;
|
|
1028
1068
|
label: string;
|
|
1029
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
1069
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
1030
1070
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
1031
1071
|
description?: string | undefined;
|
|
1032
1072
|
target?: string | undefined;
|
|
@@ -80,7 +80,7 @@ export declare const useRAGOps: (path: string, autoLoad?: boolean) => {
|
|
|
80
80
|
syncSources: import("vue").Ref<{
|
|
81
81
|
id: string;
|
|
82
82
|
label: string;
|
|
83
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
83
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
84
84
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
85
85
|
description?: string | undefined;
|
|
86
86
|
target?: string | undefined;
|
|
@@ -149,7 +149,7 @@ export declare const useRAGOps: (path: string, autoLoad?: boolean) => {
|
|
|
149
149
|
}[], RAGSyncSourceRecord[] | {
|
|
150
150
|
id: string;
|
|
151
151
|
label: string;
|
|
152
|
-
kind: "directory" | "url" | "storage" | "email" | "custom";
|
|
152
|
+
kind: "directory" | "url" | "storage" | "email" | "connector" | "custom";
|
|
153
153
|
status: import("@absolutejs/ai").RAGSyncSourceStatus;
|
|
154
154
|
description?: string | undefined;
|
|
155
155
|
target?: string | undefined;
|
package/dist/types/adapters.d.ts
CHANGED
|
@@ -1,37 +1,20 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RAGEmbeddingFunction } from "@absolutejs/ai";
|
|
2
|
+
import type { SyncEngine } from "@absolutejs/sync/engine";
|
|
2
3
|
export type InMemoryRAGStoreOptions = {
|
|
3
4
|
dimensions?: number;
|
|
4
5
|
mockEmbedding?: (text: string) => Promise<number[]>;
|
|
5
6
|
};
|
|
6
|
-
export type
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export type SyncRAGStoreOptions = {
|
|
8
|
+
/** Live retrieval collection name (subscribe with the query string). Default `ragRetrieval`. */
|
|
9
|
+
collection?: string;
|
|
10
|
+
/** Embedding dimensions for the deterministic fallback. */
|
|
9
11
|
dimensions?: number;
|
|
12
|
+
/** Real embedding provider (e.g. from @absolutejs/rag); falls back to a deterministic vector. */
|
|
13
|
+
embedding?: RAGEmbeddingFunction;
|
|
14
|
+
/** Engine to register on (one is created if omitted). */
|
|
15
|
+
engine?: SyncEngine;
|
|
16
|
+
/** Test/demo embedding by text. */
|
|
10
17
|
mockEmbedding?: (text: string) => Promise<number[]>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
distanceMetric?: "cosine" | "l2" | "inner_product";
|
|
14
|
-
queryMultiplier?: number;
|
|
15
|
-
indexType?: "none" | "hnsw" | "ivfflat";
|
|
16
|
-
indexLists?: number;
|
|
17
|
-
hnswM?: number;
|
|
18
|
-
hnswEfConstruction?: number;
|
|
19
|
-
};
|
|
20
|
-
export type NativeSQLiteRAGStoreOptions = {
|
|
21
|
-
mode: "vec0";
|
|
22
|
-
extensionPath?: string;
|
|
23
|
-
extensionInitSql?: string | string[];
|
|
24
|
-
distanceMetric?: "cosine" | "l2";
|
|
25
|
-
tableName?: string;
|
|
26
|
-
queryMultiplier?: number;
|
|
27
|
-
requireAvailable?: boolean;
|
|
28
|
-
resolveFromAbsolutePackages?: boolean;
|
|
29
|
-
};
|
|
30
|
-
export type SQLiteRAGStoreOptions = {
|
|
31
|
-
db?: Database;
|
|
32
|
-
path?: string;
|
|
33
|
-
dimensions?: number;
|
|
34
|
-
mockEmbedding?: (text: string) => Promise<number[]>;
|
|
35
|
-
tableName?: string;
|
|
36
|
-
native?: NativeSQLiteRAGStoreOptions;
|
|
18
|
+
/** Change-feed table name the live collection reads. Default `ragChunks`. */
|
|
19
|
+
table?: string;
|
|
37
20
|
};
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/rag",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "Standalone RAG ingestion, sync, retrieval, evaluation, clients, and framework adapters extracted from AbsoluteJS",
|
|
5
5
|
"license": "BSL-1.1",
|
|
6
6
|
"type": "module",
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"import": "./dist/index.js",
|
|
16
16
|
"types": "./dist/src/index.d.ts"
|
|
17
17
|
},
|
|
18
|
+
"./adapter-kit": {
|
|
19
|
+
"import": "./dist/adapter-kit/index.js",
|
|
20
|
+
"types": "./dist/src/adapter-kit/index.d.ts"
|
|
21
|
+
},
|
|
18
22
|
"./client": {
|
|
19
23
|
"import": "./dist/client/index.js",
|
|
20
24
|
"types": "./dist/src/client/index.d.ts"
|
|
@@ -49,8 +53,9 @@
|
|
|
49
53
|
}
|
|
50
54
|
},
|
|
51
55
|
"dependencies": {
|
|
52
|
-
"@absolutejs/ai": "0.0.
|
|
53
|
-
"@absolutejs/linked-providers": "0.0.2"
|
|
56
|
+
"@absolutejs/ai": "^0.0.9",
|
|
57
|
+
"@absolutejs/linked-providers": "0.0.2",
|
|
58
|
+
"@absolutejs/sync": "^0.6.0"
|
|
54
59
|
},
|
|
55
60
|
"peerDependencies": {
|
|
56
61
|
"@angular/core": "^21.0.0",
|
|
@@ -74,6 +79,7 @@
|
|
|
74
79
|
}
|
|
75
80
|
},
|
|
76
81
|
"devDependencies": {
|
|
82
|
+
"@absolutejs/absolute": "^0.19.0-beta.1051",
|
|
77
83
|
"@angular/core": "^21.0.0",
|
|
78
84
|
"@types/bun": "1.3.9",
|
|
79
85
|
"@types/react": "19.2.0",
|
|
@@ -93,6 +99,7 @@
|
|
|
93
99
|
},
|
|
94
100
|
"scripts": {
|
|
95
101
|
"build": "bun run scripts/build.ts",
|
|
102
|
+
"config": "absolute config",
|
|
96
103
|
"typecheck": "tsc --noEmit --project tsconfig.json",
|
|
97
104
|
"lint": "eslint . --max-warnings 0",
|
|
98
105
|
"format": "prettier --write .",
|
|
@@ -104,6 +111,9 @@
|
|
|
104
111
|
},
|
|
105
112
|
"typesVersions": {
|
|
106
113
|
"*": {
|
|
114
|
+
"adapter-kit": [
|
|
115
|
+
"dist/src/adapter-kit/index.d.ts"
|
|
116
|
+
],
|
|
107
117
|
"client": [
|
|
108
118
|
"dist/src/client/index.d.ts"
|
|
109
119
|
],
|
package/dist/types/sync.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { RAGChunkingOptions, RAGChunkingRegistryLike, RAGConnectorRuntime, RAGFileExtractor, RAGFileExtractorRegistryLike, RAGLinkedProviderCredentialResolver, RAGLinkedProviderResolutionPurpose } from "@absolutejs/ai";
|
|
2
|
-
export type RAGLinkedConnectorSyncSourceOptions = {
|
|
3
|
-
id: string;
|
|
4
|
-
label: string;
|
|
5
|
-
runtime: RAGConnectorRuntime;
|
|
6
|
-
resolver: RAGLinkedProviderCredentialResolver;
|
|
7
|
-
ownerRef: string;
|
|
8
|
-
bindingId?: string;
|
|
9
|
-
externalAccountId?: string;
|
|
10
|
-
purpose?: RAGLinkedProviderResolutionPurpose;
|
|
11
|
-
requiredScopes?: string[];
|
|
12
|
-
minValidityMs?: number;
|
|
13
|
-
description?: string;
|
|
14
|
-
maxItemsPerRun?: number;
|
|
15
|
-
baseMetadata?: Record<string, unknown>;
|
|
16
|
-
defaultChunking?: RAGChunkingOptions;
|
|
17
|
-
chunkingRegistry?: RAGChunkingRegistryLike;
|
|
18
|
-
extractors?: RAGFileExtractor[];
|
|
19
|
-
extractorRegistry?: RAGFileExtractorRegistryLike;
|
|
20
|
-
metadata?: Record<string, unknown>;
|
|
21
|
-
retryAttempts?: number;
|
|
22
|
-
retryDelayMs?: number;
|
|
23
|
-
};
|