@seanhogg/builderforce-memory 2026.7.14 → 2026.9.27
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 +10 -0
- package/dist/bridges/AnthropicBridge.d.ts +9 -1
- package/dist/bridges/AnthropicBridge.d.ts.map +1 -1
- package/dist/bridges/AnthropicBridge.js +58 -2
- package/dist/bridges/AnthropicBridge.js.map +1 -1
- package/dist/bridges/CachingBridge.d.ts +9 -1
- package/dist/bridges/CachingBridge.d.ts.map +1 -1
- package/dist/bridges/CachingBridge.js +24 -1
- package/dist/bridges/CachingBridge.js.map +1 -1
- package/dist/bridges/OpenAIBridge.d.ts +4 -1
- package/dist/bridges/OpenAIBridge.d.ts.map +1 -1
- package/dist/bridges/OpenAIBridge.js +40 -2
- package/dist/bridges/OpenAIBridge.js.map +1 -1
- package/dist/bridges/SemanticCachingBridge.d.ts +8 -1
- package/dist/bridges/SemanticCachingBridge.d.ts.map +1 -1
- package/dist/bridges/SemanticCachingBridge.js +26 -1
- package/dist/bridges/SemanticCachingBridge.js.map +1 -1
- package/dist/bridges/TransformerBridge.d.ts +13 -0
- package/dist/bridges/TransformerBridge.d.ts.map +1 -1
- package/dist/bridges/VertexAIBridge.d.ts +102 -0
- package/dist/bridges/VertexAIBridge.d.ts.map +1 -0
- package/dist/bridges/VertexAIBridge.js +224 -0
- package/dist/bridges/VertexAIBridge.js.map +1 -0
- package/dist/bridges/index.d.ts +3 -1
- package/dist/bridges/index.d.ts.map +1 -1
- package/dist/bridges/index.js +1 -0
- package/dist/bridges/index.js.map +1 -1
- package/dist/eval/EvalHarness.d.ts +37 -0
- package/dist/eval/EvalHarness.d.ts.map +1 -0
- package/dist/eval/EvalHarness.js +178 -0
- package/dist/eval/EvalHarness.js.map +1 -0
- package/dist/eval/graders.d.ts +76 -0
- package/dist/eval/graders.d.ts.map +1 -0
- package/dist/eval/graders.js +168 -0
- package/dist/eval/graders.js.map +1 -0
- package/dist/eval/index.d.ts +26 -0
- package/dist/eval/index.d.ts.map +1 -0
- package/dist/eval/index.js +26 -0
- package/dist/eval/index.js.map +1 -0
- package/dist/eval/types.d.ts +97 -0
- package/dist/eval/types.d.ts.map +1 -0
- package/dist/eval/types.js +5 -0
- package/dist/eval/types.js.map +1 -0
- package/dist/evermind/contract.d.ts +40 -0
- package/dist/evermind/contract.d.ts.map +1 -0
- package/dist/evermind/contract.js +13 -0
- package/dist/evermind/contract.js.map +1 -0
- package/dist/evermind/index.d.ts +15 -0
- package/dist/evermind/index.d.ts.map +1 -0
- package/dist/evermind/index.js +4 -0
- package/dist/evermind/index.js.map +1 -0
- package/dist/evermind/memoryBlock.d.ts +7 -0
- package/dist/evermind/memoryBlock.d.ts.map +1 -0
- package/dist/evermind/memoryBlock.js +37 -0
- package/dist/evermind/memoryBlock.js.map +1 -0
- package/dist/evermind/recall.d.ts +55 -0
- package/dist/evermind/recall.d.ts.map +1 -0
- package/dist/evermind/recall.js +105 -0
- package/dist/evermind/recall.js.map +1 -0
- package/dist/index.d.ts +18 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/dist/index.js.map +1 -1
- package/dist/ingest/IngestionPipeline.d.ts +95 -0
- package/dist/ingest/IngestionPipeline.d.ts.map +1 -0
- package/dist/ingest/IngestionPipeline.js +295 -0
- package/dist/ingest/IngestionPipeline.js.map +1 -0
- package/dist/ingest/index.d.ts +10 -0
- package/dist/ingest/index.d.ts.map +1 -0
- package/dist/ingest/index.js +8 -0
- package/dist/ingest/index.js.map +1 -0
- package/dist/ingest/parsers.d.ts +53 -0
- package/dist/ingest/parsers.d.ts.map +1 -0
- package/dist/ingest/parsers.js +306 -0
- package/dist/ingest/parsers.js.map +1 -0
- package/dist/ingest/types.d.ts +114 -0
- package/dist/ingest/types.d.ts.map +1 -0
- package/dist/ingest/types.js +19 -0
- package/dist/ingest/types.js.map +1 -0
- package/dist/memory/MemoryStore.d.ts +33 -0
- package/dist/memory/MemoryStore.d.ts.map +1 -1
- package/dist/memory/MemoryStore.js +29 -3
- package/dist/memory/MemoryStore.js.map +1 -1
- package/dist/memory/index.d.ts +1 -1
- package/dist/memory/index.d.ts.map +1 -1
- package/dist/orchestration/AgentGraph.d.ts +104 -0
- package/dist/orchestration/AgentGraph.d.ts.map +1 -0
- package/dist/orchestration/AgentGraph.js +364 -0
- package/dist/orchestration/AgentGraph.js.map +1 -0
- package/dist/orchestration/checkpoint.d.ts +58 -0
- package/dist/orchestration/checkpoint.d.ts.map +1 -0
- package/dist/orchestration/checkpoint.js +92 -0
- package/dist/orchestration/checkpoint.js.map +1 -0
- package/dist/orchestration/index.d.ts +14 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +10 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/patterns.d.ts +159 -0
- package/dist/orchestration/patterns.d.ts.map +1 -0
- package/dist/orchestration/patterns.js +371 -0
- package/dist/orchestration/patterns.js.map +1 -0
- package/dist/orchestration/types.d.ts +146 -0
- package/dist/orchestration/types.d.ts.map +1 -0
- package/dist/orchestration/types.js +20 -0
- package/dist/orchestration/types.js.map +1 -0
- package/dist/rag/EnterpriseRetriever.d.ts +114 -0
- package/dist/rag/EnterpriseRetriever.d.ts.map +1 -0
- package/dist/rag/EnterpriseRetriever.js +240 -0
- package/dist/rag/EnterpriseRetriever.js.map +1 -0
- package/dist/rag/index.d.ts +6 -0
- package/dist/rag/index.d.ts.map +1 -0
- package/dist/rag/index.js +5 -0
- package/dist/rag/index.js.map +1 -0
- package/dist/retrieval/bm25.d.ts +48 -1
- package/dist/retrieval/bm25.d.ts.map +1 -1
- package/dist/retrieval/bm25.js +59 -13
- package/dist/retrieval/bm25.js.map +1 -1
- package/dist/retrieval/index.d.ts +2 -2
- package/dist/retrieval/index.d.ts.map +1 -1
- package/dist/retrieval/index.js +1 -1
- package/dist/retrieval/index.js.map +1 -1
- package/dist/telemetry/InstrumentedBridge.d.ts +62 -0
- package/dist/telemetry/InstrumentedBridge.d.ts.map +1 -0
- package/dist/telemetry/InstrumentedBridge.js +120 -0
- package/dist/telemetry/InstrumentedBridge.js.map +1 -0
- package/dist/telemetry/MetricsRegistry.d.ts +88 -0
- package/dist/telemetry/MetricsRegistry.d.ts.map +1 -0
- package/dist/telemetry/MetricsRegistry.js +167 -0
- package/dist/telemetry/MetricsRegistry.js.map +1 -0
- package/dist/telemetry/Tracer.d.ts +137 -0
- package/dist/telemetry/Tracer.d.ts.map +1 -0
- package/dist/telemetry/Tracer.js +244 -0
- package/dist/telemetry/Tracer.js.map +1 -0
- package/dist/telemetry/exporters.d.ts +68 -0
- package/dist/telemetry/exporters.d.ts.map +1 -0
- package/dist/telemetry/exporters.js +145 -0
- package/dist/telemetry/exporters.js.map +1 -0
- package/dist/telemetry/index.d.ts +19 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +12 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/telemetry/pricing.d.ts +74 -0
- package/dist/telemetry/pricing.d.ts.map +1 -0
- package/dist/telemetry/pricing.js +98 -0
- package/dist/telemetry/pricing.js.map +1 -0
- package/dist/telemetry/traceparent.d.ts +50 -0
- package/dist/telemetry/traceparent.d.ts.map +1 -0
- package/dist/telemetry/traceparent.js +77 -0
- package/dist/telemetry/traceparent.js.map +1 -0
- package/dist/telemetry/types.d.ts +90 -0
- package/dist/telemetry/types.d.ts.map +1 -0
- package/dist/telemetry/types.js +17 -0
- package/dist/telemetry/types.js.map +1 -0
- package/dist/vectorstore/MemoryVectorStore.d.ts +72 -0
- package/dist/vectorstore/MemoryVectorStore.d.ts.map +1 -0
- package/dist/vectorstore/MemoryVectorStore.js +205 -0
- package/dist/vectorstore/MemoryVectorStore.js.map +1 -0
- package/dist/vectorstore/RestVectorStore.d.ts +79 -0
- package/dist/vectorstore/RestVectorStore.d.ts.map +1 -0
- package/dist/vectorstore/RestVectorStore.js +170 -0
- package/dist/vectorstore/RestVectorStore.js.map +1 -0
- package/dist/vectorstore/dialects.d.ts +101 -0
- package/dist/vectorstore/dialects.d.ts.map +1 -0
- package/dist/vectorstore/dialects.js +618 -0
- package/dist/vectorstore/dialects.js.map +1 -0
- package/dist/vectorstore/filter.d.ts +42 -0
- package/dist/vectorstore/filter.d.ts.map +1 -0
- package/dist/vectorstore/filter.js +132 -0
- package/dist/vectorstore/filter.js.map +1 -0
- package/dist/vectorstore/index.d.ts +15 -0
- package/dist/vectorstore/index.d.ts.map +1 -0
- package/dist/vectorstore/index.js +11 -0
- package/dist/vectorstore/index.js.map +1 -0
- package/dist/vectorstore/types.d.ts +151 -0
- package/dist/vectorstore/types.d.ts.map +1 -0
- package/dist/vectorstore/types.js +30 -0
- package/dist/vectorstore/types.js.map +1 -0
- package/package.json +39 -5
- package/src/bridges/AnthropicBridge.ts +68 -3
- package/src/bridges/CachingBridge.ts +28 -2
- package/src/bridges/OpenAIBridge.ts +48 -3
- package/src/bridges/SemanticCachingBridge.ts +29 -2
- package/src/bridges/TransformerBridge.ts +16 -0
- package/src/bridges/VertexAIBridge.ts +297 -0
- package/src/bridges/index.ts +3 -1
- package/src/eval/EvalHarness.ts +214 -0
- package/src/eval/graders.ts +218 -0
- package/src/eval/index.ts +26 -0
- package/src/eval/types.ts +107 -0
- package/src/evermind/contract.ts +39 -0
- package/src/evermind/index.ts +21 -0
- package/src/evermind/memoryBlock.ts +38 -0
- package/src/evermind/recall.ts +122 -0
- package/src/index.ts +232 -0
- package/src/ingest/IngestionPipeline.ts +378 -0
- package/src/ingest/index.ts +46 -0
- package/src/ingest/parsers.ts +318 -0
- package/src/ingest/types.ts +116 -0
- package/src/memory/MemoryStore.ts +55 -3
- package/src/memory/index.ts +1 -1
- package/src/orchestration/AgentGraph.ts +462 -0
- package/src/orchestration/checkpoint.ts +129 -0
- package/src/orchestration/index.ts +63 -0
- package/src/orchestration/patterns.ts +532 -0
- package/src/orchestration/types.ts +128 -0
- package/src/rag/EnterpriseRetriever.ts +348 -0
- package/src/rag/index.ts +18 -0
- package/src/retrieval/bm25.ts +71 -13
- package/src/retrieval/index.ts +2 -2
- package/src/telemetry/InstrumentedBridge.ts +152 -0
- package/src/telemetry/MetricsRegistry.ts +263 -0
- package/src/telemetry/Tracer.ts +310 -0
- package/src/telemetry/exporters.ts +187 -0
- package/src/telemetry/index.ts +56 -0
- package/src/telemetry/pricing.ts +129 -0
- package/src/telemetry/traceparent.ts +89 -0
- package/src/telemetry/types.ts +105 -0
- package/src/vectorstore/MemoryVectorStore.ts +250 -0
- package/src/vectorstore/RestVectorStore.ts +236 -0
- package/src/vectorstore/dialects.ts +702 -0
- package/src/vectorstore/filter.ts +148 -0
- package/src/vectorstore/index.ts +53 -0
- package/src/vectorstore/types.ts +149 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* evermind/recall.ts — the lexical recall rules for a project Evermind's taught memories.
|
|
3
|
+
*
|
|
4
|
+
* The gateway ranks a project's retained contributions against a query ("which learned
|
|
5
|
+
* memory would answer this?"), and the chat client decides which recalled memories an
|
|
6
|
+
* answer RECONCILES (restates enough of to supersede). Both must key on the SAME
|
|
7
|
+
* meaningful terms, so the tokenizer, stopword set and both rules live here, once.
|
|
8
|
+
*
|
|
9
|
+
* Pure and dependency-free: safe in a Worker, in Node, and in a browser bundle.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** Tiny code+English stopword set — dropped so recall keys on meaningful terms. */
|
|
13
|
+
export const RECALL_STOPWORDS: ReadonlySet<string> = new Set([
|
|
14
|
+
'the', 'a', 'an', 'and', 'or', 'to', 'of', 'in', 'on', 'for', 'with', 'is', 'are',
|
|
15
|
+
'be', 'as', 'at', 'by', 'it', 'this', 'that', 'from', 'you', 'your', 'i', 'we',
|
|
16
|
+
'they', 'he', 'she', 'can', 'will', 'how', 'do', 'does', 'what', 'why', 'when',
|
|
17
|
+
'which', 'use', 'using', 'used', 'please', 'need', 'want', 'me', 'my', 'so', 'if',
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
/** Lowercase, split on non-word runs, drop stopwords and 1-char tokens. */
|
|
21
|
+
export function recallTokens(text: string): string[] {
|
|
22
|
+
return (text.toLowerCase().match(/[a-z0-9_]+/g) ?? []).filter((w) => w.length >= 2 && !RECALL_STOPWORDS.has(w));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** One contribution the ranker scores (a subset of a retained-contribution entry). */
|
|
26
|
+
export interface RecallScorable {
|
|
27
|
+
id: number;
|
|
28
|
+
kind: 'text' | 'delta';
|
|
29
|
+
version: number;
|
|
30
|
+
at: number;
|
|
31
|
+
weight: number;
|
|
32
|
+
prompt?: string;
|
|
33
|
+
text?: string;
|
|
34
|
+
/** The chat that contributed this memory, when one did. Absent means project-wide. */
|
|
35
|
+
chatId?: number;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** A scored recall match — the entry plus its 0..1 lexical relevance to the query. */
|
|
39
|
+
export interface RankedEvermindRecall extends RecallScorable {
|
|
40
|
+
/** Lexical relevance to the query, 0..1 (rounded to 3 dp). */
|
|
41
|
+
score: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function termFreq(tokens: string[]): Map<string, number> {
|
|
45
|
+
const m = new Map<string, number>();
|
|
46
|
+
for (const tok of tokens) m.set(tok, (m.get(tok) ?? 0) + 1);
|
|
47
|
+
return m;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** Cosine similarity between two TF maps (0..1). Iterates the smaller map. */
|
|
51
|
+
function tfCosine(a: Map<string, number>, b: Map<string, number>): number {
|
|
52
|
+
let na = 0;
|
|
53
|
+
for (const v of a.values()) na += v * v;
|
|
54
|
+
let nb = 0;
|
|
55
|
+
for (const v of b.values()) nb += v * v;
|
|
56
|
+
if (na === 0 || nb === 0) return 0;
|
|
57
|
+
const [small, big] = a.size <= b.size ? [a, b] : [b, a];
|
|
58
|
+
let dot = 0;
|
|
59
|
+
for (const [k, v] of small) {
|
|
60
|
+
const w = big.get(k);
|
|
61
|
+
if (w) dot += v * w;
|
|
62
|
+
}
|
|
63
|
+
return dot / (Math.sqrt(na) * Math.sqrt(nb));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Below this cosine a match is noise, not recall. */
|
|
67
|
+
const MIN_RECALL_SCORE = 0.02;
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Rank contributions by lexical relevance to `query`, best first. Only entries carrying
|
|
71
|
+
* text can match (a weight delta has none); scores at or below the noise floor are
|
|
72
|
+
* dropped, and the result is capped at `limit` (default 8).
|
|
73
|
+
*/
|
|
74
|
+
export function rankEvermindRecall(
|
|
75
|
+
query: string,
|
|
76
|
+
recent: readonly RecallScorable[],
|
|
77
|
+
opts?: { limit?: number },
|
|
78
|
+
): RankedEvermindRecall[] {
|
|
79
|
+
const q = termFreq(recallTokens(query));
|
|
80
|
+
if (q.size === 0) return [];
|
|
81
|
+
const scored: RankedEvermindRecall[] = [];
|
|
82
|
+
for (const e of recent) {
|
|
83
|
+
const hay = `${e.prompt ?? ''} ${e.text ?? ''}`.trim();
|
|
84
|
+
if (!hay) continue;
|
|
85
|
+
const score = tfCosine(q, termFreq(recallTokens(hay)));
|
|
86
|
+
if (score > MIN_RECALL_SCORE) scored.push({ ...e, score: Math.round(score * 1000) / 1000 });
|
|
87
|
+
}
|
|
88
|
+
scored.sort((a, b) => b.score - a.score || b.at - a.at);
|
|
89
|
+
return scored.slice(0, Math.max(1, opts?.limit ?? 8));
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Stable, bounded (djb2, base36) hash of a recall query — keeps a cache key finite. */
|
|
93
|
+
export function hashRecallQuery(query: string): string {
|
|
94
|
+
let h = 5381;
|
|
95
|
+
for (let i = 0; i < query.length; i++) h = ((h << 5) + h + query.charCodeAt(i)) | 0;
|
|
96
|
+
return (h >>> 0).toString(36);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Fraction of a recalled memory's meaningful tokens an answer must restate for the
|
|
101
|
+
* turn to count as RECONCILING (superseding) that memory.
|
|
102
|
+
*/
|
|
103
|
+
export const RECONCILE_OVERLAP = 0.6;
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* How many recalled memories `answer` reconciles — restates enough of that the
|
|
107
|
+
* contributed turn supersedes them. A heuristic over token overlap; it surfaces the
|
|
108
|
+
* reconcile step and never gates learning.
|
|
109
|
+
*/
|
|
110
|
+
export function countReconciledMemories(items: ReadonlyArray<{ text: string }>, answer: string): number {
|
|
111
|
+
const ans = new Set(recallTokens(answer));
|
|
112
|
+
if (ans.size === 0) return 0;
|
|
113
|
+
let n = 0;
|
|
114
|
+
for (const it of items) {
|
|
115
|
+
const mem = new Set(recallTokens(it.text));
|
|
116
|
+
if (mem.size === 0) continue;
|
|
117
|
+
let hit = 0;
|
|
118
|
+
for (const tok of mem) if (ans.has(tok)) hit++;
|
|
119
|
+
if (hit / mem.size >= RECONCILE_OVERLAP) n++;
|
|
120
|
+
}
|
|
121
|
+
return n;
|
|
122
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -100,12 +100,15 @@ export type { SSMRuntimeOptions, GenerateOptions } from './runtime/SSMRuntime.js
|
|
|
100
100
|
// ── Bridges ───────────────────────────────────────────────────────────────────
|
|
101
101
|
export type { TransformerBridge, BridgeGenerateOptions } from './bridges/TransformerBridge.js';
|
|
102
102
|
export { OpenAIBridge } from './bridges/OpenAIBridge.js';
|
|
103
|
+
export { VertexAIBridge, VertexAIEmbedder } from './bridges/VertexAIBridge.js';
|
|
103
104
|
export { AnthropicBridge } from './bridges/AnthropicBridge.js';
|
|
104
105
|
export { FetchBridge } from './bridges/FetchBridge.js';
|
|
105
106
|
export { CachingBridge } from './bridges/CachingBridge.js';
|
|
106
107
|
export { SemanticCachingBridge } from './bridges/SemanticCachingBridge.js';
|
|
107
108
|
export { ResponseCache, buildCacheKey } from './bridges/ResponseCache.js';
|
|
109
|
+
export type { BridgeCallInfo } from './bridges/TransformerBridge.js';
|
|
108
110
|
export type { OpenAIBridgeOptions } from './bridges/OpenAIBridge.js';
|
|
111
|
+
export type { VertexAIBridgeOptions, VertexAIEmbedderOptions } from './bridges/VertexAIBridge.js';
|
|
109
112
|
export type { AnthropicBridgeOptions } from './bridges/AnthropicBridge.js';
|
|
110
113
|
export type { FetchBridgeOptions } from './bridges/FetchBridge.js';
|
|
111
114
|
export type { CachingBridgeOptions } from './bridges/CachingBridge.js';
|
|
@@ -130,6 +133,11 @@ export { cosineSimilarity, jaccardSimilarity, tokenize } from './similarity/inde
|
|
|
130
133
|
export {
|
|
131
134
|
chunkText,
|
|
132
135
|
bm25Search,
|
|
136
|
+
bm25Idf,
|
|
137
|
+
bm25LengthNorm,
|
|
138
|
+
bm25TermScore,
|
|
139
|
+
BM25_DEFAULT_K1,
|
|
140
|
+
BM25_DEFAULT_B,
|
|
133
141
|
reciprocalRankFusion,
|
|
134
142
|
maximalMarginalRelevance,
|
|
135
143
|
hybridRetrieve,
|
|
@@ -140,6 +148,7 @@ export type {
|
|
|
140
148
|
Bm25Doc,
|
|
141
149
|
Bm25Hit,
|
|
142
150
|
Bm25Options,
|
|
151
|
+
Bm25Tokenizer,
|
|
143
152
|
RankedList,
|
|
144
153
|
FusedHit,
|
|
145
154
|
MmrCandidate,
|
|
@@ -149,6 +158,226 @@ export type {
|
|
|
149
158
|
HybridHit,
|
|
150
159
|
} from './retrieval/index.js';
|
|
151
160
|
|
|
161
|
+
// ── Telemetry (granular tracing + LLM-native metrics + cost-per-request) ──────
|
|
162
|
+
export {
|
|
163
|
+
Tracer,
|
|
164
|
+
Span,
|
|
165
|
+
parseTraceparent,
|
|
166
|
+
formatTraceparent,
|
|
167
|
+
MetricsRegistry,
|
|
168
|
+
InstrumentedBridge,
|
|
169
|
+
InMemorySpanExporter,
|
|
170
|
+
ConsoleSpanExporter,
|
|
171
|
+
OtlpHttpSpanExporter,
|
|
172
|
+
toOtlpPayload,
|
|
173
|
+
toOtlpSpan,
|
|
174
|
+
percentile,
|
|
175
|
+
estimateCostUsd,
|
|
176
|
+
estimateTokens,
|
|
177
|
+
resolveRate,
|
|
178
|
+
DEFAULT_PRICE_BOOK,
|
|
179
|
+
ANTHROPIC_PRICE_BOOK,
|
|
180
|
+
EVERMIND_PRICE_BOOK,
|
|
181
|
+
DEFAULT_CACHE_READ_MULTIPLIER,
|
|
182
|
+
DEFAULT_CACHE_WRITE_MULTIPLIER,
|
|
183
|
+
} from './telemetry/index.js';
|
|
184
|
+
export type {
|
|
185
|
+
TracerOptions,
|
|
186
|
+
SpanOptions,
|
|
187
|
+
TraceContext,
|
|
188
|
+
SpanData,
|
|
189
|
+
SpanKind,
|
|
190
|
+
SpanStatus,
|
|
191
|
+
SpanEvent,
|
|
192
|
+
SpanExporter,
|
|
193
|
+
AttributeValue,
|
|
194
|
+
LlmUsage,
|
|
195
|
+
LlmMetricSnapshot,
|
|
196
|
+
KindMetricSnapshot,
|
|
197
|
+
MetricsRegistryOptions,
|
|
198
|
+
InstrumentedBridgeOptions,
|
|
199
|
+
ConsoleSpanExporterOptions,
|
|
200
|
+
OtlpHttpSpanExporterOptions,
|
|
201
|
+
ModelRate,
|
|
202
|
+
PriceBook,
|
|
203
|
+
} from './telemetry/index.js';
|
|
204
|
+
|
|
205
|
+
// ── Vector store (port + adapters + tenant/ACL scoping) ───────────────────────
|
|
206
|
+
export {
|
|
207
|
+
MemoryVectorStore,
|
|
208
|
+
RestVectorStore,
|
|
209
|
+
getDialect,
|
|
210
|
+
listDialects,
|
|
211
|
+
registerDialect,
|
|
212
|
+
evermindDialect,
|
|
213
|
+
qdrantDialect,
|
|
214
|
+
pineconeDialect,
|
|
215
|
+
vertexAiDialect,
|
|
216
|
+
accessFilter,
|
|
217
|
+
combineFilters,
|
|
218
|
+
matchesFilter,
|
|
219
|
+
filterFields,
|
|
220
|
+
TENANT_FIELD,
|
|
221
|
+
ACL_FIELD,
|
|
222
|
+
SENSITIVITY_FIELD,
|
|
223
|
+
ACL_PUBLIC,
|
|
224
|
+
} from './vectorstore/index.js';
|
|
225
|
+
export type {
|
|
226
|
+
MemoryVectorStoreOptions,
|
|
227
|
+
RestVectorStoreOptions,
|
|
228
|
+
VectorDialect,
|
|
229
|
+
DialectContext,
|
|
230
|
+
TranslatedFilter,
|
|
231
|
+
AccessScope,
|
|
232
|
+
ComparisonOp,
|
|
233
|
+
MetadataFilter,
|
|
234
|
+
MetadataRecord,
|
|
235
|
+
MetadataValue,
|
|
236
|
+
UpsertResult,
|
|
237
|
+
VectorMatch,
|
|
238
|
+
VectorQuery,
|
|
239
|
+
VectorRecord,
|
|
240
|
+
VectorStore,
|
|
241
|
+
} from './vectorstore/index.js';
|
|
242
|
+
|
|
243
|
+
// ── Ingestion (structured + unstructured → vector store, incremental sync) ────
|
|
244
|
+
export {
|
|
245
|
+
IngestionPipeline,
|
|
246
|
+
InMemoryIngestManifest,
|
|
247
|
+
ParserRegistry,
|
|
248
|
+
BUILTIN_PARSERS,
|
|
249
|
+
rowsParser,
|
|
250
|
+
csvParser,
|
|
251
|
+
jsonParser,
|
|
252
|
+
markdownParser,
|
|
253
|
+
htmlParser,
|
|
254
|
+
plainTextParser,
|
|
255
|
+
parseCsv,
|
|
256
|
+
serializeRow,
|
|
257
|
+
hashText,
|
|
258
|
+
mapWithConcurrency,
|
|
259
|
+
SOURCE_ID_FIELD,
|
|
260
|
+
CHUNK_INDEX_FIELD,
|
|
261
|
+
CONTENT_HASH_FIELD,
|
|
262
|
+
TITLE_FIELD,
|
|
263
|
+
URI_FIELD,
|
|
264
|
+
PARSER_FIELD,
|
|
265
|
+
} from './ingest/index.js';
|
|
266
|
+
export type {
|
|
267
|
+
IngestionPipelineOptions,
|
|
268
|
+
BatchEmbedder,
|
|
269
|
+
ChunkFingerprint,
|
|
270
|
+
DocumentParser,
|
|
271
|
+
IngestManifest,
|
|
272
|
+
IngestionReport,
|
|
273
|
+
ParsedSection,
|
|
274
|
+
SourceContent,
|
|
275
|
+
SourceDocument,
|
|
276
|
+
StructuredRow,
|
|
277
|
+
SyncStrategy,
|
|
278
|
+
} from './ingest/index.js';
|
|
279
|
+
|
|
280
|
+
// ── Enterprise RAG (hybrid, scoped, cited) ────────────────────────────────────
|
|
281
|
+
export {
|
|
282
|
+
EnterpriseRetriever,
|
|
283
|
+
buildGroundedPrompt,
|
|
284
|
+
GROUNDED_SYSTEM_PROMPT,
|
|
285
|
+
NO_EVIDENCE_ANSWER,
|
|
286
|
+
} from './rag/index.js';
|
|
287
|
+
export type {
|
|
288
|
+
EnterpriseRetrieverOptions,
|
|
289
|
+
RetrieveOptions,
|
|
290
|
+
RetrievalResult,
|
|
291
|
+
RetrievalMode,
|
|
292
|
+
RetrievedPassage,
|
|
293
|
+
Reranker,
|
|
294
|
+
} from './rag/index.js';
|
|
295
|
+
|
|
296
|
+
// ── Multi-agent orchestration (graph + ReAct/reflection/delegation) ───────────
|
|
297
|
+
export {
|
|
298
|
+
AgentGraph,
|
|
299
|
+
appendReducer,
|
|
300
|
+
mergeReducer,
|
|
301
|
+
sumReducer,
|
|
302
|
+
unionReducer,
|
|
303
|
+
InMemoryCheckpointer,
|
|
304
|
+
KeyValueCheckpointer,
|
|
305
|
+
createReactAgent,
|
|
306
|
+
createReflectionAgent,
|
|
307
|
+
createSupervisor,
|
|
308
|
+
asWorker,
|
|
309
|
+
parseReactTurn,
|
|
310
|
+
renderToolCatalog,
|
|
311
|
+
renderTranscript,
|
|
312
|
+
REACT_PROTOCOL,
|
|
313
|
+
DEFAULT_CRITIC_PROMPT,
|
|
314
|
+
FINISH,
|
|
315
|
+
START,
|
|
316
|
+
END,
|
|
317
|
+
} from './orchestration/index.js';
|
|
318
|
+
export type {
|
|
319
|
+
AgentGraphOptions,
|
|
320
|
+
RunOptions,
|
|
321
|
+
InMemoryCheckpointerOptions,
|
|
322
|
+
KeyValueCheckpointerOptions,
|
|
323
|
+
KeyValueLike,
|
|
324
|
+
AgentTool,
|
|
325
|
+
AgentTurn,
|
|
326
|
+
AgentTurnRole,
|
|
327
|
+
ParsedAction,
|
|
328
|
+
ReactAgentOptions,
|
|
329
|
+
ReactState,
|
|
330
|
+
ReflectionAgentOptions,
|
|
331
|
+
ReflectionState,
|
|
332
|
+
SupervisorOptions,
|
|
333
|
+
SupervisorState,
|
|
334
|
+
Worker,
|
|
335
|
+
ChannelReducer,
|
|
336
|
+
ChannelSpec,
|
|
337
|
+
ChannelSpecs,
|
|
338
|
+
Checkpoint,
|
|
339
|
+
Checkpointer,
|
|
340
|
+
EdgeCondition,
|
|
341
|
+
GraphEndReason,
|
|
342
|
+
GraphEvent,
|
|
343
|
+
GraphRunResult,
|
|
344
|
+
GraphState,
|
|
345
|
+
NodeContext,
|
|
346
|
+
NodeFn,
|
|
347
|
+
} from './orchestration/index.js';
|
|
348
|
+
|
|
349
|
+
// ── Evaluation (the conception → launch gate) ─────────────────────────────────
|
|
350
|
+
export {
|
|
351
|
+
EvalHarness,
|
|
352
|
+
evaluateGate,
|
|
353
|
+
formatReport,
|
|
354
|
+
exactMatch,
|
|
355
|
+
substringChecks,
|
|
356
|
+
embeddingSimilarity,
|
|
357
|
+
retrievalRecall,
|
|
358
|
+
citationValidity,
|
|
359
|
+
llmJudge,
|
|
360
|
+
noError,
|
|
361
|
+
costBudget,
|
|
362
|
+
DEFAULT_RAG_GRADERS,
|
|
363
|
+
DEFAULT_JUDGE_RUBRIC,
|
|
364
|
+
} from './eval/index.js';
|
|
365
|
+
export type {
|
|
366
|
+
EvalHarnessOptions,
|
|
367
|
+
EvalCase,
|
|
368
|
+
EvalDataset,
|
|
369
|
+
EvalGate,
|
|
370
|
+
EvalOutput,
|
|
371
|
+
EvalReport,
|
|
372
|
+
EvalTarget,
|
|
373
|
+
CaseResult,
|
|
374
|
+
GateVerdict,
|
|
375
|
+
GradeResult,
|
|
376
|
+
Grader,
|
|
377
|
+
LlmJudgeOptions,
|
|
378
|
+
SimilarityGraderOptions,
|
|
379
|
+
} from './eval/index.js';
|
|
380
|
+
|
|
152
381
|
// ── Router ────────────────────────────────────────────────────────────────────
|
|
153
382
|
export { InferenceRouter } from './router/InferenceRouter.js';
|
|
154
383
|
export type {
|
|
@@ -166,6 +395,9 @@ export type {
|
|
|
166
395
|
MemoryStoreOptions,
|
|
167
396
|
RememberOptions,
|
|
168
397
|
FactType,
|
|
398
|
+
RecallMethod,
|
|
399
|
+
ScoredMemory,
|
|
400
|
+
RankedRecall,
|
|
169
401
|
} from './memory/MemoryStore.js';
|
|
170
402
|
|
|
171
403
|
// ── Cognition (Evermind — Write-Through Cognition) ────────────────────────────
|