@psiclawops/hypermem 0.1.0 → 0.5.1
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/ARCHITECTURE.md +4 -3
- package/README.md +457 -174
- package/dist/background-indexer.d.ts +19 -4
- package/dist/background-indexer.d.ts.map +1 -1
- package/dist/background-indexer.js +329 -17
- package/dist/cache.d.ts +110 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +495 -0
- package/dist/compaction-fence.d.ts +1 -1
- package/dist/compaction-fence.js +1 -1
- package/dist/compositor.d.ts +114 -27
- package/dist/compositor.d.ts.map +1 -1
- package/dist/compositor.js +1678 -229
- package/dist/content-type-classifier.d.ts +41 -0
- package/dist/content-type-classifier.d.ts.map +1 -0
- package/dist/content-type-classifier.js +181 -0
- package/dist/cross-agent.d.ts +5 -0
- package/dist/cross-agent.d.ts.map +1 -1
- package/dist/cross-agent.js +5 -0
- package/dist/db.d.ts +1 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/db.js +6 -2
- package/dist/desired-state-store.d.ts +1 -1
- package/dist/desired-state-store.d.ts.map +1 -1
- package/dist/desired-state-store.js +15 -5
- package/dist/doc-chunk-store.d.ts +26 -1
- package/dist/doc-chunk-store.d.ts.map +1 -1
- package/dist/doc-chunk-store.js +114 -1
- package/dist/doc-chunker.d.ts +1 -1
- package/dist/doc-chunker.js +1 -1
- package/dist/dreaming-promoter.d.ts +86 -0
- package/dist/dreaming-promoter.d.ts.map +1 -0
- package/dist/dreaming-promoter.js +381 -0
- package/dist/episode-store.d.ts +2 -1
- package/dist/episode-store.d.ts.map +1 -1
- package/dist/episode-store.js +4 -4
- package/dist/fact-store.d.ts +19 -1
- package/dist/fact-store.d.ts.map +1 -1
- package/dist/fact-store.js +64 -3
- package/dist/fleet-store.d.ts +1 -1
- package/dist/fleet-store.js +1 -1
- package/dist/fos-mod.d.ts +178 -0
- package/dist/fos-mod.d.ts.map +1 -0
- package/dist/fos-mod.js +416 -0
- package/dist/hybrid-retrieval.d.ts +5 -1
- package/dist/hybrid-retrieval.d.ts.map +1 -1
- package/dist/hybrid-retrieval.js +7 -3
- package/dist/image-eviction.d.ts +49 -0
- package/dist/image-eviction.d.ts.map +1 -0
- package/dist/image-eviction.js +251 -0
- package/dist/index.d.ts +50 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +73 -43
- package/dist/keystone-scorer.d.ts +51 -0
- package/dist/keystone-scorer.d.ts.map +1 -0
- package/dist/keystone-scorer.js +52 -0
- package/dist/knowledge-graph.d.ts +1 -1
- package/dist/knowledge-graph.js +1 -1
- package/dist/knowledge-lint.d.ts +29 -0
- package/dist/knowledge-lint.d.ts.map +1 -0
- package/dist/knowledge-lint.js +116 -0
- package/dist/knowledge-store.d.ts +1 -1
- package/dist/knowledge-store.d.ts.map +1 -1
- package/dist/knowledge-store.js +8 -2
- package/dist/library-schema.d.ts +3 -3
- package/dist/library-schema.d.ts.map +1 -1
- package/dist/library-schema.js +324 -3
- package/dist/message-store.d.ts +15 -2
- package/dist/message-store.d.ts.map +1 -1
- package/dist/message-store.js +51 -1
- package/dist/metrics-dashboard.d.ts +114 -0
- package/dist/metrics-dashboard.d.ts.map +1 -0
- package/dist/metrics-dashboard.js +260 -0
- package/dist/obsidian-exporter.d.ts +57 -0
- package/dist/obsidian-exporter.d.ts.map +1 -0
- package/dist/obsidian-exporter.js +274 -0
- package/dist/obsidian-watcher.d.ts +147 -0
- package/dist/obsidian-watcher.d.ts.map +1 -0
- package/dist/obsidian-watcher.js +403 -0
- package/dist/open-domain.d.ts +46 -0
- package/dist/open-domain.d.ts.map +1 -0
- package/dist/open-domain.js +125 -0
- package/dist/preference-store.d.ts +1 -1
- package/dist/preference-store.js +1 -1
- package/dist/preservation-gate.d.ts +1 -1
- package/dist/preservation-gate.js +1 -1
- package/dist/proactive-pass.d.ts +63 -0
- package/dist/proactive-pass.d.ts.map +1 -0
- package/dist/proactive-pass.js +239 -0
- package/dist/profiles.d.ts +44 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +227 -0
- package/dist/provider-translator.d.ts +13 -3
- package/dist/provider-translator.d.ts.map +1 -1
- package/dist/provider-translator.js +63 -9
- package/dist/rate-limiter.d.ts +1 -1
- package/dist/rate-limiter.js +1 -1
- package/dist/repair-tool-pairs.d.ts +38 -0
- package/dist/repair-tool-pairs.d.ts.map +1 -0
- package/dist/repair-tool-pairs.js +138 -0
- package/dist/retrieval-policy.d.ts +51 -0
- package/dist/retrieval-policy.d.ts.map +1 -0
- package/dist/retrieval-policy.js +77 -0
- package/dist/schema.d.ts +2 -2
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +28 -2
- package/dist/secret-scanner.d.ts +1 -1
- package/dist/secret-scanner.js +1 -1
- package/dist/seed.d.ts +2 -2
- package/dist/seed.js +2 -2
- package/dist/session-flusher.d.ts +53 -0
- package/dist/session-flusher.d.ts.map +1 -0
- package/dist/session-flusher.js +69 -0
- package/dist/session-topic-map.d.ts +41 -0
- package/dist/session-topic-map.d.ts.map +1 -0
- package/dist/session-topic-map.js +77 -0
- package/dist/spawn-context.d.ts +54 -0
- package/dist/spawn-context.d.ts.map +1 -0
- package/dist/spawn-context.js +159 -0
- package/dist/system-store.d.ts +1 -1
- package/dist/system-store.js +1 -1
- package/dist/temporal-store.d.ts +80 -0
- package/dist/temporal-store.d.ts.map +1 -0
- package/dist/temporal-store.js +149 -0
- package/dist/topic-detector.d.ts +35 -0
- package/dist/topic-detector.d.ts.map +1 -0
- package/dist/topic-detector.js +249 -0
- package/dist/topic-store.d.ts +1 -1
- package/dist/topic-store.js +1 -1
- package/dist/topic-synthesizer.d.ts +51 -0
- package/dist/topic-synthesizer.d.ts.map +1 -0
- package/dist/topic-synthesizer.js +315 -0
- package/dist/trigger-registry.d.ts +63 -0
- package/dist/trigger-registry.d.ts.map +1 -0
- package/dist/trigger-registry.js +163 -0
- package/dist/types.d.ts +214 -10
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +1 -1
- package/dist/vector-store.d.ts +43 -5
- package/dist/vector-store.d.ts.map +1 -1
- package/dist/vector-store.js +189 -10
- package/dist/version.d.ts +34 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +34 -0
- package/dist/wiki-page-emitter.d.ts +65 -0
- package/dist/wiki-page-emitter.d.ts.map +1 -0
- package/dist/wiki-page-emitter.js +258 -0
- package/dist/work-store.d.ts +1 -1
- package/dist/work-store.js +1 -1
- package/package.json +15 -5
- package/dist/redis.d.ts +0 -188
- package/dist/redis.d.ts.map +0 -1
- package/dist/redis.js +0 -534
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* hypermem Core Types
|
|
3
3
|
*
|
|
4
4
|
* Provider-neutral message format and compositor interfaces.
|
|
5
5
|
* These types are the internal representation — never sent directly to an LLM.
|
|
@@ -159,6 +159,16 @@ export interface Episode {
|
|
|
159
159
|
createdAt: string;
|
|
160
160
|
decayScore: number;
|
|
161
161
|
}
|
|
162
|
+
/**
|
|
163
|
+
* A single turn from a parent session, stripped of tool call content.
|
|
164
|
+
* Used to build spawn context for subagents.
|
|
165
|
+
*/
|
|
166
|
+
export interface RecentTurn {
|
|
167
|
+
role: 'user' | 'assistant';
|
|
168
|
+
content: string;
|
|
169
|
+
timestamp: number;
|
|
170
|
+
seq: number;
|
|
171
|
+
}
|
|
162
172
|
export interface ComposeRequest {
|
|
163
173
|
agentId: string;
|
|
164
174
|
sessionKey: string;
|
|
@@ -183,12 +193,27 @@ export interface ComposeRequest {
|
|
|
183
193
|
* meaning first-turn retrieval is blind and all retrieval lags by one turn.
|
|
184
194
|
*/
|
|
185
195
|
prompt?: string;
|
|
196
|
+
/**
|
|
197
|
+
* When set, session-scoped doc chunks stored under this spawn session key
|
|
198
|
+
* are included in doc chunk retrieval at compose time.
|
|
199
|
+
* Used for subagent context inheritance: the parent buildSpawnContext() stores
|
|
200
|
+
* document chunks under a spawn sessionKey, and passes that key here so the
|
|
201
|
+
* compositor can surface them during composition.
|
|
202
|
+
*/
|
|
203
|
+
parentSessionKey?: string;
|
|
186
204
|
/**
|
|
187
205
|
* When true, skip provider-specific translation and return NeutralMessage[]
|
|
188
206
|
* instead of ProviderMessage[]. Used by the context engine plugin, which
|
|
189
207
|
* returns messages to the OpenClaw runtime for its own provider translation.
|
|
190
208
|
*/
|
|
191
209
|
skipProviderTranslation?: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* When set, history fetching is scoped to this topic (Option B: also includes
|
|
212
|
+
* legacy messages with topic_id IS NULL for transition safety).
|
|
213
|
+
* If not provided, full session history is returned (no behavior change).
|
|
214
|
+
* P3.4: topic-aware compositor.
|
|
215
|
+
*/
|
|
216
|
+
topicId?: string;
|
|
192
217
|
}
|
|
193
218
|
export interface SlotTokenCounts {
|
|
194
219
|
system: number;
|
|
@@ -198,6 +223,42 @@ export interface SlotTokenCounts {
|
|
|
198
223
|
context: number;
|
|
199
224
|
library: number;
|
|
200
225
|
}
|
|
226
|
+
/**
|
|
227
|
+
* Compose-level diagnostics — emitted on every compose() call.
|
|
228
|
+
* Useful for observability, tuning, and debugging retrieval quality.
|
|
229
|
+
*/
|
|
230
|
+
export interface ComposeDiagnostics {
|
|
231
|
+
/** Number of doc chunk trigger collections that matched the user message */
|
|
232
|
+
triggerHits: number;
|
|
233
|
+
/** True when trigger-miss fallback semantic retrieval was used */
|
|
234
|
+
triggerFallbackUsed: boolean;
|
|
235
|
+
/** Number of facts included after scope filtering */
|
|
236
|
+
factsIncluded: number;
|
|
237
|
+
/** Approximate number of lines returned by semantic recall */
|
|
238
|
+
semanticResultsIncluded: number;
|
|
239
|
+
/** Number of doc chunk collections that returned at least one chunk */
|
|
240
|
+
docChunksCollections: number;
|
|
241
|
+
/** Number of items rejected by scope policy during retrieval */
|
|
242
|
+
scopeFiltered: number;
|
|
243
|
+
/**
|
|
244
|
+
* Why contextParts was empty (only set when no context was assembled).
|
|
245
|
+
* Helps distinguish between "no triggers + no fallback", "empty corpus",
|
|
246
|
+
* "budget exhausted", and "all items filtered by scope".
|
|
247
|
+
*/
|
|
248
|
+
zeroResultReason?: 'no_trigger_no_fallback' | 'empty_corpus' | 'budget_exhausted' | 'scope_filtered_all' | 'unknown';
|
|
249
|
+
/** The retrieval path that was used for doc chunks */
|
|
250
|
+
retrievalMode: 'triggered' | 'fallback_knn' | 'fallback_fts' | 'none';
|
|
251
|
+
/** Number of cross-topic keystone messages injected (P3.5) */
|
|
252
|
+
crossTopicKeystones?: number;
|
|
253
|
+
/** Actual reserve fraction used this compose (base or dynamic) */
|
|
254
|
+
reserveFraction?: number;
|
|
255
|
+
/** Estimated average turn cost (tokens) used in dynamic reserve calc */
|
|
256
|
+
avgTurnCostTokens?: number;
|
|
257
|
+
/** True if dynamic reserve exceeded floor and is actively adjusting budget */
|
|
258
|
+
dynamicReserveActive?: boolean;
|
|
259
|
+
/** True if dynamic reserve was clamped at dynamicReserveMax and SESSION_PRESSURE_HIGH emitted */
|
|
260
|
+
sessionPressureHigh?: boolean;
|
|
261
|
+
}
|
|
201
262
|
export interface ComposeResult {
|
|
202
263
|
messages: ProviderMessage[];
|
|
203
264
|
tokenCount: number;
|
|
@@ -213,6 +274,8 @@ export interface ComposeResult {
|
|
|
213
274
|
* Omitted when no context was assembled.
|
|
214
275
|
*/
|
|
215
276
|
contextBlock?: string;
|
|
277
|
+
/** Compose-level diagnostics for observability and tuning. */
|
|
278
|
+
diagnostics?: ComposeDiagnostics;
|
|
216
279
|
}
|
|
217
280
|
/**
|
|
218
281
|
* Provider-specific message format (output of compositor).
|
|
@@ -266,37 +329,76 @@ export interface SessionMeta {
|
|
|
266
329
|
export interface HyperMemConfig {
|
|
267
330
|
enabled: boolean;
|
|
268
331
|
dataDir: string;
|
|
269
|
-
|
|
332
|
+
cache: CacheConfig;
|
|
270
333
|
compositor: CompositorConfig;
|
|
271
334
|
indexer: IndexerConfig;
|
|
272
335
|
embedding: EmbeddingProviderConfig;
|
|
336
|
+
/** Optional dreaming/promotion config. Default: disabled. */
|
|
337
|
+
dreaming?: import('./dreaming-promoter.js').DreamerConfig;
|
|
338
|
+
/** Optional Obsidian vault integration. Default: disabled. */
|
|
339
|
+
obsidian?: import('./obsidian-watcher.js').ObsidianConfig;
|
|
340
|
+
/**
|
|
341
|
+
* Cache replay threshold (ms). When > 0, assemble() returns a cached
|
|
342
|
+
* contextBlock (systemPromptAddition) for sessions active within this
|
|
343
|
+
* window, producing byte-identical prompts and hitting provider prefix cache
|
|
344
|
+
* (Anthropic / OpenAI). Set to 0 to disable.
|
|
345
|
+
* Default: 900_000 (15 minutes).
|
|
346
|
+
*/
|
|
347
|
+
warmCacheReplayThresholdMs?: number;
|
|
273
348
|
}
|
|
274
349
|
export interface EmbeddingProviderConfig {
|
|
350
|
+
/**
|
|
351
|
+
* Embedding provider. Default: 'ollama'.
|
|
352
|
+
* - 'ollama': local Ollama (nomic-embed-text or any pulled model)
|
|
353
|
+
* - 'openai': OpenAI Embeddings API (text-embedding-3-small / 3-large)
|
|
354
|
+
*/
|
|
355
|
+
provider?: 'ollama' | 'openai';
|
|
275
356
|
/** Ollama base URL. Default: http://localhost:11434 */
|
|
276
357
|
ollamaUrl: string;
|
|
277
|
-
/**
|
|
358
|
+
/** OpenAI API key. Required when provider is 'openai'. */
|
|
359
|
+
openaiApiKey?: string;
|
|
360
|
+
/** OpenAI base URL. Default: https://api.openai.com/v1 */
|
|
361
|
+
openaiBaseUrl?: string;
|
|
362
|
+
/**
|
|
363
|
+
* Embedding model name.
|
|
364
|
+
* - ollama default: nomic-embed-text (768d)
|
|
365
|
+
* - openai default: text-embedding-3-small (1536d)
|
|
366
|
+
*/
|
|
278
367
|
model: string;
|
|
279
|
-
/**
|
|
368
|
+
/**
|
|
369
|
+
* Embedding dimensions. Must match the model.
|
|
370
|
+
* - nomic-embed-text: 768
|
|
371
|
+
* - text-embedding-3-small: 1536
|
|
372
|
+
* - text-embedding-3-large: 3072
|
|
373
|
+
* WARNING: changing providers requires a full re-index (dimensions are incompatible).
|
|
374
|
+
*/
|
|
280
375
|
dimensions: number;
|
|
281
376
|
/** Request timeout ms. Default: 10000 */
|
|
282
377
|
timeout: number;
|
|
283
|
-
/** Max texts per batch request. Default: 32 */
|
|
378
|
+
/** Max texts per batch request. Default: 32 (ollama) or 128 (openai) */
|
|
284
379
|
batchSize: number;
|
|
285
380
|
}
|
|
286
|
-
export interface
|
|
287
|
-
host: string;
|
|
288
|
-
port: number;
|
|
289
|
-
password?: string;
|
|
381
|
+
export interface CacheConfig {
|
|
290
382
|
keyPrefix: string;
|
|
291
383
|
sessionTTL: number;
|
|
292
384
|
historyTTL: number;
|
|
293
|
-
flushInterval: number;
|
|
294
385
|
}
|
|
386
|
+
/** @deprecated Use CacheConfig */
|
|
387
|
+
export type RedisConfig = CacheConfig;
|
|
295
388
|
export interface CompositorConfig {
|
|
296
389
|
defaultTokenBudget: number;
|
|
297
390
|
maxHistoryMessages: number;
|
|
298
391
|
maxFacts: number;
|
|
299
392
|
maxCrossSessionContext: number;
|
|
393
|
+
/**
|
|
394
|
+
* Aggregate token ceiling across all trigger-fired doc chunk collections in a
|
|
395
|
+
* single compose pass. When unset, hypermem uses a dynamic ceiling of 40% of
|
|
396
|
+
* the remaining budget at the start of trigger retrieval.
|
|
397
|
+
*
|
|
398
|
+
* This prevents pathological prompts from firing many trigger collections at
|
|
399
|
+
* once and starving the rest of the prompt budget.
|
|
400
|
+
*/
|
|
401
|
+
maxTotalTriggerTokens?: number;
|
|
300
402
|
/**
|
|
301
403
|
* How many recent tool call/result pairs to keep verbatim in history.
|
|
302
404
|
* Tool call/result content beyond this threshold gets prose-stub treatment.
|
|
@@ -316,6 +418,106 @@ export interface CompositorConfig {
|
|
|
316
418
|
* Default: 0.4 (40% of defaultTokenBudget)
|
|
317
419
|
*/
|
|
318
420
|
warmHistoryBudgetFraction: number;
|
|
421
|
+
/**
|
|
422
|
+
* Fraction of the model context window to reserve for output tokens and
|
|
423
|
+
* hypermem operational overhead. The compositor's effective input budget is
|
|
424
|
+
* (contextWindow × (1 - contextWindowReserve)).
|
|
425
|
+
*
|
|
426
|
+
* Higher values = more headroom for large operations, fewer turns before
|
|
427
|
+
* session break. Lower values = more context available, higher saturation risk.
|
|
428
|
+
*
|
|
429
|
+
* Default: 0.25 (25% reserve — leaves 75% for input context)
|
|
430
|
+
* Previous default was 0.10 (10% reserve).
|
|
431
|
+
*/
|
|
432
|
+
contextWindowReserve?: number;
|
|
433
|
+
/**
|
|
434
|
+
* Number of turns to project forward when computing dynamic reserve.
|
|
435
|
+
* safety_tokens = avg_turn_cost × dynamicReserveTurnHorizon
|
|
436
|
+
* Default: 5
|
|
437
|
+
*/
|
|
438
|
+
dynamicReserveTurnHorizon?: number;
|
|
439
|
+
/**
|
|
440
|
+
* Hard ceiling on the dynamic reserve fraction. When the projected safety
|
|
441
|
+
* tokens would push reserve above this, SESSION_PRESSURE_HIGH is emitted
|
|
442
|
+
* in diagnostics and reserve is clamped here.
|
|
443
|
+
* Default: 0.50
|
|
444
|
+
*/
|
|
445
|
+
dynamicReserveMax?: number;
|
|
446
|
+
/**
|
|
447
|
+
* Kill switch for dynamic reserve. Set false to use fixed contextWindowReserve only.
|
|
448
|
+
* Default: true
|
|
449
|
+
*/
|
|
450
|
+
dynamicReserveEnabled?: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Fraction of history token budget to allocate for keystone (recalled older) messages.
|
|
453
|
+
* Range: 0.0–0.5. Default: 0.2 (20% of history budget).
|
|
454
|
+
* Set to 0 to disable keystone injection.
|
|
455
|
+
*/
|
|
456
|
+
keystoneHistoryFraction?: number;
|
|
457
|
+
/**
|
|
458
|
+
* Maximum number of keystone messages to inject.
|
|
459
|
+
* Default: 15
|
|
460
|
+
*/
|
|
461
|
+
keystoneMaxMessages?: number;
|
|
462
|
+
/**
|
|
463
|
+
* Minimum episode significance for a message to be considered as a keystone.
|
|
464
|
+
* Only applies when episode significance is available (not null).
|
|
465
|
+
* Default: 0.5
|
|
466
|
+
*/
|
|
467
|
+
keystoneMinSignificance?: number;
|
|
468
|
+
/**
|
|
469
|
+
* Fraction of the effective token budget to target for context assembly.
|
|
470
|
+
* The compositor fills slots until this fraction is consumed, leaving the
|
|
471
|
+
* remainder for conversation history and response headroom.
|
|
472
|
+
*
|
|
473
|
+
* Lower values = lighter context, faster turns, less memory surfaced.
|
|
474
|
+
* Higher values = richer context, more memory, higher saturation risk.
|
|
475
|
+
*
|
|
476
|
+
* Range: 0.3–0.85. Default: 0.65
|
|
477
|
+
* Typical lightweight config: 0.45
|
|
478
|
+
* Typical fleet/multi-agent config: 0.65
|
|
479
|
+
*/
|
|
480
|
+
targetBudgetFraction?: number;
|
|
481
|
+
/**
|
|
482
|
+
* Enable Fleet Output Standard (FOS) injection.
|
|
483
|
+
* FOS injects shared output rules (no em dashes, lead with answer, etc.) into
|
|
484
|
+
* every composed context. Disable if the operator manages output standards
|
|
485
|
+
* externally (e.g. via system prompt) to avoid redundancy.
|
|
486
|
+
* Default: true
|
|
487
|
+
*/
|
|
488
|
+
enableFOS?: boolean;
|
|
489
|
+
/**
|
|
490
|
+
* Enable Model Output Directive (MOD) injection.
|
|
491
|
+
* MOD injects per-model calibration corrections (verbosity, list length, etc.).
|
|
492
|
+
* Disable if you want raw model behavior without hypermem calibration.
|
|
493
|
+
* Default: true
|
|
494
|
+
*/
|
|
495
|
+
enableMOD?: boolean;
|
|
496
|
+
/**
|
|
497
|
+
* Output profile tier. Controls what FOS content is injected.
|
|
498
|
+
*
|
|
499
|
+
* 'light' — ~100 token standalone directives. No MOD, no fleet concepts.
|
|
500
|
+
* Works on any single-agent 64k setup. No DB required.
|
|
501
|
+
* 'standard' — Full FOS: density targets, format rules, compression ratios,
|
|
502
|
+
* task-context scoping. No MOD.
|
|
503
|
+
* 'full' — FOS + MOD. Cross-agent coordination, full spec.
|
|
504
|
+
*
|
|
505
|
+
* Backward compat: 'starter' maps to 'light', 'fleet' maps to 'full'.
|
|
506
|
+
* Default: 'full' (backward-compatible). New install default: 'light'.
|
|
507
|
+
*/
|
|
508
|
+
outputProfile?: 'light' | 'standard' | 'full' | 'starter' | 'fleet';
|
|
509
|
+
/** @deprecated Use outputProfile */
|
|
510
|
+
outputStandard?: 'light' | 'standard' | 'full' | 'starter' | 'fleet';
|
|
511
|
+
/**
|
|
512
|
+
* Hard token ceiling for wiki page injection per compose pass.
|
|
513
|
+
* Limits how much synthesized topic knowledge is inserted into context.
|
|
514
|
+
* Lower values keep context lighter; higher values surface more topic depth.
|
|
515
|
+
*
|
|
516
|
+
* Default: 600 tokens
|
|
517
|
+
* Light preset: 300 tokens
|
|
518
|
+
* Extended preset: 800 tokens
|
|
519
|
+
*/
|
|
520
|
+
wikiTokenCap?: number;
|
|
319
521
|
}
|
|
320
522
|
export interface IndexerConfig {
|
|
321
523
|
enabled: boolean;
|
|
@@ -325,5 +527,7 @@ export interface IndexerConfig {
|
|
|
325
527
|
factDecayRate: number;
|
|
326
528
|
episodeSignificanceThreshold: number;
|
|
327
529
|
periodicInterval: number;
|
|
530
|
+
batchSize: number;
|
|
531
|
+
maxMessagesPerTick: number;
|
|
328
532
|
}
|
|
329
533
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE1D;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAA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|
2
|
-
*
|
|
2
|
+
* hypermem Vector Store — Semantic Search via sqlite-vec
|
|
3
3
|
*
|
|
4
4
|
* Provides embedding-backed KNN search over facts, knowledge, episodes,
|
|
5
5
|
* and session registry entries. Uses Ollama (local) for embeddings,
|
|
@@ -9,21 +9,34 @@
|
|
|
9
9
|
* - One vec0 virtual table per indexed content type
|
|
10
10
|
* - Embeddings generated via local Ollama (nomic-embed-text, 768d)
|
|
11
11
|
* - Vectors stored alongside content in the same agent DB
|
|
12
|
-
* -
|
|
12
|
+
* - LRU embedding cache (module-level, per-process) to avoid redundant Ollama calls
|
|
13
|
+
* - Precomputed embedding passthrough: callers can supply an embedding to skip Ollama
|
|
13
14
|
* - Batch embedding support for bulk indexing
|
|
14
15
|
*/
|
|
15
16
|
import type { DatabaseSync } from 'node:sqlite';
|
|
16
17
|
export interface EmbeddingConfig {
|
|
18
|
+
/**
|
|
19
|
+
* Embedding provider. Default: 'ollama'.
|
|
20
|
+
* - 'ollama': local Ollama instance (nomic-embed-text or any pull'd model)
|
|
21
|
+
* - 'openai': OpenAI Embeddings API (text-embedding-3-small / 3-large)
|
|
22
|
+
*/
|
|
23
|
+
provider?: 'ollama' | 'openai';
|
|
17
24
|
/** Ollama base URL. Default: http://localhost:11434 */
|
|
18
25
|
ollamaUrl: string;
|
|
19
|
-
/**
|
|
26
|
+
/** OpenAI API key. Required when provider is 'openai'. */
|
|
27
|
+
openaiApiKey?: string;
|
|
28
|
+
/** OpenAI base URL. Default: https://api.openai.com/v1 */
|
|
29
|
+
openaiBaseUrl?: string;
|
|
30
|
+
/** Embedding model name. Default: nomic-embed-text (ollama) or text-embedding-3-small (openai) */
|
|
20
31
|
model: string;
|
|
21
|
-
/** Embedding dimensions. Default: 768 */
|
|
32
|
+
/** Embedding dimensions. Default: 768 (ollama/nomic) or 1536 (openai/3-small) */
|
|
22
33
|
dimensions: number;
|
|
23
34
|
/** Request timeout ms. Default: 10000 */
|
|
24
35
|
timeout: number;
|
|
25
|
-
/** Max texts per batch request. Default: 32 */
|
|
36
|
+
/** Max texts per batch request. Default: 32 (ollama) or 128 (openai) */
|
|
26
37
|
batchSize: number;
|
|
38
|
+
/** LRU cache max entries. Default: 128 */
|
|
39
|
+
cacheSize?: number;
|
|
27
40
|
}
|
|
28
41
|
export interface VectorSearchResult {
|
|
29
42
|
rowid: number;
|
|
@@ -40,9 +53,14 @@ export interface VectorIndexStats {
|
|
|
40
53
|
tableBreakdown: Record<string, number>;
|
|
41
54
|
lastIndexedAt: string | null;
|
|
42
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* Clear the embedding cache. Primarily for testing.
|
|
58
|
+
*/
|
|
59
|
+
export declare function clearEmbeddingCache(): void;
|
|
43
60
|
/**
|
|
44
61
|
* Generate embeddings via Ollama API.
|
|
45
62
|
* Supports single and batch embedding.
|
|
63
|
+
* Results are cached per text hash — cache hits skip the Ollama call entirely.
|
|
46
64
|
*/
|
|
47
65
|
export declare function generateEmbeddings(texts: string[], config?: EmbeddingConfig): Promise<Float32Array[]>;
|
|
48
66
|
/**
|
|
@@ -84,11 +102,16 @@ export declare class VectorStore {
|
|
|
84
102
|
}>;
|
|
85
103
|
/**
|
|
86
104
|
* Semantic KNN search across one or all vector tables.
|
|
105
|
+
*
|
|
106
|
+
* @param precomputedEmbedding — optional pre-computed embedding for the query.
|
|
107
|
+
* When provided, skips the Ollama call entirely. The precomputed embedding
|
|
108
|
+
* is still inserted into the LRU cache so subsequent identical queries hit.
|
|
87
109
|
*/
|
|
88
110
|
search(query: string, opts?: {
|
|
89
111
|
tables?: string[];
|
|
90
112
|
limit?: number;
|
|
91
113
|
maxDistance?: number;
|
|
114
|
+
precomputedEmbedding?: Float32Array;
|
|
92
115
|
}): Promise<VectorSearchResult[]>;
|
|
93
116
|
/**
|
|
94
117
|
* Get content from a source table by id.
|
|
@@ -106,6 +129,21 @@ export declare class VectorStore {
|
|
|
106
129
|
* Remove vector index entries for deleted source rows.
|
|
107
130
|
*/
|
|
108
131
|
pruneOrphans(): number;
|
|
132
|
+
/**
|
|
133
|
+
* Remove the vector index entry for a single source item.
|
|
134
|
+
*
|
|
135
|
+
* Deletes both the vec table row and the vec_index_map entry for the given
|
|
136
|
+
* (sourceTable, sourceId) pair. Used by the background indexer for immediate
|
|
137
|
+
* point-in-time removal when a supersedes relationship is detected.
|
|
138
|
+
*
|
|
139
|
+
* @returns true if an entry was found and removed, false if nothing was indexed.
|
|
140
|
+
*/
|
|
141
|
+
removeItem(sourceTable: string, sourceId: number): boolean;
|
|
142
|
+
/**
|
|
143
|
+
* Check whether a source item already has a vector in the index.
|
|
144
|
+
* Used by the episode backfill to skip already-vectorized entries.
|
|
145
|
+
*/
|
|
146
|
+
hasItem(sourceTable: string, sourceId: number): boolean;
|
|
109
147
|
/**
|
|
110
148
|
* Tombstone vector entries for superseded facts and knowledge.
|
|
111
149
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vector-store.d.ts","sourceRoot":"","sources":["../src/vector-store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vector-store.d.ts","sourceRoot":"","sources":["../src/vector-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAiB,MAAM,aAAa,CAAC;AAG/D,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC/B,uDAAuD;IACvD,SAAS,EAAE,MAAM,CAAC;IAClB,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kGAAkG;IAClG,KAAK,EAAE,MAAM,CAAC;IACd,iFAAiF;IACjF,UAAU,EAAE,MAAM,CAAC;IACnB,yCAAyC;IACzC,OAAO,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,0CAA0C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