@absolutejs/rag 0.0.4 → 0.0.5
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/src/ai/client/createRAGAnswerWorkflow.d.ts +32 -0
- package/dist/src/ai/client/createRAGStream.d.ts +2 -0
- package/dist/src/ai/client/createRAGWorkflow.d.ts +3 -0
- package/dist/src/ai/client/index.d.ts +8 -0
- package/dist/src/ai/client/ragClient.d.ts +349 -0
- package/dist/src/ai/client/ui.d.ts +5 -0
- package/dist/src/ai/rag/accessControl.d.ts +2 -0
- package/dist/src/ai/rag/adapters/filtering.d.ts +2 -0
- package/dist/src/ai/rag/adapters/inMemory.d.ts +8 -0
- package/dist/src/ai/rag/adapters/postgres.d.ts +20 -0
- package/dist/src/ai/rag/adapters/queryPlanning.d.ts +26 -0
- package/dist/src/ai/rag/adapters/sqlite.d.ts +24 -0
- package/dist/src/ai/rag/adapters/utils.d.ts +3 -0
- package/dist/src/ai/rag/chat.d.ts +1773 -0
- package/dist/src/ai/rag/collection.d.ts +15 -0
- package/dist/src/ai/rag/constants.d.ts +9 -0
- package/dist/src/ai/rag/emailProviders.d.ts +34 -0
- package/dist/src/ai/rag/embedding.d.ts +9 -0
- package/dist/src/ai/rag/embeddingProviders.d.ts +50 -0
- package/dist/src/ai/rag/extractorProviders.d.ts +58 -0
- package/dist/src/ai/rag/grounding.d.ts +6 -0
- package/dist/src/ai/rag/htmxConfig.d.ts +3 -0
- package/dist/src/ai/rag/htmxWorkflowRenderers.d.ts +3 -0
- package/dist/src/ai/rag/index.d.ts +31 -0
- package/dist/src/ai/rag/ingestion.d.ts +61 -0
- package/dist/src/ai/rag/jobState.d.ts +2 -0
- package/dist/src/ai/rag/lexical.d.ts +42 -0
- package/dist/src/ai/rag/presentation.d.ts +165 -0
- package/dist/src/ai/rag/quality.d.ts +607 -0
- package/dist/src/ai/rag/queryTransforms.d.ts +17 -0
- package/dist/src/ai/rag/reranking.d.ts +17 -0
- package/dist/src/ai/rag/resolveAbsoluteSQLiteVec.d.ts +3 -0
- package/dist/src/ai/rag/retrievalStrategies.d.ts +6 -0
- package/dist/src/ai/rag/sync.d.ts +37 -0
- package/dist/src/ai/rag/types.d.ts +11 -0
- package/dist/src/ai/rag/ui.d.ts +4 -0
- package/dist/src/ai/rag/workflowState.d.ts +1 -0
- package/dist/src/angular/ai/ai-rag-stream.service.d.ts +32 -0
- package/dist/src/angular/ai/ai-rag-workflow.service.d.ts +33 -0
- package/dist/src/angular/ai/index.d.ts +3 -0
- package/dist/src/angular/ai/rag-client.service.d.ts +243 -0
- package/dist/src/constants.d.ts +60 -0
- package/dist/src/react/ai/index.d.ts +18 -0
- package/dist/src/react/ai/useRAG.d.ts +341 -0
- package/dist/src/react/ai/useRAGChunkPreview.d.ts +20 -0
- package/dist/src/react/ai/useRAGCitations.d.ts +9 -0
- package/dist/src/react/ai/useRAGDocuments.d.ts +10 -0
- package/dist/src/react/ai/useRAGEvaluate.d.ts +28 -0
- package/dist/src/react/ai/useRAGGrounding.d.ts +10 -0
- package/dist/src/react/ai/useRAGIndexAdmin.d.ts +58 -0
- package/dist/src/react/ai/useRAGIngest.d.ts +16 -0
- package/dist/src/react/ai/useRAGOps.d.ts +20 -0
- package/dist/src/react/ai/useRAGSearch.d.ts +17 -0
- package/dist/src/react/ai/useRAGSources.d.ts +13 -0
- package/dist/src/react/ai/useRAGStatus.d.ts +10 -0
- package/dist/src/react/ai/useRAGStream.d.ts +55 -0
- package/dist/src/react/ai/useRAGStreamProgress.d.ts +9 -0
- package/dist/src/react/ai/useRAGWorkflow.d.ts +55 -0
- package/dist/src/svelte/ai/createRAG.d.ts +292 -0
- package/dist/src/svelte/ai/createRAGChunkPreview.d.ts +20 -0
- package/dist/src/svelte/ai/createRAGCitations.d.ts +10 -0
- package/dist/src/svelte/ai/createRAGDocuments.d.ts +10 -0
- package/dist/src/svelte/ai/createRAGEvaluate.d.ts +28 -0
- package/dist/src/svelte/ai/createRAGGrounding.d.ts +11 -0
- package/dist/src/svelte/ai/createRAGIndexAdmin.d.ts +58 -0
- package/dist/src/svelte/ai/createRAGIngest.d.ts +17 -0
- package/dist/src/svelte/ai/createRAGOps.d.ts +20 -0
- package/dist/src/svelte/ai/createRAGSearch.d.ts +15 -0
- package/dist/src/svelte/ai/createRAGSources.d.ts +14 -0
- package/dist/src/svelte/ai/createRAGStatus.d.ts +9 -0
- package/dist/src/svelte/ai/createRAGStream.d.ts +30 -0
- package/dist/src/svelte/ai/createRAGStreamProgress.d.ts +8 -0
- package/dist/src/svelte/ai/createRAGWorkflow.d.ts +30 -0
- package/dist/src/svelte/ai/index.d.ts +17 -0
- package/dist/src/vue/ai/index.d.ts +17 -0
- package/dist/src/vue/ai/useRAG.d.ts +2892 -0
- package/dist/src/vue/ai/useRAGChunkPreview.d.ts +152 -0
- package/dist/src/vue/ai/useRAGCitations.d.ts +10 -0
- package/dist/src/vue/ai/useRAGDocuments.d.ts +94 -0
- package/dist/src/vue/ai/useRAGEvaluate.d.ts +1002 -0
- package/dist/src/vue/ai/useRAGGrounding.d.ts +11 -0
- package/dist/src/vue/ai/useRAGIndexAdmin.d.ts +1104 -0
- package/dist/src/vue/ai/useRAGIngest.d.ts +27 -0
- package/dist/src/vue/ai/useRAGOps.d.ts +220 -0
- package/dist/src/vue/ai/useRAGSearch.d.ts +159 -0
- package/dist/src/vue/ai/useRAGSources.d.ts +14 -0
- package/dist/src/vue/ai/useRAGStatus.d.ts +9 -0
- package/dist/src/vue/ai/useRAGStream.d.ts +35 -0
- package/dist/src/vue/ai/useRAGStreamProgress.d.ts +8 -0
- package/dist/src/vue/ai/useRAGWorkflow.d.ts +35 -0
- package/package.json +131 -103
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { AIAttachment, RAGAnswerWorkflowState } from "@absolutejs/ai";
|
|
2
|
+
export declare const createRAGAnswerWorkflow: (path: string, conversationId?: string) => {
|
|
3
|
+
state: RAGAnswerWorkflowState;
|
|
4
|
+
latestAssistantMessage: import("@absolutejs/ai").AIMessage | undefined;
|
|
5
|
+
retrieval: import("@absolutejs/ai").RAGRetrievedState | null;
|
|
6
|
+
sources: import("@absolutejs/ai").RAGSource[];
|
|
7
|
+
sourceGroups: import("@absolutejs/ai").RAGSourceGroup[];
|
|
8
|
+
sourceSummaries: import("@absolutejs/ai").RAGSourceSummary[];
|
|
9
|
+
citations: import("@absolutejs/ai").RAGCitation[];
|
|
10
|
+
citationReferenceMap: import("@absolutejs/ai").RAGCitationReferenceMap;
|
|
11
|
+
groundingReferences: import("@absolutejs/ai").RAGGroundingReference[];
|
|
12
|
+
groundedAnswer: import("@absolutejs/ai").RAGGroundedAnswer;
|
|
13
|
+
stage: import("@absolutejs/ai").RAGStreamStage;
|
|
14
|
+
isRunning: boolean;
|
|
15
|
+
isRetrieving: boolean;
|
|
16
|
+
isRetrieved: boolean;
|
|
17
|
+
isAnswerStreaming: boolean;
|
|
18
|
+
isComplete: boolean;
|
|
19
|
+
isError: boolean;
|
|
20
|
+
hasSources: boolean;
|
|
21
|
+
hasRetrieved: boolean;
|
|
22
|
+
query: (content: string, attachments?: AIAttachment[]) => void;
|
|
23
|
+
branch: (messageId: string, content: string) => void;
|
|
24
|
+
cancel: () => void;
|
|
25
|
+
destroy: () => void;
|
|
26
|
+
send: (content: string, attachments?: AIAttachment[]) => void;
|
|
27
|
+
subscribe: (callback: () => void) => () => void;
|
|
28
|
+
error: string | null;
|
|
29
|
+
isStreaming: boolean;
|
|
30
|
+
messages: import("@absolutejs/ai").AIMessage[];
|
|
31
|
+
};
|
|
32
|
+
export type RAGAnswerWorkflow = ReturnType<typeof createRAGAnswerWorkflow>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { createRAGAnswerWorkflow as createRAGWorkflow } from "./createRAGAnswerWorkflow";
|
|
2
|
+
export type { RAGAnswerWorkflow as CreateRAGWorkflow } from "./createRAGAnswerWorkflow";
|
|
3
|
+
export type { RAGAnswerWorkflow as RAGWorkflow } from "./createRAGAnswerWorkflow";
|
|
4
|
+
export { createRAGStream } from "./createRAGStream";
|
|
5
|
+
export type { CreateRAGStream } from "./createRAGStream";
|
|
6
|
+
export { buildRAGMaintenanceOverview, createRAGClient } from "./ragClient";
|
|
7
|
+
export type { RAGClient, RAGClientOptions, RAGDetailedSearchResponse, RAGMaintenanceActionDescriptor, RAGMaintenanceOverview, RAGMaintenancePayload, } from "./ragClient";
|
|
8
|
+
export { buildRAGEvaluationLeaderboard, createRAGEvaluationSuite, runRAGEvaluationSuite, } from "../rag/quality";
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import type { RAGBackendsResponse, RAGBackendMaintenanceRecommendation, RAGBackendMaintenanceSummary, RAGDocumentChunksResponse, RAGEvaluationInput, RAGEvaluationResponse, RAGRetrievalBaselinePromotionFromRunRequest, RAGRetrievalBaselinePromotionRequest, RAGRetrievalBaselineRevertRequest, RAGRetrievalReleaseIncidentAcknowledgeRequest, RAGRetrievalReleaseDecisionActionRequest, RAGRetrievalBaselineResponse, RAGRetrievalLaneHandoffDecisionRequest, RAGRetrievalLaneHandoffDecisionResponse, RAGRetrievalLaneHandoffIncidentStatusResponse, RAGRetrievalLaneHandoffStatusResponse, RAGRetrievalIncidentRemediationDecisionRequest, RAGRetrievalIncidentRemediationBulkExecutionRequest, RAGRetrievalIncidentRemediationExecutionRequest, RAGRetrievalIncidentRemediationExecutionResponse, RAGRetrievalIncidentRemediationStatusResponse, RAGRetrievalReleaseGroupHistoryResponse, RAGRetrievalReleaseIncidentStatusResponse, RAGRetrievalReleaseDriftStatusResponse, RAGRetrievalComparisonRequest, RAGAdaptiveNativePlannerBenchmarkResponse, RAGAdaptiveNativePlannerBenchmarkSnapshotResponse, RAGDocumentIngestInput, RAGDocumentChunk, RAGDocumentsResponse, RAGDocumentUrlIngestInput, RAGDocumentUploadIngestInput, RAGIngestResponse, RAGMutationResponse, RAGOperationsResponse, RAGSearchRequest, RAGSearchResponse, RAGSearchTracePruneResponse, RAGSource, RAGStatusResponse, RAGSyncRunOptions, RAGSyncResponse } from "@absolutejs/ai";
|
|
2
|
+
type FetchLike = typeof fetch;
|
|
3
|
+
export type RAGClientOptions = {
|
|
4
|
+
path: string;
|
|
5
|
+
fetch?: FetchLike;
|
|
6
|
+
};
|
|
7
|
+
export type RAGDetailedSearchResponse = {
|
|
8
|
+
results: RAGSource[];
|
|
9
|
+
trace?: RAGSearchResponse["trace"];
|
|
10
|
+
};
|
|
11
|
+
export type RAGMaintenancePayload = Pick<RAGMutationResponse, "maintenance" | "admin" | "workflowStatus"> | Pick<RAGOperationsResponse, "maintenance" | "admin" | "status"> | Pick<RAGStatusResponse, "maintenance" | "admin" | "status"> | null | undefined;
|
|
12
|
+
export type RAGMaintenanceActionDescriptor = {
|
|
13
|
+
kind: "analyze_backend" | "rebuild_native_index";
|
|
14
|
+
label: string;
|
|
15
|
+
available: boolean;
|
|
16
|
+
recommended: boolean;
|
|
17
|
+
reason?: string;
|
|
18
|
+
};
|
|
19
|
+
export type RAGMaintenanceOverview = {
|
|
20
|
+
activeJobCount: number;
|
|
21
|
+
actions: RAGMaintenanceActionDescriptor[];
|
|
22
|
+
availableActions: RAGMaintenanceActionDescriptor[];
|
|
23
|
+
backend?: RAGBackendMaintenanceSummary["backend"];
|
|
24
|
+
blockingRecommendations: RAGBackendMaintenanceRecommendation[];
|
|
25
|
+
criticalCount: number;
|
|
26
|
+
hasBlockingIssue: boolean;
|
|
27
|
+
infoCount: number;
|
|
28
|
+
primaryRecommendation?: RAGBackendMaintenanceRecommendation;
|
|
29
|
+
recentlyCompletedActions: NonNullable<RAGBackendMaintenanceSummary>["recentActions"];
|
|
30
|
+
recommendationCount: number;
|
|
31
|
+
recommendations: RAGBackendMaintenanceRecommendation[];
|
|
32
|
+
recommendedNow: RAGBackendMaintenanceRecommendation[];
|
|
33
|
+
warningCount: number;
|
|
34
|
+
};
|
|
35
|
+
export declare const buildRAGMaintenanceOverview: (payload: RAGMaintenancePayload) => RAGMaintenanceOverview;
|
|
36
|
+
export declare const createRAGClient: (options: RAGClientOptions) => {
|
|
37
|
+
backends(): Promise<RAGBackendsResponse>;
|
|
38
|
+
clearIndex(): Promise<{
|
|
39
|
+
ok: boolean;
|
|
40
|
+
}>;
|
|
41
|
+
createDocument(input: RAGDocumentIngestInput["documents"][number]): Promise<RAGMutationResponse>;
|
|
42
|
+
deleteDocument(id: string): Promise<RAGMutationResponse>;
|
|
43
|
+
documentChunks(id: string): Promise<RAGDocumentChunksResponse>;
|
|
44
|
+
documents(kind?: string): Promise<RAGDocumentsResponse>;
|
|
45
|
+
evaluate(input: RAGEvaluationInput): Promise<RAGEvaluationResponse>;
|
|
46
|
+
compareRetrievals(input: RAGRetrievalComparisonRequest): Promise<import("@absolutejs/ai").RAGRetrievalComparison>;
|
|
47
|
+
retrievalComparisonHistory(input?: {
|
|
48
|
+
limit?: number;
|
|
49
|
+
suiteId?: string;
|
|
50
|
+
label?: string;
|
|
51
|
+
winnerId?: string;
|
|
52
|
+
groupKey?: string;
|
|
53
|
+
tag?: string;
|
|
54
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalComparisonRun[]>;
|
|
55
|
+
retrievalBaselines(input?: {
|
|
56
|
+
groupKey?: string;
|
|
57
|
+
tag?: string;
|
|
58
|
+
limit?: number;
|
|
59
|
+
status?: "active" | "superseded";
|
|
60
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalBaselineRecord[]>;
|
|
61
|
+
promoteRetrievalBaseline(input: RAGRetrievalBaselinePromotionRequest): Promise<import("@absolutejs/ai").RAGRetrievalBaselineRecord>;
|
|
62
|
+
promoteRetrievalBaselineDetailed(input: RAGRetrievalBaselinePromotionRequest): Promise<RAGRetrievalBaselineResponse>;
|
|
63
|
+
promoteRetrievalBaselineToLane(input: RAGRetrievalBaselinePromotionRequest & {
|
|
64
|
+
rolloutLabel: "canary" | "stable" | "rollback_target";
|
|
65
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalBaselineRecord>;
|
|
66
|
+
promoteRetrievalBaselineToLaneDetailed(input: RAGRetrievalBaselinePromotionRequest & {
|
|
67
|
+
rolloutLabel: "canary" | "stable" | "rollback_target";
|
|
68
|
+
}): Promise<RAGRetrievalBaselineResponse>;
|
|
69
|
+
promoteRetrievalBaselineFromRun(input: RAGRetrievalBaselinePromotionFromRunRequest): Promise<import("@absolutejs/ai").RAGRetrievalBaselineRecord>;
|
|
70
|
+
promoteRetrievalBaselineFromRunDetailed(input: RAGRetrievalBaselinePromotionFromRunRequest): Promise<RAGRetrievalBaselineResponse>;
|
|
71
|
+
revertRetrievalBaseline(input: RAGRetrievalBaselineRevertRequest): Promise<import("@absolutejs/ai").RAGRetrievalBaselineRecord>;
|
|
72
|
+
retrievalBaselineDecisions(input?: {
|
|
73
|
+
groupKey?: string;
|
|
74
|
+
limit?: number;
|
|
75
|
+
kind?: "approve" | "promote" | "reject" | "revert";
|
|
76
|
+
freshnessStatus?: "fresh" | "expired" | "not_applicable";
|
|
77
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
78
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalReleaseDecisionRecord[]>;
|
|
79
|
+
retrievalReleaseGroupHistory(input: {
|
|
80
|
+
groupKey: string;
|
|
81
|
+
decisionLimit?: number;
|
|
82
|
+
baselineLimit?: number;
|
|
83
|
+
benchmarkLimit?: number;
|
|
84
|
+
runLimit?: number;
|
|
85
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
86
|
+
}): Promise<RAGRetrievalReleaseGroupHistoryResponse>;
|
|
87
|
+
adaptiveNativePlannerBenchmark(input?: {
|
|
88
|
+
limit?: number;
|
|
89
|
+
runLimit?: number;
|
|
90
|
+
label?: string;
|
|
91
|
+
description?: string;
|
|
92
|
+
groupKey?: string;
|
|
93
|
+
corpusGroupKey?: string;
|
|
94
|
+
}): Promise<RAGAdaptiveNativePlannerBenchmarkResponse>;
|
|
95
|
+
runAdaptiveNativePlannerBenchmark(input?: {
|
|
96
|
+
limit?: number;
|
|
97
|
+
runLimit?: number;
|
|
98
|
+
topK?: number;
|
|
99
|
+
label?: string;
|
|
100
|
+
description?: string;
|
|
101
|
+
groupKey?: string;
|
|
102
|
+
corpusGroupKey?: string;
|
|
103
|
+
persistRun?: boolean;
|
|
104
|
+
baselineRetrievalId?: string;
|
|
105
|
+
candidateRetrievalId?: string;
|
|
106
|
+
retrievals?: Array<{
|
|
107
|
+
id: string;
|
|
108
|
+
label?: string;
|
|
109
|
+
retrieval?: Record<string, unknown> | string;
|
|
110
|
+
}>;
|
|
111
|
+
tags?: string[];
|
|
112
|
+
metadata?: Record<string, unknown>;
|
|
113
|
+
}): Promise<RAGAdaptiveNativePlannerBenchmarkResponse>;
|
|
114
|
+
saveAdaptiveNativePlannerBenchmarkSnapshot(input?: {
|
|
115
|
+
limit?: number;
|
|
116
|
+
label?: string;
|
|
117
|
+
description?: string;
|
|
118
|
+
version?: number;
|
|
119
|
+
createdAt?: number;
|
|
120
|
+
metadata?: Record<string, unknown>;
|
|
121
|
+
snapshotMetadata?: Record<string, unknown>;
|
|
122
|
+
}): Promise<RAGAdaptiveNativePlannerBenchmarkSnapshotResponse>;
|
|
123
|
+
nativeBackendComparisonBenchmark(input?: {
|
|
124
|
+
limit?: number;
|
|
125
|
+
runLimit?: number;
|
|
126
|
+
label?: string;
|
|
127
|
+
description?: string;
|
|
128
|
+
groupKey?: string;
|
|
129
|
+
corpusGroupKey?: string;
|
|
130
|
+
}): Promise<RAGAdaptiveNativePlannerBenchmarkResponse>;
|
|
131
|
+
runNativeBackendComparisonBenchmark(input?: {
|
|
132
|
+
limit?: number;
|
|
133
|
+
runLimit?: number;
|
|
134
|
+
topK?: number;
|
|
135
|
+
label?: string;
|
|
136
|
+
description?: string;
|
|
137
|
+
groupKey?: string;
|
|
138
|
+
corpusGroupKey?: string;
|
|
139
|
+
persistRun?: boolean;
|
|
140
|
+
baselineRetrievalId?: string;
|
|
141
|
+
candidateRetrievalId?: string;
|
|
142
|
+
retrievals?: Array<{
|
|
143
|
+
id: string;
|
|
144
|
+
label?: string;
|
|
145
|
+
retrieval?: Record<string, unknown> | string;
|
|
146
|
+
}>;
|
|
147
|
+
tags?: string[];
|
|
148
|
+
metadata?: Record<string, unknown>;
|
|
149
|
+
}): Promise<RAGAdaptiveNativePlannerBenchmarkResponse>;
|
|
150
|
+
saveNativeBackendComparisonBenchmarkSnapshot(input?: {
|
|
151
|
+
limit?: number;
|
|
152
|
+
label?: string;
|
|
153
|
+
description?: string;
|
|
154
|
+
version?: number;
|
|
155
|
+
createdAt?: number;
|
|
156
|
+
metadata?: Record<string, unknown>;
|
|
157
|
+
snapshotMetadata?: Record<string, unknown>;
|
|
158
|
+
}): Promise<RAGAdaptiveNativePlannerBenchmarkSnapshotResponse>;
|
|
159
|
+
retrievalLaneHandoffs(input?: {
|
|
160
|
+
groupKey?: string;
|
|
161
|
+
sourceRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
162
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
163
|
+
limit?: number;
|
|
164
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalReleaseLaneHandoffSummary[]>;
|
|
165
|
+
retrievalLaneHandoffDecisions(input?: {
|
|
166
|
+
groupKey?: string;
|
|
167
|
+
sourceRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
168
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
169
|
+
kind?: "approve" | "reject" | "complete";
|
|
170
|
+
limit?: number;
|
|
171
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalLaneHandoffDecisionRecord[]>;
|
|
172
|
+
retrievalLaneHandoffIncidents(input?: {
|
|
173
|
+
groupKey?: string;
|
|
174
|
+
limit?: number;
|
|
175
|
+
status?: "open" | "resolved";
|
|
176
|
+
severity?: "warning" | "critical";
|
|
177
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
178
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalLaneHandoffIncidentRecord[]>;
|
|
179
|
+
retrievalLaneHandoffIncidentHistory(input?: {
|
|
180
|
+
action?: "opened" | "acknowledged" | "unacknowledged" | "resolved";
|
|
181
|
+
groupKey?: string;
|
|
182
|
+
incidentId?: string;
|
|
183
|
+
limit?: number;
|
|
184
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
185
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalLaneHandoffIncidentHistoryRecord[]>;
|
|
186
|
+
retrievalLaneHandoffAutoCompletePolicyHistory(input?: {
|
|
187
|
+
groupKey?: string;
|
|
188
|
+
limit?: number;
|
|
189
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
190
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalLaneHandoffAutoCompletePolicyHistoryRecord[]>;
|
|
191
|
+
retrievalReleaseLanePolicyHistory(input?: {
|
|
192
|
+
groupKey?: string;
|
|
193
|
+
limit?: number;
|
|
194
|
+
rolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
195
|
+
scope?: "rollout_label" | "group_rollout_label";
|
|
196
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalReleaseLanePolicyHistoryRecord[]>;
|
|
197
|
+
retrievalBaselineGatePolicyHistory(input?: {
|
|
198
|
+
groupKey?: string;
|
|
199
|
+
limit?: number;
|
|
200
|
+
rolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
201
|
+
scope?: "rollout_label" | "group_rollout_label";
|
|
202
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalBaselineGatePolicyHistoryRecord[]>;
|
|
203
|
+
retrievalReleaseLaneEscalationPolicyHistory(input?: {
|
|
204
|
+
groupKey?: string;
|
|
205
|
+
limit?: number;
|
|
206
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
207
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalReleaseLaneEscalationPolicyHistoryRecord[]>;
|
|
208
|
+
retrievalReleaseIncidentPolicyHistory(input?: {
|
|
209
|
+
groupKey?: string;
|
|
210
|
+
limit?: number;
|
|
211
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
212
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalReleaseLaneEscalationPolicyHistoryRecord[]>;
|
|
213
|
+
retrievalReleaseIncidentStatus(): Promise<RAGRetrievalReleaseIncidentStatusResponse>;
|
|
214
|
+
retrievalIncidentRemediationStatus(): Promise<RAGRetrievalIncidentRemediationStatusResponse>;
|
|
215
|
+
retrievalLaneHandoffIncidentStatus(): Promise<RAGRetrievalLaneHandoffIncidentStatusResponse>;
|
|
216
|
+
acknowledgeRetrievalLaneHandoffIncident(input: RAGRetrievalReleaseIncidentAcknowledgeRequest): Promise<import("@absolutejs/ai").RAGRetrievalLaneHandoffIncidentRecord[]>;
|
|
217
|
+
unacknowledgeRetrievalLaneHandoffIncident(input: {
|
|
218
|
+
incidentId: string;
|
|
219
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalLaneHandoffIncidentRecord[]>;
|
|
220
|
+
resolveRetrievalLaneHandoffIncident(input: {
|
|
221
|
+
incidentId: string;
|
|
222
|
+
resolvedAt?: number;
|
|
223
|
+
resolvedBy?: string;
|
|
224
|
+
resolutionNotes?: string;
|
|
225
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalLaneHandoffIncidentRecord[]>;
|
|
226
|
+
decideRetrievalLaneHandoff(input: RAGRetrievalLaneHandoffDecisionRequest): Promise<import("@absolutejs/ai").RAGRetrievalLaneHandoffDecisionRecord>;
|
|
227
|
+
decideRetrievalLaneHandoffDetailed(input: RAGRetrievalLaneHandoffDecisionRequest): Promise<RAGRetrievalLaneHandoffDecisionResponse>;
|
|
228
|
+
retrievalReleaseIncidents(input?: {
|
|
229
|
+
groupKey?: string;
|
|
230
|
+
limit?: number;
|
|
231
|
+
status?: "open" | "resolved";
|
|
232
|
+
severity?: "warning" | "critical";
|
|
233
|
+
kind?: "approval_expired" | "baseline_regression" | "gate_failure" | "handoff_stale";
|
|
234
|
+
acknowledged?: boolean;
|
|
235
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
236
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalReleaseIncidentRecord[]>;
|
|
237
|
+
retrievalIncidentRemediationDecisions(input?: {
|
|
238
|
+
groupKey?: string;
|
|
239
|
+
incidentId?: string;
|
|
240
|
+
limit?: number;
|
|
241
|
+
remediationKind?: RAGRetrievalIncidentRemediationDecisionRequest["remediationKind"];
|
|
242
|
+
status?: "planned" | "applied" | "dismissed";
|
|
243
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
244
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalIncidentRemediationDecisionRecord[]>;
|
|
245
|
+
retrievalIncidentRemediationExecutions(input?: {
|
|
246
|
+
groupKey?: string;
|
|
247
|
+
incidentId?: string;
|
|
248
|
+
limit?: number;
|
|
249
|
+
actionKind?: RAGRetrievalIncidentRemediationExecutionRequest["action"]["kind"];
|
|
250
|
+
code?: NonNullable<RAGRetrievalIncidentRemediationExecutionResponse["execution"]>["code"];
|
|
251
|
+
blockedByGuardrail?: boolean;
|
|
252
|
+
idempotentReplay?: boolean;
|
|
253
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
254
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalIncidentRemediationExecutionHistoryRecord[]>;
|
|
255
|
+
recordRetrievalIncidentRemediationDecision(input: RAGRetrievalIncidentRemediationDecisionRequest): Promise<import("@absolutejs/ai").RAGRetrievalIncidentRemediationDecisionRecord[]>;
|
|
256
|
+
executeRetrievalIncidentRemediation(input: RAGRetrievalIncidentRemediationExecutionRequest): Promise<RAGRetrievalIncidentRemediationExecutionResponse>;
|
|
257
|
+
bulkExecuteRetrievalIncidentRemediations(input: RAGRetrievalIncidentRemediationBulkExecutionRequest): Promise<{
|
|
258
|
+
index: number;
|
|
259
|
+
ok: boolean;
|
|
260
|
+
execution?: import("@absolutejs/ai").RAGRetrievalIncidentRemediationExecutionResult;
|
|
261
|
+
record?: import("@absolutejs/ai").RAGRetrievalIncidentRemediationDecisionRecord;
|
|
262
|
+
error?: string;
|
|
263
|
+
}[]>;
|
|
264
|
+
acknowledgeRetrievalReleaseIncident(input: RAGRetrievalReleaseIncidentAcknowledgeRequest): Promise<import("@absolutejs/ai").RAGRetrievalReleaseIncidentRecord[]>;
|
|
265
|
+
unacknowledgeRetrievalReleaseIncident(input: {
|
|
266
|
+
incidentId: string;
|
|
267
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalReleaseIncidentRecord[]>;
|
|
268
|
+
resolveRetrievalReleaseIncident(input: {
|
|
269
|
+
incidentId: string;
|
|
270
|
+
resolvedAt?: number;
|
|
271
|
+
resolvedBy?: string;
|
|
272
|
+
resolutionNotes?: string;
|
|
273
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalReleaseIncidentRecord[]>;
|
|
274
|
+
retrievalPromotionCandidates(input?: {
|
|
275
|
+
groupKey?: string;
|
|
276
|
+
limit?: number;
|
|
277
|
+
tag?: string;
|
|
278
|
+
targetRolloutLabel?: "canary" | "stable" | "rollback_target";
|
|
279
|
+
approved?: boolean;
|
|
280
|
+
ready?: boolean;
|
|
281
|
+
blocked?: boolean;
|
|
282
|
+
reviewStatus?: "approved" | "blocked" | "needs_review" | "ready";
|
|
283
|
+
freshnessStatus?: "fresh" | "expired" | "not_applicable";
|
|
284
|
+
sortBy?: "approvalFreshness" | "finishedAt" | "gateSeverity" | "priority";
|
|
285
|
+
sortDirection?: "asc" | "desc";
|
|
286
|
+
}): Promise<import("@absolutejs/ai").RAGRetrievalPromotionCandidate[]>;
|
|
287
|
+
approveRetrievalCandidate(input: RAGRetrievalReleaseDecisionActionRequest): Promise<import("@absolutejs/ai").RAGRetrievalReleaseDecisionRecord[]>;
|
|
288
|
+
rejectRetrievalCandidate(input: RAGRetrievalReleaseDecisionActionRequest): Promise<import("@absolutejs/ai").RAGRetrievalReleaseDecisionRecord[]>;
|
|
289
|
+
ingest(chunks: RAGDocumentChunk[]): Promise<RAGIngestResponse>;
|
|
290
|
+
ingestDocuments(input: RAGDocumentIngestInput): Promise<RAGIngestResponse>;
|
|
291
|
+
ingestUploads(input: RAGDocumentUploadIngestInput): Promise<RAGIngestResponse>;
|
|
292
|
+
ingestUrls(input: RAGDocumentUrlIngestInput): Promise<RAGIngestResponse>;
|
|
293
|
+
analyzeBackend(): Promise<RAGMutationResponse>;
|
|
294
|
+
ops(): Promise<RAGOperationsResponse>;
|
|
295
|
+
searchTraceHistory(input?: {
|
|
296
|
+
query?: string;
|
|
297
|
+
groupKey?: string;
|
|
298
|
+
tag?: string;
|
|
299
|
+
limit?: number;
|
|
300
|
+
}): Promise<import("@absolutejs/ai").RAGSearchTraceHistory>;
|
|
301
|
+
searchTraceGroups(input?: {
|
|
302
|
+
tag?: string;
|
|
303
|
+
limit?: number;
|
|
304
|
+
}): Promise<import("@absolutejs/ai").RAGSearchTraceGroupHistory>;
|
|
305
|
+
searchTraceStats(input?: {
|
|
306
|
+
tag?: string;
|
|
307
|
+
}): Promise<import("@absolutejs/ai").RAGSearchTraceStats>;
|
|
308
|
+
previewSearchTracePrune(input?: {
|
|
309
|
+
maxAgeMs?: number;
|
|
310
|
+
maxRecordsPerQuery?: number;
|
|
311
|
+
maxRecordsPerGroup?: number;
|
|
312
|
+
now?: number;
|
|
313
|
+
tag?: string;
|
|
314
|
+
}): Promise<import("@absolutejs/ai").RAGSearchTracePrunePreview>;
|
|
315
|
+
pruneSearchTraces(input?: {
|
|
316
|
+
maxAgeMs?: number;
|
|
317
|
+
maxRecordsPerQuery?: number;
|
|
318
|
+
maxRecordsPerGroup?: number;
|
|
319
|
+
now?: number;
|
|
320
|
+
tag?: string;
|
|
321
|
+
}): Promise<RAGSearchTracePruneResponse>;
|
|
322
|
+
searchTracePruneHistory(input?: {
|
|
323
|
+
limit?: number;
|
|
324
|
+
trigger?: "manual" | "write" | "schedule";
|
|
325
|
+
}): Promise<import("@absolutejs/ai").RAGSearchTracePruneRun[]>;
|
|
326
|
+
syncSources(): Promise<RAGSyncResponse>;
|
|
327
|
+
syncAllSources(options?: RAGSyncRunOptions): Promise<RAGSyncResponse>;
|
|
328
|
+
syncSource(id: string, options?: RAGSyncRunOptions): Promise<RAGSyncResponse>;
|
|
329
|
+
reindexDocument(id: string): Promise<RAGMutationResponse>;
|
|
330
|
+
reindexSource(source: string): Promise<RAGMutationResponse>;
|
|
331
|
+
reseed(): Promise<RAGMutationResponse>;
|
|
332
|
+
reset(): Promise<RAGMutationResponse>;
|
|
333
|
+
rebuildNativeIndex(): Promise<RAGMutationResponse>;
|
|
334
|
+
search: <IncludeTrace extends boolean | undefined = undefined>(input: RAGSearchRequest & {
|
|
335
|
+
includeTrace?: IncludeTrace;
|
|
336
|
+
}) => Promise<IncludeTrace extends true ? RAGDetailedSearchResponse : RAGSource[]>;
|
|
337
|
+
searchWithTrace(input: RAGSearchRequest): Promise<RAGDetailedSearchResponse>;
|
|
338
|
+
/**
|
|
339
|
+
* @deprecated Use `searchWithTrace` for trace-aware search responses.
|
|
340
|
+
*/
|
|
341
|
+
searchDetailed(input: RAGSearchRequest): Promise<RAGDetailedSearchResponse>;
|
|
342
|
+
status(): Promise<RAGStatusResponse>;
|
|
343
|
+
statusMaintenance(): Promise<RAGStatusResponse>;
|
|
344
|
+
retrievalReleaseStatus(): Promise<import("@absolutejs/ai").RAGRetrievalComparisonRuntime | undefined>;
|
|
345
|
+
retrievalReleaseDriftStatus(): Promise<RAGRetrievalReleaseDriftStatusResponse>;
|
|
346
|
+
retrievalLaneHandoffStatus(): Promise<RAGRetrievalLaneHandoffStatusResponse>;
|
|
347
|
+
};
|
|
348
|
+
export type RAGClient = ReturnType<typeof createRAGClient>;
|
|
349
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { buildRAGAnswerWorkflowState, buildRAGSourceGroups, buildRAGSourceSummaries, buildRAGStreamProgress, getLatestAssistantMessage, resolveRAGStreamStage, } from "../rag/workflowState";
|
|
2
|
+
export { buildRAGStreamProgress as getRAGStreamProgress } from "../rag/workflowState";
|
|
3
|
+
export { buildRAGCitationReferenceMap, buildRAGChunkExcerpts, buildRAGChunkGraphNavigation, buildRAGChunkGraph, buildRAGChunkPreviewGraph, buildRAGChunkPreviewNavigation, buildRAGGroundedAnswer, buildRAGGroundedAnswerSectionSummaries, buildRAGGroundingReferences, buildRAGSectionRetrievalDiagnostics, } from "../rag/presentation";
|
|
4
|
+
export type { RAGStreamProgress, RAGStreamProgressState, } from "../rag/workflowState";
|
|
5
|
+
export type { RAGAnswerWorkflowState } from "@absolutejs/ai";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { CreateRAGAccessControlOptions, RAGChatPluginConfig } from "@absolutejs/ai";
|
|
2
|
+
export declare const createRAGAccessControl: <TContext = unknown>(options: CreateRAGAccessControlOptions<TContext>) => Pick<RAGChatPluginConfig, "authorizeRAGAction" | "resolveRAGAccessScope">;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createRAGVector, normalizeVector, querySimilarity } from "./utils";
|
|
2
|
+
import type { RAGVectorStore } from "@absolutejs/ai";
|
|
3
|
+
export type InMemoryRAGStoreOptions = {
|
|
4
|
+
dimensions?: number;
|
|
5
|
+
mockEmbedding?: (text: string) => Promise<number[]>;
|
|
6
|
+
};
|
|
7
|
+
export declare const createInMemoryRAGStore: (options?: InMemoryRAGStoreOptions) => RAGVectorStore;
|
|
8
|
+
export { createRAGVector, normalizeVector, querySimilarity };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { RAGVectorStore } from "@absolutejs/ai";
|
|
2
|
+
type BunSQLClient = InstanceType<typeof Bun.SQL>;
|
|
3
|
+
type PostgresDistanceMetric = "cosine" | "l2" | "inner_product";
|
|
4
|
+
type PostgresIndexType = "none" | "hnsw" | "ivfflat";
|
|
5
|
+
export type PostgresRAGStoreOptions = {
|
|
6
|
+
connectionString?: string;
|
|
7
|
+
sql?: BunSQLClient;
|
|
8
|
+
dimensions?: number;
|
|
9
|
+
mockEmbedding?: (text: string) => Promise<number[]>;
|
|
10
|
+
tableName?: string;
|
|
11
|
+
schemaName?: string;
|
|
12
|
+
distanceMetric?: PostgresDistanceMetric;
|
|
13
|
+
queryMultiplier?: number;
|
|
14
|
+
indexType?: PostgresIndexType;
|
|
15
|
+
indexLists?: number;
|
|
16
|
+
hnswM?: number;
|
|
17
|
+
hnswEfConstruction?: number;
|
|
18
|
+
};
|
|
19
|
+
export declare const createPostgresRAGStore: (options?: PostgresRAGStoreOptions) => RAGVectorStore;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const planNativeCandidateSearchK: (input: {
|
|
2
|
+
topK: number;
|
|
3
|
+
queryMultiplier: number;
|
|
4
|
+
candidateLimit: number;
|
|
5
|
+
filteredCandidateCount?: number;
|
|
6
|
+
}) => number;
|
|
7
|
+
export declare const resolveAdaptiveNativeCandidateLimit: (input: {
|
|
8
|
+
defaultCandidateLimit: number;
|
|
9
|
+
explicitCandidateLimit?: number;
|
|
10
|
+
filteredCandidateCount?: number;
|
|
11
|
+
plannerProfile?: "latency" | "balanced" | "recall";
|
|
12
|
+
queryMultiplier: number;
|
|
13
|
+
topK: number;
|
|
14
|
+
}) => number;
|
|
15
|
+
export declare const planNativeCandidateSearchBackfillK: (input: {
|
|
16
|
+
currentSearchK: number;
|
|
17
|
+
candidateLimit: number;
|
|
18
|
+
filteredCandidateCount?: number;
|
|
19
|
+
backfillCount?: number;
|
|
20
|
+
maxBackfills?: number;
|
|
21
|
+
}) => number;
|
|
22
|
+
export declare const summarizeSQLiteCandidateCoverage: (input: {
|
|
23
|
+
topK: number;
|
|
24
|
+
filteredCandidateCount?: number;
|
|
25
|
+
returnedCount?: number;
|
|
26
|
+
}) => "empty" | "under_target" | "target_sized" | "broad";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Database } from "bun:sqlite";
|
|
2
|
+
import type { RAGVectorStore } from "@absolutejs/ai";
|
|
3
|
+
type NativeDistanceMetric = "cosine" | "l2";
|
|
4
|
+
type NativeRAGMode = "vec0";
|
|
5
|
+
export type NativeSQLiteRAGStoreOptions = {
|
|
6
|
+
mode: NativeRAGMode;
|
|
7
|
+
extensionPath?: string;
|
|
8
|
+
extensionInitSql?: string | string[];
|
|
9
|
+
distanceMetric?: NativeDistanceMetric;
|
|
10
|
+
tableName?: string;
|
|
11
|
+
queryMultiplier?: number;
|
|
12
|
+
requireAvailable?: boolean;
|
|
13
|
+
resolveFromAbsolutePackages?: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type SQLiteRAGStoreOptions = {
|
|
16
|
+
db?: Database;
|
|
17
|
+
path?: string;
|
|
18
|
+
dimensions?: number;
|
|
19
|
+
mockEmbedding?: (text: string) => Promise<number[]>;
|
|
20
|
+
tableName?: string;
|
|
21
|
+
native?: NativeSQLiteRAGStoreOptions;
|
|
22
|
+
};
|
|
23
|
+
export declare const createSQLiteRAGStore: (options?: SQLiteRAGStoreOptions) => RAGVectorStore;
|
|
24
|
+
export {};
|