@absolutejs/rag 0.0.20 → 0.0.22
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/index.js +174 -1
- package/dist/index.js.map +5 -4
- package/dist/src/adapters/sync.d.ts +21 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/types/adapters.d.ts +16 -0
- package/package.json +3 -2
|
@@ -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,6 +20,8 @@ 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 { createSyncRAGStore } from "./adapters/sync";
|
|
24
|
+
export type { SyncRAGStore } from "./adapters/sync";
|
|
23
25
|
export { createRAGVector, normalizeVector, querySimilarity, } from "./adapters/utils";
|
|
24
26
|
export type { SQLiteRAGSearchTraceStoreOptions } from "./quality/quality";
|
|
25
27
|
export type { AnthropicOCRConfig, CrossEncoderRerankerConfig, GeminiEmbeddingsConfig, GeminiOCRConfig, GmailEmailSyncConfig, GraphEmailSyncConfig, IMAPEmailSyncConfig, OllamaEmbeddingsConfig, OllamaOCRConfig, OllamaTranscriptionConfig, OpenAICompatibleEmbeddingsConfig, OpenAICompatibleOCRConfig, OpenAICompatibleTranscriptionConfig, OpenAIEmbeddingsConfig, OpenAIOCRConfig, OpenAITranscriptionConfig, } from "../types/providers";
|
package/dist/types/adapters.d.ts
CHANGED
|
@@ -1,4 +1,20 @@
|
|
|
1
|
+
import type { RAGEmbeddingFunction } from "@absolutejs/ai";
|
|
2
|
+
import type { SyncEngine } from "@absolutejs/sync/engine";
|
|
1
3
|
export type InMemoryRAGStoreOptions = {
|
|
2
4
|
dimensions?: number;
|
|
3
5
|
mockEmbedding?: (text: string) => Promise<number[]>;
|
|
4
6
|
};
|
|
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. */
|
|
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. */
|
|
17
|
+
mockEmbedding?: (text: string) => Promise<number[]>;
|
|
18
|
+
/** Change-feed table name the live collection reads. Default `ragChunks`. */
|
|
19
|
+
table?: string;
|
|
20
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@absolutejs/rag",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
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",
|
|
@@ -54,7 +54,8 @@
|
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
56
|
"@absolutejs/ai": "^0.0.9",
|
|
57
|
-
"@absolutejs/linked-providers": "0.0.2"
|
|
57
|
+
"@absolutejs/linked-providers": "0.0.2",
|
|
58
|
+
"@absolutejs/sync": "^1.8.1"
|
|
58
59
|
},
|
|
59
60
|
"peerDependencies": {
|
|
60
61
|
"@angular/core": "^21.0.0",
|