@atomicmemory/core 1.0.0
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/CHANGELOG.md +27 -0
- package/LICENSE +201 -0
- package/README.md +314 -0
- package/dist/app/bind-ephemeral.d.ts +18 -0
- package/dist/app/bind-ephemeral.js +22 -0
- package/dist/app/cors-headers.d.ts +12 -0
- package/dist/app/cors-headers.js +18 -0
- package/dist/app/create-app.d.ts +25 -0
- package/dist/app/create-app.js +156 -0
- package/dist/app/runtime-config-route-snapshot.d.ts +27 -0
- package/dist/app/runtime-config-route-snapshot.js +27 -0
- package/dist/app/runtime-container.d.ts +281 -0
- package/dist/app/runtime-container.js +297 -0
- package/dist/app/startup-checks.d.ts +28 -0
- package/dist/app/startup-checks.js +45 -0
- package/dist/bin.d.ts +17 -0
- package/dist/bin.js +128 -0
- package/dist/config.d.ts +680 -0
- package/dist/config.js +808 -0
- package/dist/db/agent-trust-repository.d.ts +49 -0
- package/dist/db/agent-trust-repository.js +66 -0
- package/dist/db/belief-edges-repository.d.ts +68 -0
- package/dist/db/belief-edges-repository.js +124 -0
- package/dist/db/claim-repository.d.ts +6 -0
- package/dist/db/claim-repository.js +4 -0
- package/dist/db/contradictions-repository.d.ts +56 -0
- package/dist/db/contradictions-repository.js +88 -0
- package/dist/db/document-chunk-repository.d.ts +48 -0
- package/dist/db/document-chunk-repository.js +145 -0
- package/dist/db/document-chunk-types.d.ts +35 -0
- package/dist/db/document-chunk-types.js +9 -0
- package/dist/db/document-list-cursor.d.ts +45 -0
- package/dist/db/document-list-cursor.js +111 -0
- package/dist/db/document-list-repository.d.ts +103 -0
- package/dist/db/document-list-repository.js +204 -0
- package/dist/db/entity-cards-repository.d.ts +37 -0
- package/dist/db/entity-cards-repository.js +46 -0
- package/dist/db/entity-values-repository.d.ts +26 -0
- package/dist/db/entity-values-repository.js +57 -0
- package/dist/db/link-repository.d.ts +30 -0
- package/dist/db/link-repository.js +54 -0
- package/dist/db/memory-repository.d.ts +163 -0
- package/dist/db/memory-repository.js +232 -0
- package/dist/db/migrate.d.ts +6 -0
- package/dist/db/migrate.js +36 -0
- package/dist/db/mmr.d.ts +14 -0
- package/dist/db/mmr.js +57 -0
- package/dist/db/passport-feed-repository.d.ts +91 -0
- package/dist/db/passport-feed-repository.js +198 -0
- package/dist/db/pg-episode-store.d.ts +19 -0
- package/dist/db/pg-episode-store.js +17 -0
- package/dist/db/pg-link-store.d.ts +17 -0
- package/dist/db/pg-link-store.js +14 -0
- package/dist/db/pg-memory-store.d.ts +68 -0
- package/dist/db/pg-memory-store.js +53 -0
- package/dist/db/pg-recap-store.d.ts +13 -0
- package/dist/db/pg-recap-store.js +19 -0
- package/dist/db/pg-representation-store.d.ts +17 -0
- package/dist/db/pg-representation-store.js +17 -0
- package/dist/db/pg-search-store.d.ts +29 -0
- package/dist/db/pg-search-store.js +47 -0
- package/dist/db/pool.d.ts +5 -0
- package/dist/db/pool.js +21 -0
- package/dist/db/ppr.d.ts +56 -0
- package/dist/db/ppr.js +178 -0
- package/dist/db/query-helpers.d.ts +44 -0
- package/dist/db/query-helpers.js +60 -0
- package/dist/db/raw-doc-artifact-sync.d.ts +128 -0
- package/dist/db/raw-doc-artifact-sync.js +259 -0
- package/dist/db/raw-document-blob-repository.d.ts +148 -0
- package/dist/db/raw-document-blob-repository.js +300 -0
- package/dist/db/raw-document-repository.d.ts +104 -0
- package/dist/db/raw-document-repository.js +410 -0
- package/dist/db/raw-document-status-repository.d.ts +122 -0
- package/dist/db/raw-document-status-repository.js +183 -0
- package/dist/db/raw-document-types.d.ts +236 -0
- package/dist/db/raw-document-types.js +10 -0
- package/dist/db/raw-storage-reconciliation-repository.d.ts +110 -0
- package/dist/db/raw-storage-reconciliation-repository.js +200 -0
- package/dist/db/reflection-jobs-repository.d.ts +33 -0
- package/dist/db/reflection-jobs-repository.js +48 -0
- package/dist/db/reflections-repository.d.ts +41 -0
- package/dist/db/reflections-repository.js +83 -0
- package/dist/db/repository-claims.d.ts +141 -0
- package/dist/db/repository-claims.js +376 -0
- package/dist/db/repository-deferred-audn.d.ts +33 -0
- package/dist/db/repository-deferred-audn.js +69 -0
- package/dist/db/repository-document-delete.d.ts +53 -0
- package/dist/db/repository-document-delete.js +156 -0
- package/dist/db/repository-entities.d.ts +114 -0
- package/dist/db/repository-entities.js +317 -0
- package/dist/db/repository-entity-attributes.d.ts +41 -0
- package/dist/db/repository-entity-attributes.js +65 -0
- package/dist/db/repository-entity-graph.d.ts +32 -0
- package/dist/db/repository-entity-graph.js +87 -0
- package/dist/db/repository-first-mentions.d.ts +41 -0
- package/dist/db/repository-first-mentions.js +79 -0
- package/dist/db/repository-lessons.d.ts +51 -0
- package/dist/db/repository-lessons.js +90 -0
- package/dist/db/repository-links.d.ts +26 -0
- package/dist/db/repository-links.js +105 -0
- package/dist/db/repository-observation.d.ts +26 -0
- package/dist/db/repository-observation.js +51 -0
- package/dist/db/repository-read.d.ts +56 -0
- package/dist/db/repository-read.js +271 -0
- package/dist/db/repository-recaps.d.ts +59 -0
- package/dist/db/repository-recaps.js +158 -0
- package/dist/db/repository-representations.d.ts +48 -0
- package/dist/db/repository-representations.js +162 -0
- package/dist/db/repository-temporal-state.d.ts +35 -0
- package/dist/db/repository-temporal-state.js +46 -0
- package/dist/db/repository-tll.d.ts +88 -0
- package/dist/db/repository-tll.js +179 -0
- package/dist/db/repository-types.d.ts +313 -0
- package/dist/db/repository-types.js +142 -0
- package/dist/db/repository-user-profiles.d.ts +17 -0
- package/dist/db/repository-user-profiles.js +28 -0
- package/dist/db/repository-vector-search.d.ts +33 -0
- package/dist/db/repository-vector-search.js +373 -0
- package/dist/db/repository-wipe.d.ts +34 -0
- package/dist/db/repository-wipe.js +94 -0
- package/dist/db/repository-write.d.ts +61 -0
- package/dist/db/repository-write.js +279 -0
- package/dist/db/schema.sql +1355 -0
- package/dist/db/storage-artifact-delete-tx.d.ts +56 -0
- package/dist/db/storage-artifact-delete-tx.js +123 -0
- package/dist/db/storage-artifact-providers.d.ts +21 -0
- package/dist/db/storage-artifact-providers.js +21 -0
- package/dist/db/storage-artifact-recovery-repository.d.ts +66 -0
- package/dist/db/storage-artifact-recovery-repository.js +58 -0
- package/dist/db/storage-artifact-repository.d.ts +329 -0
- package/dist/db/storage-artifact-repository.js +497 -0
- package/dist/db/stores.d.ts +220 -0
- package/dist/db/stores.js +12 -0
- package/dist/db/summaries-repository.d.ts +74 -0
- package/dist/db/summaries-repository.js +125 -0
- package/dist/eval/beam-10m-loader.d.ts +98 -0
- package/dist/eval/beam-10m-loader.js +128 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +17 -0
- package/dist/middleware/require-bearer.d.ts +27 -0
- package/dist/middleware/require-bearer.js +60 -0
- package/dist/middleware/validate-response.d.ts +33 -0
- package/dist/middleware/validate-response.js +55 -0
- package/dist/middleware/validate.d.ts +43 -0
- package/dist/middleware/validate.js +85 -0
- package/dist/routes/agents.d.ts +13 -0
- package/dist/routes/agents.js +89 -0
- package/dist/routes/document-response-formatters.d.ts +98 -0
- package/dist/routes/document-response-formatters.js +243 -0
- package/dist/routes/documents.d.ts +74 -0
- package/dist/routes/documents.js +425 -0
- package/dist/routes/memories.d.ts +29 -0
- package/dist/routes/memories.js +725 -0
- package/dist/routes/memory-response-formatters.d.ts +179 -0
- package/dist/routes/memory-response-formatters.js +210 -0
- package/dist/routes/public-raw-storage-metadata.d.ts +54 -0
- package/dist/routes/public-raw-storage-metadata.js +56 -0
- package/dist/routes/reflect.d.ts +14 -0
- package/dist/routes/reflect.js +19 -0
- package/dist/routes/response-schema-map.d.ts +14 -0
- package/dist/routes/response-schema-map.js +69 -0
- package/dist/routes/route-errors.d.ts +12 -0
- package/dist/routes/route-errors.js +30 -0
- package/dist/routes/storage-error-handlers.d.ts +34 -0
- package/dist/routes/storage-error-handlers.js +185 -0
- package/dist/routes/storage-response-formatters.d.ts +44 -0
- package/dist/routes/storage-response-formatters.js +155 -0
- package/dist/routes/storage.d.ts +38 -0
- package/dist/routes/storage.js +369 -0
- package/dist/routes/upstream-provider-errors.d.ts +19 -0
- package/dist/routes/upstream-provider-errors.js +95 -0
- package/dist/schemas/agents.d.ts +79 -0
- package/dist/schemas/agents.js +126 -0
- package/dist/schemas/common.d.ts +110 -0
- package/dist/schemas/common.js +190 -0
- package/dist/schemas/document-list-responses.d.ts +102 -0
- package/dist/schemas/document-list-responses.js +87 -0
- package/dist/schemas/document-list-schemas.d.ts +123 -0
- package/dist/schemas/document-list-schemas.js +174 -0
- package/dist/schemas/document-response-schemas.d.ts +610 -0
- package/dist/schemas/document-response-schemas.js +264 -0
- package/dist/schemas/document-status-envelope.d.ts +48 -0
- package/dist/schemas/document-status-envelope.js +54 -0
- package/dist/schemas/documents.d.ts +292 -0
- package/dist/schemas/documents.js +449 -0
- package/dist/schemas/errors.d.ts +75 -0
- package/dist/schemas/errors.js +105 -0
- package/dist/schemas/memories.d.ts +378 -0
- package/dist/schemas/memories.js +542 -0
- package/dist/schemas/openapi.d.ts +24 -0
- package/dist/schemas/openapi.js +1038 -0
- package/dist/schemas/response-scalars.d.ts +10 -0
- package/dist/schemas/response-scalars.js +10 -0
- package/dist/schemas/responses.d.ts +536 -0
- package/dist/schemas/responses.js +350 -0
- package/dist/schemas/search-response-parts.d.ts +97 -0
- package/dist/schemas/search-response-parts.js +103 -0
- package/dist/schemas/storage-schemas.d.ts +175 -0
- package/dist/schemas/storage-schemas.js +277 -0
- package/dist/schemas/zod-setup.d.ts +15 -0
- package/dist/schemas/zod-setup.js +17 -0
- package/dist/server.d.ts +13 -0
- package/dist/server.js +57 -0
- package/dist/services/abstract-query-policy.d.ts +13 -0
- package/dist/services/abstract-query-policy.js +50 -0
- package/dist/services/affinity-clustering.d.ts +66 -0
- package/dist/services/affinity-clustering.js +125 -0
- package/dist/services/agentic-retrieval.d.ts +38 -0
- package/dist/services/agentic-retrieval.js +126 -0
- package/dist/services/answer-format.d.ts +56 -0
- package/dist/services/answer-format.js +118 -0
- package/dist/services/answer-rescue.d.ts +72 -0
- package/dist/services/answer-rescue.js +177 -0
- package/dist/services/answer-verifier.d.ts +24 -0
- package/dist/services/answer-verifier.js +73 -0
- package/dist/services/api-retry.d.ts +6 -0
- package/dist/services/api-retry.js +41 -0
- package/dist/services/assistant-turn-filter.d.ts +20 -0
- package/dist/services/assistant-turn-filter.js +69 -0
- package/dist/services/atomicmem-uri.d.ts +33 -0
- package/dist/services/atomicmem-uri.js +86 -0
- package/dist/services/audit-events.d.ts +54 -0
- package/dist/services/audit-events.js +56 -0
- package/dist/services/chunked-extraction.d.ts +21 -0
- package/dist/services/chunked-extraction.js +108 -0
- package/dist/services/claim-slotting.d.ts +27 -0
- package/dist/services/claim-slotting.js +38 -0
- package/dist/services/claude-code-llm.d.ts +19 -0
- package/dist/services/claude-code-llm.js +96 -0
- package/dist/services/composite-dedup.d.ts +50 -0
- package/dist/services/composite-dedup.js +153 -0
- package/dist/services/composite-grouping.d.ts +41 -0
- package/dist/services/composite-grouping.js +111 -0
- package/dist/services/composite-staleness.d.ts +20 -0
- package/dist/services/composite-staleness.js +50 -0
- package/dist/services/conciseness-preference.d.ts +14 -0
- package/dist/services/conciseness-preference.js +42 -0
- package/dist/services/conflict-policy.d.ts +20 -0
- package/dist/services/conflict-policy.js +335 -0
- package/dist/services/consensus-extraction.d.ts +39 -0
- package/dist/services/consensus-extraction.js +147 -0
- package/dist/services/consensus-validation.d.ts +52 -0
- package/dist/services/consensus-validation.js +206 -0
- package/dist/services/consolidation-service.d.ts +60 -0
- package/dist/services/consolidation-service.js +171 -0
- package/dist/services/content-detection.d.ts +18 -0
- package/dist/services/content-detection.js +25 -0
- package/dist/services/contradiction-surfacing.d.ts +62 -0
- package/dist/services/contradiction-surfacing.js +111 -0
- package/dist/services/cost-telemetry.d.ts +39 -0
- package/dist/services/cost-telemetry.js +58 -0
- package/dist/services/counter-evidence.d.ts +34 -0
- package/dist/services/counter-evidence.js +92 -0
- package/dist/services/current-state-ranking.d.ts +21 -0
- package/dist/services/current-state-ranking.js +152 -0
- package/dist/services/deferred-audn.d.ts +47 -0
- package/dist/services/deferred-audn.js +162 -0
- package/dist/services/document-chunker.d.ts +50 -0
- package/dist/services/document-chunker.js +153 -0
- package/dist/services/document-failure-markers.d.ts +91 -0
- package/dist/services/document-failure-markers.js +305 -0
- package/dist/services/document-indexer.d.ts +122 -0
- package/dist/services/document-indexer.js +405 -0
- package/dist/services/document-service.d.ts +245 -0
- package/dist/services/document-service.js +325 -0
- package/dist/services/document-upload-artifact-sync.d.ts +80 -0
- package/dist/services/document-upload-artifact-sync.js +162 -0
- package/dist/services/document-upload-beta2-recovery.d.ts +72 -0
- package/dist/services/document-upload-beta2-recovery.js +94 -0
- package/dist/services/document-upload.d.ts +44 -0
- package/dist/services/document-upload.js +353 -0
- package/dist/services/embedding.d.ts +57 -0
- package/dist/services/embedding.js +416 -0
- package/dist/services/entity-attribute-extractor.d.ts +34 -0
- package/dist/services/entity-attribute-extractor.js +117 -0
- package/dist/services/entity-card-synthesis.d.ts +54 -0
- package/dist/services/entity-card-synthesis.js +92 -0
- package/dist/services/entity-dedup.d.ts +9 -0
- package/dist/services/entity-dedup.js +14 -0
- package/dist/services/entity-graph.d.ts +17 -0
- package/dist/services/entity-graph.js +135 -0
- package/dist/services/entropy-gate.d.ts +52 -0
- package/dist/services/entropy-gate.js +56 -0
- package/dist/services/episode-fetcher.d.ts +47 -0
- package/dist/services/episode-fetcher.js +128 -0
- package/dist/services/event-anchor-facts.d.ts +8 -0
- package/dist/services/event-anchor-facts.js +205 -0
- package/dist/services/event-chain-detector.d.ts +52 -0
- package/dist/services/event-chain-detector.js +83 -0
- package/dist/services/extraction-cache.d.ts +9 -0
- package/dist/services/extraction-cache.js +54 -0
- package/dist/services/extraction-enrichment.d.ts +9 -0
- package/dist/services/extraction-enrichment.js +223 -0
- package/dist/services/extraction.d.ts +69 -0
- package/dist/services/extraction.js +596 -0
- package/dist/services/fact-normalization.d.ts +12 -0
- package/dist/services/fact-normalization.js +248 -0
- package/dist/services/filecoin-observability.d.ts +127 -0
- package/dist/services/filecoin-observability.js +200 -0
- package/dist/services/first-mention-service.d.ts +76 -0
- package/dist/services/first-mention-service.js +186 -0
- package/dist/services/hierarchical-retrieval.d.ts +49 -0
- package/dist/services/hierarchical-retrieval.js +50 -0
- package/dist/services/ingest-fact-pipeline.d.ts +32 -0
- package/dist/services/ingest-fact-pipeline.js +212 -0
- package/dist/services/ingest-post-write.d.ts +50 -0
- package/dist/services/ingest-post-write.js +117 -0
- package/dist/services/ingest-trace.d.ts +32 -0
- package/dist/services/ingest-trace.js +60 -0
- package/dist/services/input-sanitizer.d.ts +41 -0
- package/dist/services/input-sanitizer.js +135 -0
- package/dist/services/iterative-retrieval.d.ts +26 -0
- package/dist/services/iterative-retrieval.js +139 -0
- package/dist/services/keyword-expansion.d.ts +10 -0
- package/dist/services/keyword-expansion.js +26 -0
- package/dist/services/lesson-service.d.ts +68 -0
- package/dist/services/lesson-service.js +178 -0
- package/dist/services/literal-extractor.d.ts +16 -0
- package/dist/services/literal-extractor.js +74 -0
- package/dist/services/literal-list-protection.d.ts +17 -0
- package/dist/services/literal-list-protection.js +134 -0
- package/dist/services/literal-query-expansion.d.ts +20 -0
- package/dist/services/literal-query-expansion.js +181 -0
- package/dist/services/llm.d.ts +61 -0
- package/dist/services/llm.js +265 -0
- package/dist/services/memcell-projection.d.ts +17 -0
- package/dist/services/memcell-projection.js +41 -0
- package/dist/services/memory-audn.d.ts +43 -0
- package/dist/services/memory-audn.js +419 -0
- package/dist/services/memory-crud.d.ts +93 -0
- package/dist/services/memory-crud.js +255 -0
- package/dist/services/memory-ingest.d.ts +21 -0
- package/dist/services/memory-ingest.js +249 -0
- package/dist/services/memory-lifecycle.d.ts +75 -0
- package/dist/services/memory-lifecycle.js +108 -0
- package/dist/services/memory-lineage.d.ts +181 -0
- package/dist/services/memory-lineage.js +232 -0
- package/dist/services/memory-network.d.ts +40 -0
- package/dist/services/memory-network.js +75 -0
- package/dist/services/memory-search-types.d.ts +25 -0
- package/dist/services/memory-search-types.js +10 -0
- package/dist/services/memory-search.d.ts +48 -0
- package/dist/services/memory-search.js +505 -0
- package/dist/services/memory-service-types.d.ts +371 -0
- package/dist/services/memory-service-types.js +8 -0
- package/dist/services/memory-service.d.ts +152 -0
- package/dist/services/memory-service.js +225 -0
- package/dist/services/memory-storage.d.ts +33 -0
- package/dist/services/memory-storage.js +328 -0
- package/dist/services/msr-aggregator.d.ts +38 -0
- package/dist/services/msr-aggregator.js +97 -0
- package/dist/services/msr-detector.d.ts +35 -0
- package/dist/services/msr-detector.js +65 -0
- package/dist/services/namespace-retrieval.d.ts +60 -0
- package/dist/services/namespace-retrieval.js +180 -0
- package/dist/services/observation-date-extraction.d.ts +12 -0
- package/dist/services/observation-date-extraction.js +50 -0
- package/dist/services/observation-service.d.ts +27 -0
- package/dist/services/observation-service.js +84 -0
- package/dist/services/packaging-observability.d.ts +29 -0
- package/dist/services/packaging-observability.js +146 -0
- package/dist/services/query-expansion.d.ts +83 -0
- package/dist/services/query-expansion.js +242 -0
- package/dist/services/query-keyword-matches.d.ts +6 -0
- package/dist/services/query-keyword-matches.js +56 -0
- package/dist/services/query-term-visibility.d.ts +28 -0
- package/dist/services/query-term-visibility.js +100 -0
- package/dist/services/quick-extraction.d.ts +25 -0
- package/dist/services/quick-extraction.js +431 -0
- package/dist/services/quoted-entity-extraction.d.ts +10 -0
- package/dist/services/quoted-entity-extraction.js +161 -0
- package/dist/services/raw-storage-reconciler-backoff.d.ts +8 -0
- package/dist/services/raw-storage-reconciler-backoff.js +14 -0
- package/dist/services/raw-storage-reconciler-scheduler.d.ts +29 -0
- package/dist/services/raw-storage-reconciler-scheduler.js +43 -0
- package/dist/services/raw-storage-reconciler.d.ts +71 -0
- package/dist/services/raw-storage-reconciler.js +278 -0
- package/dist/services/recap-builder.d.ts +49 -0
- package/dist/services/recap-builder.js +157 -0
- package/dist/services/reflect-jobs.d.ts +23 -0
- package/dist/services/reflect-jobs.js +36 -0
- package/dist/services/reflect-prompts.d.ts +71 -0
- package/dist/services/reflect-prompts.js +99 -0
- package/dist/services/reflect-retrieval.d.ts +33 -0
- package/dist/services/reflect-retrieval.js +30 -0
- package/dist/services/reflect.d.ts +49 -0
- package/dist/services/reflect.js +84 -0
- package/dist/services/relative-temporal.d.ts +14 -0
- package/dist/services/relative-temporal.js +163 -0
- package/dist/services/relevance-policy.d.ts +37 -0
- package/dist/services/relevance-policy.js +109 -0
- package/dist/services/rerank.d.ts +32 -0
- package/dist/services/rerank.js +118 -0
- package/dist/services/reranker.d.ts +20 -0
- package/dist/services/reranker.js +99 -0
- package/dist/services/retrieval-channel-rules.d.ts +34 -0
- package/dist/services/retrieval-channel-rules.js +41 -0
- package/dist/services/retrieval-config-overlay.d.ts +36 -0
- package/dist/services/retrieval-config-overlay.js +44 -0
- package/dist/services/retrieval-format.d.ts +119 -0
- package/dist/services/retrieval-format.js +559 -0
- package/dist/services/retrieval-policy.d.ts +69 -0
- package/dist/services/retrieval-policy.js +275 -0
- package/dist/services/retrieval-profiles.d.ts +37 -0
- package/dist/services/retrieval-profiles.js +90 -0
- package/dist/services/retrieval-side-effects.d.ts +14 -0
- package/dist/services/retrieval-side-effects.js +26 -0
- package/dist/services/retrieval-trace.d.ts +108 -0
- package/dist/services/retrieval-trace.js +147 -0
- package/dist/services/rrf-fusion.d.ts +18 -0
- package/dist/services/rrf-fusion.js +34 -0
- package/dist/services/search-pipeline.d.ts +71 -0
- package/dist/services/search-pipeline.js +788 -0
- package/dist/services/session-date.d.ts +20 -0
- package/dist/services/session-date.js +61 -0
- package/dist/services/session-packaging.d.ts +53 -0
- package/dist/services/session-packaging.js +182 -0
- package/dist/services/session-summary-generator.d.ts +53 -0
- package/dist/services/session-summary-generator.js +134 -0
- package/dist/services/specialists/cr-specialist.d.ts +52 -0
- package/dist/services/specialists/cr-specialist.js +121 -0
- package/dist/services/specialists/dispatch.d.ts +53 -0
- package/dist/services/specialists/dispatch.js +102 -0
- package/dist/services/specialists/ie-ku-specialist.d.ts +37 -0
- package/dist/services/specialists/ie-ku-specialist.js +63 -0
- package/dist/services/specialists/msr-specialist.d.ts +61 -0
- package/dist/services/specialists/msr-specialist.js +162 -0
- package/dist/services/specialists/tr-specialist.d.ts +37 -0
- package/dist/services/specialists/tr-specialist.js +146 -0
- package/dist/services/storage-key-prefix.d.ts +42 -0
- package/dist/services/storage-key-prefix.js +45 -0
- package/dist/services/storage-put-recovery.d.ts +71 -0
- package/dist/services/storage-put-recovery.js +269 -0
- package/dist/services/storage-service-errors.d.ts +124 -0
- package/dist/services/storage-service-errors.js +189 -0
- package/dist/services/storage-service.d.ts +176 -0
- package/dist/services/storage-service.js +423 -0
- package/dist/services/subject-aware-ranking.d.ts +19 -0
- package/dist/services/subject-aware-ranking.js +161 -0
- package/dist/services/supplemental-extraction.d.ts +7 -0
- package/dist/services/supplemental-extraction.js +116 -0
- package/dist/services/tbc-execution.d.ts +49 -0
- package/dist/services/tbc-execution.js +284 -0
- package/dist/services/temporal-classifier.d.ts +56 -0
- package/dist/services/temporal-classifier.js +94 -0
- package/dist/services/temporal-endpoint-evidence.d.ts +12 -0
- package/dist/services/temporal-endpoint-evidence.js +313 -0
- package/dist/services/temporal-fingerprint.d.ts +6 -0
- package/dist/services/temporal-fingerprint.js +12 -0
- package/dist/services/temporal-format.d.ts +9 -0
- package/dist/services/temporal-format.js +21 -0
- package/dist/services/temporal-intent.d.ts +39 -0
- package/dist/services/temporal-intent.js +78 -0
- package/dist/services/temporal-query-constraints.d.ts +16 -0
- package/dist/services/temporal-query-constraints.js +107 -0
- package/dist/services/temporal-query-expansion.d.ts +14 -0
- package/dist/services/temporal-query-expansion.js +131 -0
- package/dist/services/temporal-rerank.d.ts +22 -0
- package/dist/services/temporal-rerank.js +47 -0
- package/dist/services/temporal-result-protection.d.ts +7 -0
- package/dist/services/temporal-result-protection.js +60 -0
- package/dist/services/temporal-state-write.d.ts +57 -0
- package/dist/services/temporal-state-write.js +45 -0
- package/dist/services/tiered-context.d.ts +87 -0
- package/dist/services/tiered-context.js +214 -0
- package/dist/services/tiered-loading.d.ts +88 -0
- package/dist/services/tiered-loading.js +263 -0
- package/dist/services/timeline-pack.d.ts +36 -0
- package/dist/services/timeline-pack.js +50 -0
- package/dist/services/timing.d.ts +13 -0
- package/dist/services/timing.js +72 -0
- package/dist/services/tll-augmentation.d.ts +20 -0
- package/dist/services/tll-augmentation.js +125 -0
- package/dist/services/tll-retrieval.d.ts +55 -0
- package/dist/services/tll-retrieval.js +101 -0
- package/dist/services/topic-abstraction.d.ts +36 -0
- package/dist/services/topic-abstraction.js +105 -0
- package/dist/services/trust-scoring.d.ts +43 -0
- package/dist/services/trust-scoring.js +89 -0
- package/dist/services/typed-belief-calculus.d.ts +126 -0
- package/dist/services/typed-belief-calculus.js +204 -0
- package/dist/services/upload-config.d.ts +34 -0
- package/dist/services/upload-config.js +23 -0
- package/dist/services/upload-decision.d.ts +65 -0
- package/dist/services/upload-decision.js +98 -0
- package/dist/services/upload-helpers.d.ts +107 -0
- package/dist/services/upload-helpers.js +148 -0
- package/dist/services/user-profile-builder.d.ts +22 -0
- package/dist/services/user-profile-builder.js +109 -0
- package/dist/services/voyage-embedding.d.ts +22 -0
- package/dist/services/voyage-embedding.js +77 -0
- package/dist/services/write-security.d.ts +31 -0
- package/dist/services/write-security.js +64 -0
- package/dist/storage/artifact-public-redaction.d.ts +34 -0
- package/dist/storage/artifact-public-redaction.js +83 -0
- package/dist/storage/cleanup.d.ts +103 -0
- package/dist/storage/cleanup.js +138 -0
- package/dist/storage/codec-factory.d.ts +17 -0
- package/dist/storage/codec-factory.js +33 -0
- package/dist/storage/codecs/aes-gcm-codec.d.ts +44 -0
- package/dist/storage/codecs/aes-gcm-codec.js +108 -0
- package/dist/storage/codecs/noop-codec.d.ts +16 -0
- package/dist/storage/codecs/noop-codec.js +23 -0
- package/dist/storage/factory.d.ts +44 -0
- package/dist/storage/factory.js +99 -0
- package/dist/storage/filecoin-cid-validation.d.ts +82 -0
- package/dist/storage/filecoin-cid-validation.js +122 -0
- package/dist/storage/filecoin-public-metadata.d.ts +73 -0
- package/dist/storage/filecoin-public-metadata.js +110 -0
- package/dist/storage/local-fs-store.d.ts +39 -0
- package/dist/storage/local-fs-store.js +145 -0
- package/dist/storage/pointer-uri-allowlist.d.ts +38 -0
- package/dist/storage/pointer-uri-allowlist.js +70 -0
- package/dist/storage/provider-metadata-projection.d.ts +27 -0
- package/dist/storage/provider-metadata-projection.js +68 -0
- package/dist/storage/providers/filecoin/backend.d.ts +42 -0
- package/dist/storage/providers/filecoin/backend.js +250 -0
- package/dist/storage/providers/filecoin/config.d.ts +70 -0
- package/dist/storage/providers/filecoin/config.js +275 -0
- package/dist/storage/providers/filecoin/errors.d.ts +45 -0
- package/dist/storage/providers/filecoin/errors.js +56 -0
- package/dist/storage/providers/filecoin/filecoin-pin-car.d.ts +78 -0
- package/dist/storage/providers/filecoin/filecoin-pin-car.js +155 -0
- package/dist/storage/providers/filecoin/filecoin-pin-client.d.ts +92 -0
- package/dist/storage/providers/filecoin/filecoin-pin-client.js +199 -0
- package/dist/storage/providers/filecoin/filecoin-pin-mapping.d.ts +58 -0
- package/dist/storage/providers/filecoin/filecoin-pin-mapping.js +103 -0
- package/dist/storage/providers/filecoin/filecoin-pin-timeout.d.ts +30 -0
- package/dist/storage/providers/filecoin/filecoin-pin-timeout.js +53 -0
- package/dist/storage/providers/filecoin/filecoin-pin-vendor.d.ts +111 -0
- package/dist/storage/providers/filecoin/filecoin-pin-vendor.js +87 -0
- package/dist/storage/providers/filecoin/hints.d.ts +71 -0
- package/dist/storage/providers/filecoin/hints.js +123 -0
- package/dist/storage/providers/filecoin/index.d.ts +51 -0
- package/dist/storage/providers/filecoin/index.js +103 -0
- package/dist/storage/providers/filecoin/ipfs-cid.d.ts +50 -0
- package/dist/storage/providers/filecoin/ipfs-cid.js +64 -0
- package/dist/storage/providers/filecoin/metadata.d.ts +72 -0
- package/dist/storage/providers/filecoin/metadata.js +137 -0
- package/dist/storage/providers/filecoin/piece-cid.d.ts +48 -0
- package/dist/storage/providers/filecoin/piece-cid.js +57 -0
- package/dist/storage/providers/filecoin/provider-client.d.ts +234 -0
- package/dist/storage/providers/filecoin/provider-client.js +27 -0
- package/dist/storage/providers/filecoin/readiness.d.ts +62 -0
- package/dist/storage/providers/filecoin/readiness.js +85 -0
- package/dist/storage/providers/filecoin/retriever.d.ts +82 -0
- package/dist/storage/providers/filecoin/retriever.js +63 -0
- package/dist/storage/providers/filecoin/skeleton-client.d.ts +36 -0
- package/dist/storage/providers/filecoin/skeleton-client.js +55 -0
- package/dist/storage/providers/filecoin/synapse-client.d.ts +169 -0
- package/dist/storage/providers/filecoin/synapse-client.js +343 -0
- package/dist/storage/providers/filecoin/synapse-construction.d.ts +26 -0
- package/dist/storage/providers/filecoin/synapse-construction.js +47 -0
- package/dist/storage/providers/filecoin/synapse-error-mapping.d.ts +23 -0
- package/dist/storage/providers/filecoin/synapse-error-mapping.js +49 -0
- package/dist/storage/providers/filecoin/synapse-readiness.d.ts +37 -0
- package/dist/storage/providers/filecoin/synapse-readiness.js +231 -0
- package/dist/storage/providers/filecoin/uri.d.ts +49 -0
- package/dist/storage/providers/filecoin/uri.js +84 -0
- package/dist/storage/providers/filecoin/verified-fetch-lifecycle.d.ts +77 -0
- package/dist/storage/providers/filecoin/verified-fetch-lifecycle.js +196 -0
- package/dist/storage/providers/filecoin/verified-fetch-retriever.d.ts +54 -0
- package/dist/storage/providers/filecoin/verified-fetch-retriever.js +81 -0
- package/dist/storage/providers/filecoin/verified-fetch-vendor.d.ts +71 -0
- package/dist/storage/providers/filecoin/verified-fetch-vendor.js +94 -0
- package/dist/storage/raw-content-codec.d.ts +89 -0
- package/dist/storage/raw-content-codec.js +47 -0
- package/dist/storage/raw-content-store-backend-adapter.d.ts +28 -0
- package/dist/storage/raw-content-store-backend-adapter.js +67 -0
- package/dist/storage/raw-content-store.d.ts +228 -0
- package/dist/storage/raw-content-store.js +27 -0
- package/dist/storage/s3-store.d.ts +42 -0
- package/dist/storage/s3-store.js +181 -0
- package/dist/storage/storage-backend-registry.d.ts +58 -0
- package/dist/storage/storage-backend-registry.js +56 -0
- package/dist/storage/storage-backend.d.ts +82 -0
- package/dist/storage/storage-backend.js +14 -0
- package/dist/storage/storage-capabilities.d.ts +56 -0
- package/dist/storage/storage-capabilities.js +170 -0
- package/dist/storage/store-registry.d.ts +67 -0
- package/dist/storage/store-registry.js +77 -0
- package/dist/vector-math.d.ts +15 -0
- package/dist/vector-math.js +31 -0
- package/dist/xml-escape.d.ts +5 -0
- package/dist/xml-escape.js +7 -0
- package/openapi.json +15395 -0
- package/openapi.yaml +10794 -0
- package/package.json +119 -0
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,680 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runtime configuration for the prototype backend.
|
|
3
|
+
* Loads validated env-backed defaults, then allows limited in-memory updates
|
|
4
|
+
* for local UI experimentation via PUT /v1/memories/config.
|
|
5
|
+
*/
|
|
6
|
+
import { type RetrievalProfile, type RetrievalProfileName } from './services/retrieval-profiles.js';
|
|
7
|
+
import { type FilecoinProviderConfig } from './storage/providers/filecoin/config.js';
|
|
8
|
+
export type EmbeddingProviderName = 'openai' | 'ollama' | 'openai-compatible' | 'transformers' | 'voyage';
|
|
9
|
+
export type LLMProviderName = EmbeddingProviderName | 'groq' | 'anthropic' | 'google-genai' | 'claude-code';
|
|
10
|
+
export type VectorBackendName = 'pgvector' | 'ruvector-mock' | 'zvec-mock';
|
|
11
|
+
export type CrossEncoderDtype = 'auto' | 'fp32' | 'fp16' | 'q8' | 'int8' | 'uint8' | 'q4' | 'bnb4' | 'q4f16';
|
|
12
|
+
/**
|
|
13
|
+
* Phases 1 + 3 of the large-file ingestion plan ship `pointer_only`
|
|
14
|
+
* and `managed_blob`. `inline_small_text` is reserved for a later
|
|
15
|
+
* phase — `parseRawStorageMode` rejects it explicitly.
|
|
16
|
+
*/
|
|
17
|
+
export type RawStorageMode = 'pointer_only' | 'managed_blob';
|
|
18
|
+
/**
|
|
19
|
+
* Content-codec selector that sits between the upload service and the
|
|
20
|
+
* raw-content adapter. `none` is the pass-through (immediate providers'
|
|
21
|
+
* default); `aes_gcm` wraps the bytes in AES-256-GCM ciphertext so the
|
|
22
|
+
* adapter (and downstream content-addressing) only sees encrypted
|
|
23
|
+
* bytes. The codec keyring (`RAW_CONTENT_CODEC_KEYS` +
|
|
24
|
+
* `RAW_CONTENT_CODEC_ACTIVE_KEY_ID`) holds the rotation state.
|
|
25
|
+
*/
|
|
26
|
+
export type RawContentCodecName = 'none' | 'aes_gcm';
|
|
27
|
+
/**
|
|
28
|
+
* Deployment-env classifier driving fail-closed policy decisions
|
|
29
|
+
* (plaintext-Filecoin escape hatch, error `.cause` sanitization).
|
|
30
|
+
* REQUIRED at startup; no `NODE_ENV` is read anywhere.
|
|
31
|
+
*/
|
|
32
|
+
export type RawStorageDeploymentEnv = 'production' | 'staging' | 'local';
|
|
33
|
+
export interface RuntimeConfig {
|
|
34
|
+
databaseUrl: string;
|
|
35
|
+
openaiApiKey: string;
|
|
36
|
+
/**
|
|
37
|
+
* Shared API key required on every authenticated `/v1/*` request.
|
|
38
|
+
* Validated against `Authorization: Bearer <key>` by the
|
|
39
|
+
* `requireBearer` middleware. REQUIRED at startup in every
|
|
40
|
+
* environment; tests set it via `.env.test`. Operators rotate by
|
|
41
|
+
* restarting the server with a new value.
|
|
42
|
+
*/
|
|
43
|
+
coreApiKey: string;
|
|
44
|
+
/**
|
|
45
|
+
* Hex-encoded secret used to derive per-user storage-key prefixes
|
|
46
|
+
* via HMAC-SHA256. Storage keys take the form `s/<32hex>/<uuid>.bin`
|
|
47
|
+
* where the 32 hex chars are the first 16 bytes of
|
|
48
|
+
* `HMAC_SHA256(secret, userId)`. REQUIRED whenever managed-mode
|
|
49
|
+
* storage is configured; pointer-only deployments still set it so
|
|
50
|
+
* the config gate is one consistent contract. Must be at least 64
|
|
51
|
+
* hex chars (32 bytes of entropy).
|
|
52
|
+
*/
|
|
53
|
+
storageKeyHmacSecret: string;
|
|
54
|
+
port: number;
|
|
55
|
+
retrievalProfile: RetrievalProfileName;
|
|
56
|
+
retrievalProfileSettings: RetrievalProfile;
|
|
57
|
+
maxSearchResults: number;
|
|
58
|
+
similarityThreshold: number;
|
|
59
|
+
audnCandidateThreshold: number;
|
|
60
|
+
audnSafeReuseMinSimilarity: number;
|
|
61
|
+
crossAgentCandidateThreshold: number;
|
|
62
|
+
clarificationConflictThreshold: number;
|
|
63
|
+
adaptiveRetrievalEnabled: boolean;
|
|
64
|
+
adaptiveSimpleLimit: number;
|
|
65
|
+
adaptiveMediumLimit: number;
|
|
66
|
+
adaptiveComplexLimit: number;
|
|
67
|
+
adaptiveMultiHopLimit: number;
|
|
68
|
+
adaptiveAggregationLimit: number;
|
|
69
|
+
repairLoopEnabled: boolean;
|
|
70
|
+
hybridSearchEnabled: boolean;
|
|
71
|
+
repairLoopMinSimilarity: number;
|
|
72
|
+
repairSkipSimilarity: number;
|
|
73
|
+
mmrEnabled: boolean;
|
|
74
|
+
mmrLambda: number;
|
|
75
|
+
linkExpansionEnabled: boolean;
|
|
76
|
+
linkExpansionMax: number;
|
|
77
|
+
linkSimilarityThreshold: number;
|
|
78
|
+
scoringWeightSimilarity: number;
|
|
79
|
+
scoringWeightImportance: number;
|
|
80
|
+
scoringWeightRecency: number;
|
|
81
|
+
linkExpansionBeforeMMR: boolean;
|
|
82
|
+
pprEnabled: boolean;
|
|
83
|
+
pprDamping: number;
|
|
84
|
+
repairDeltaThreshold: number;
|
|
85
|
+
repairConfidenceFloor: number;
|
|
86
|
+
embeddingProvider: EmbeddingProviderName;
|
|
87
|
+
embeddingModel: string;
|
|
88
|
+
embeddingDimensions: number;
|
|
89
|
+
embeddingApiUrl?: string;
|
|
90
|
+
embeddingApiKey?: string;
|
|
91
|
+
voyageApiKey?: string;
|
|
92
|
+
voyageDocumentModel: string;
|
|
93
|
+
voyageQueryModel: string;
|
|
94
|
+
llmProvider: LLMProviderName;
|
|
95
|
+
llmModel: string;
|
|
96
|
+
llmApiUrl?: string;
|
|
97
|
+
llmApiKey?: string;
|
|
98
|
+
groqApiKey?: string;
|
|
99
|
+
ollamaBaseUrl: string;
|
|
100
|
+
vectorBackend: VectorBackendName;
|
|
101
|
+
skipVectorIndexes: boolean;
|
|
102
|
+
llmSeed?: number;
|
|
103
|
+
stagedLoadingEnabled: boolean;
|
|
104
|
+
retrievalTraceEnabled: boolean;
|
|
105
|
+
ingestTraceDir: string;
|
|
106
|
+
ingestTraceEnabled: boolean;
|
|
107
|
+
extractionCacheEnabled: boolean;
|
|
108
|
+
extractionCacheDir: string;
|
|
109
|
+
embeddingCacheEnabled: boolean;
|
|
110
|
+
chunkedExtractionEnabled: boolean;
|
|
111
|
+
chunkedExtractionFallbackEnabled: boolean;
|
|
112
|
+
chunkSizeTurns: number;
|
|
113
|
+
chunkOverlapTurns: number;
|
|
114
|
+
consensusExtractionEnabled: boolean;
|
|
115
|
+
consensusExtractionRuns: number;
|
|
116
|
+
observationDateExtractionEnabled: boolean;
|
|
117
|
+
quotedEntityExtractionEnabled: boolean;
|
|
118
|
+
entropyGateEnabled: boolean;
|
|
119
|
+
entropyGateThreshold: number;
|
|
120
|
+
entropyGateAlpha: number;
|
|
121
|
+
affinityClusteringThreshold: number;
|
|
122
|
+
affinityClusteringMinSize: number;
|
|
123
|
+
affinityClusteringBeta: number;
|
|
124
|
+
affinityClusteringTemporalLambda: number;
|
|
125
|
+
trustScoringEnabled: boolean;
|
|
126
|
+
trustScoreMinThreshold: number;
|
|
127
|
+
trustPenaltyEnabled: boolean;
|
|
128
|
+
auditLoggingEnabled: boolean;
|
|
129
|
+
decayCycleEnabled: boolean;
|
|
130
|
+
decayRetentionThreshold: number;
|
|
131
|
+
decayMinAgeDays: number;
|
|
132
|
+
memoryCapEnabled: boolean;
|
|
133
|
+
memoryCapMax: number;
|
|
134
|
+
memoryCapWarnRatio: number;
|
|
135
|
+
entityGraphEnabled: boolean;
|
|
136
|
+
entityResolutionThreshold: number;
|
|
137
|
+
entitySearchMinSimilarity: number;
|
|
138
|
+
lessonsEnabled: boolean;
|
|
139
|
+
lessonSimilarityThreshold: number;
|
|
140
|
+
consensusValidationEnabled: boolean;
|
|
141
|
+
consensusMinMemories: number;
|
|
142
|
+
queryExpansionEnabled: boolean;
|
|
143
|
+
queryExpansionMinSimilarity: number;
|
|
144
|
+
queryAugmentationEnabled: boolean;
|
|
145
|
+
queryAugmentationMaxEntities: number;
|
|
146
|
+
queryAugmentationMinSimilarity: number;
|
|
147
|
+
crossEncoderEnabled: boolean;
|
|
148
|
+
crossEncoderModel: string;
|
|
149
|
+
crossEncoderDtype: CrossEncoderDtype;
|
|
150
|
+
iterativeRetrievalEnabled: boolean;
|
|
151
|
+
namespaceClassificationEnabled: boolean;
|
|
152
|
+
fastAudnEnabled: boolean;
|
|
153
|
+
fastAudnDuplicateThreshold: number;
|
|
154
|
+
observationNetworkEnabled: boolean;
|
|
155
|
+
agenticRetrievalEnabled: boolean;
|
|
156
|
+
rerankSkipTopSimilarity: number;
|
|
157
|
+
rerankSkipMinGap: number;
|
|
158
|
+
literalListProtectionEnabled: boolean;
|
|
159
|
+
literalListProtectionMaxProtected: number;
|
|
160
|
+
temporalQueryConstraintEnabled: boolean;
|
|
161
|
+
temporalQueryConstraintBoost: number;
|
|
162
|
+
deferredAudnEnabled: boolean;
|
|
163
|
+
deferredAudnBatchSize: number;
|
|
164
|
+
compositeGroupingEnabled: boolean;
|
|
165
|
+
compositeMinClusterSize: number;
|
|
166
|
+
compositeMaxClusterSize: number;
|
|
167
|
+
compositeSimilarityThreshold: number;
|
|
168
|
+
anthropicApiKey?: string;
|
|
169
|
+
googleApiKey?: string;
|
|
170
|
+
costLoggingEnabled: boolean;
|
|
171
|
+
costLogDir: string;
|
|
172
|
+
costRunId: string;
|
|
173
|
+
conflictAutoResolveMs: number;
|
|
174
|
+
/**
|
|
175
|
+
* Typed Belief Calculus (TBC) gate. When true, the AUDN decision step
|
|
176
|
+
* defers to `decideBeliefOperator` from `services/typed-belief-calculus.ts`.
|
|
177
|
+
* Default false — Phase 1 ships only the type surface and stub resolver,
|
|
178
|
+
* so existing AUDN behavior is unchanged. See `docs/typed-belief-calculus.md`.
|
|
179
|
+
*/
|
|
180
|
+
tbcEnabled: boolean;
|
|
181
|
+
/**
|
|
182
|
+
* Hierarchical retrieval (T2): adds a 5th RRF arm that searches over
|
|
183
|
+
* conversation/session summaries first, then expands to atomic facts within
|
|
184
|
+
* the matched sessions. Targets BEAM-10M scale (~14M tokens of context per
|
|
185
|
+
* system) where flat top-K retrieval loses signal.
|
|
186
|
+
* Default false. See `docs/hierarchical-retrieval.md`.
|
|
187
|
+
* Env var: HIERARCHICAL_RETRIEVAL_ENABLED=true
|
|
188
|
+
*/
|
|
189
|
+
hierarchicalRetrievalEnabled: boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Topic abstraction layer (Sprint 3 EO experiment): when true, ingest runs
|
|
192
|
+
* a second LLM pass per chunk to extract a 3-7 word conceptual topic, embeds
|
|
193
|
+
* it, and stores both alongside the raw fact. Retrieval fuses a topic-
|
|
194
|
+
* embedding similarity stream into RRF when topicSearchEnabled is also true.
|
|
195
|
+
* Default false. Design: benchmarks-sprint3/2026-05-10-am-baseline-and-rerank-design.md.
|
|
196
|
+
* Env var: TOPIC_ABSTRACTION_ENABLED=true
|
|
197
|
+
*/
|
|
198
|
+
topicAbstractionEnabled: boolean;
|
|
199
|
+
/**
|
|
200
|
+
* Topic search arm: when true (and topic_embedding column populated), the
|
|
201
|
+
* search pipeline adds a topic-similarity RRF channel. Independent of the
|
|
202
|
+
* ingest-side flag so the retrieval lift can be measured against pre-existing
|
|
203
|
+
* topic-augmented memory state.
|
|
204
|
+
* Default false. Env var: TOPIC_SEARCH_ENABLED=true
|
|
205
|
+
*/
|
|
206
|
+
topicSearchEnabled: boolean;
|
|
207
|
+
/**
|
|
208
|
+
* Cross-encoder reranker: when true, the search pipeline reranks the top-N
|
|
209
|
+
* RRF-fused candidates via an LLM-scored relevance pass. Adds ~50-150 ms
|
|
210
|
+
* p95 retrieve latency. Mirrors Hindsight's reranking layer.
|
|
211
|
+
* Default false. Env var: RERANKER_ENABLED=true
|
|
212
|
+
*/
|
|
213
|
+
rerankerEnabled: boolean;
|
|
214
|
+
/** Top-N candidates fed into the reranker (default 20). Env: RERANKER_TOP_N */
|
|
215
|
+
rerankerTopN: number;
|
|
216
|
+
/**
|
|
217
|
+
* Recap layer (Sprint 3 v1, cross-session synthesis): when true, the
|
|
218
|
+
* post-write pipeline opportunistically synthesizes Recaps from clusters
|
|
219
|
+
* of memories sharing a topic_abstraction. Recaps are surfaced via their
|
|
220
|
+
* own RRF channel at retrieval. Cog-sci analogue: hippocampal consolidation.
|
|
221
|
+
* Requires topicAbstractionEnabled=true (clusters by topic field).
|
|
222
|
+
* Default false. Env var: RECAP_LAYER_ENABLED=true
|
|
223
|
+
*/
|
|
224
|
+
recapLayerEnabled: boolean;
|
|
225
|
+
/** Min cluster size for recap building (default 4). Env: RECAP_MIN_CLUSTER_SIZE */
|
|
226
|
+
recapMinClusterSize: number;
|
|
227
|
+
/**
|
|
228
|
+
* Recap cluster pivot (Sprint 3 v1.1 — V2 backlog #2).
|
|
229
|
+
* 'topic' — group by topic_abstraction (original; needs topic-abstraction
|
|
230
|
+
* layer ON; empirically regressed fact abilities).
|
|
231
|
+
* 'session' — group by user_id + observed_at hour bucket (doesn't need
|
|
232
|
+
* topic-abstraction; captures cross-turn aggregation in a
|
|
233
|
+
* conversational window).
|
|
234
|
+
* Default 'topic' to preserve existing behavior. Env: RECAP_CLUSTER_PIVOT
|
|
235
|
+
*/
|
|
236
|
+
recapClusterPivot: 'topic' | 'session';
|
|
237
|
+
/** When true, search pipeline adds a recap-similarity RRF channel.
|
|
238
|
+
* Independent of layer flag so retrieval can be measured against pre-existing
|
|
239
|
+
* recap state. Default false. Env: RECAP_SEARCH_ENABLED=true */
|
|
240
|
+
recapSearchEnabled: boolean;
|
|
241
|
+
/**
|
|
242
|
+
* Counter-evidence retrieval (Sprint 3 v1.1 — V2 backlog item 1): when
|
|
243
|
+
* true, the search pipeline expands the top-K result set with memories
|
|
244
|
+
* that COUNTER any retrieved memory via the belief_edges graph. Surfaces
|
|
245
|
+
* both sides of contradictions for CR-style queries.
|
|
246
|
+
* Requires TBC to have been ON at ingest (populates belief_edges).
|
|
247
|
+
* Default false. Env: COUNTER_EVIDENCE_ENABLED=true
|
|
248
|
+
*/
|
|
249
|
+
counterEvidenceEnabled: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Temporal-aware packaging (Sprint 3 v1.2 — EO failure-mode fix).
|
|
252
|
+
* When true, retrieval-format.ts surfaces `observed_at` (the
|
|
253
|
+
* conversation timestamp captured during ingest) instead of
|
|
254
|
+
* `created_at` (the ingest wall-clock) for:
|
|
255
|
+
* - chronological sort of the injection block
|
|
256
|
+
* - the per-memory date attribute
|
|
257
|
+
* - the Timeline summary
|
|
258
|
+
* This restores within-conversation turn order for BEAM-style
|
|
259
|
+
* backloaded ingestion where many turns share a single ingest time.
|
|
260
|
+
* Default false (preserves existing behavior). Env:
|
|
261
|
+
* PACKAGING_USE_OBSERVED_AT=true
|
|
262
|
+
*/
|
|
263
|
+
packagingUseObservedAt: boolean;
|
|
264
|
+
/**
|
|
265
|
+
* Dual-date packaging (Sprint 3 v1.3 — companion to packagingUseObservedAt).
|
|
266
|
+
* When true, retrieval-format.ts emits BOTH `created_at` and `observed_at`
|
|
267
|
+
* attributes on every `<memory>` element when they differ. Lets the answer
|
|
268
|
+
* LLM see ingest time AND conversation time and decide which to weight
|
|
269
|
+
* per question, instead of forcing a global swap.
|
|
270
|
+
* Independent of `packagingUseObservedAt` (which controls sort + label
|
|
271
|
+
* date). Default false. Env: PACKAGING_DUAL_DATE=true
|
|
272
|
+
*/
|
|
273
|
+
packagingDualDate: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Timeline channel (Sprint 3 v1.4 — H3 from haiku-080 master plan).
|
|
276
|
+
* When true, retrieval-format.ts emits an additional `## TIMELINE`
|
|
277
|
+
* section in the injection text. Dates are derived from observed_at
|
|
278
|
+
* across the retrieved set, sorted ascending, deduplicated.
|
|
279
|
+
* Independent of packagingUseObservedAt and packagingDualDate.
|
|
280
|
+
* Default false. Env: TIMELINE_CHANNEL_ENABLED=true
|
|
281
|
+
*/
|
|
282
|
+
timelineChannelEnabled: boolean;
|
|
283
|
+
/**
|
|
284
|
+
* Answer-only retrieval filter (Sprint 4 iter 1). When true, drop
|
|
285
|
+
* advisory-only memories from the retrieved set before formatting the
|
|
286
|
+
* injection. Insight: Sprint 3 incorrect-case analysis showed
|
|
287
|
+
* retrieved contexts mixed verbose [context] snippets with specific
|
|
288
|
+
* [answer] facts, and Haiku weighted the former over the latter.
|
|
289
|
+
* Failsafe: if <3 memories survive the filter, falls back to the
|
|
290
|
+
* unfiltered set. Default false. Env: ANSWER_ONLY_RETRIEVAL_FILTER=true
|
|
291
|
+
*/
|
|
292
|
+
answerOnlyRetrievalFilter: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* Near-duplicate dedup at retrieval (Sprint 4 iter 2). When true,
|
|
295
|
+
* deduplicate retrieved memories by content fingerprint (lowercased
|
|
296
|
+
* alphanumeric prefix of first 80 chars). Sprint 3 showed retrieved
|
|
297
|
+
* contexts had same fact in 3-5 paraphrases per query; dedup makes
|
|
298
|
+
* room for diverse memories.
|
|
299
|
+
* Failsafe: if <3 memories survive, falls back to unfiltered set.
|
|
300
|
+
* Default false. Env: RETRIEVAL_DEDUP_ENABLED=true
|
|
301
|
+
*/
|
|
302
|
+
retrievalDedupEnabled: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* BM25 keyword RRF weight (Sprint 4 iter 3). Default 1.0 (existing
|
|
305
|
+
* behavior). Boosting to 1.5-2.0 prioritizes keyword/BM25 matches in
|
|
306
|
+
* the hybrid RRF fan-in. Useful for queries that ask for specific
|
|
307
|
+
* named facts ("how many X", "what is Y"). Only fires when
|
|
308
|
+
* hybridSearchEnabled is true. Env: KEYWORD_RRF_WEIGHT=1.5
|
|
309
|
+
*/
|
|
310
|
+
keywordRrfWeight: number;
|
|
311
|
+
/**
|
|
312
|
+
* Entity-Attribute Index (EAI — Sprint 4). When true, ingest extracts
|
|
313
|
+
* (entity, attribute, value) triples into the `entity_attributes` table
|
|
314
|
+
* and retrieval queries that table for fact-specific lookups (e.g.
|
|
315
|
+
* "how many columns did I add?", "what's the API quota?"). Storage
|
|
316
|
+
* foundation lands first; extraction (Task B) and retrieval (Task C)
|
|
317
|
+
* activate the channel.
|
|
318
|
+
* Default false. Env var: ENTITY_ATTRIBUTES_ENABLED=true
|
|
319
|
+
*/
|
|
320
|
+
entityAttributesEnabled: boolean;
|
|
321
|
+
/**
|
|
322
|
+
* Top-K EAI rows to fetch when the entity-attributes channel is enabled
|
|
323
|
+
* (Sprint 4 — Task C). Clamped to [5, 40] inside `fetchEntityFactsForInjection`
|
|
324
|
+
* — too few drops near-misses, too many bloats the `## FACTS` block.
|
|
325
|
+
* Default 20. Env: ENTITY_ATTRIBUTES_TOP_K=20
|
|
326
|
+
*/
|
|
327
|
+
entityAttributesTopK: number;
|
|
328
|
+
/**
|
|
329
|
+
* User-profile channel (Sprint 3 v1.5 — H2 from haiku-080 master plan).
|
|
330
|
+
* When true, post-write synthesizes a per-user profile document
|
|
331
|
+
* (Honcho-style) after each ingest that stores >= 3 new memories.
|
|
332
|
+
* The search pipeline prepends the profile as a `## USER PROFILE`
|
|
333
|
+
* block at the head of every answer prompt.
|
|
334
|
+
* Default false. Env: USER_PROFILE_CHANNEL_ENABLED=true
|
|
335
|
+
*/
|
|
336
|
+
userProfileChannelEnabled: boolean;
|
|
337
|
+
/**
|
|
338
|
+
* Episodes-as-separate-channel (Sprint 3 v1.6 — H4 from haiku-080 master
|
|
339
|
+
* plan). When true, the search pipeline fetches the top-K recap rows for
|
|
340
|
+
* the query embedding via `RecapStore.findRecapCandidates` and threads
|
|
341
|
+
* them through the injection builder as a dedicated `## EPISODES` block,
|
|
342
|
+
* INSTEAD OF routing recaps through the RRF fan-in. Sprint 3 v1.1
|
|
343
|
+
* documented that the RRF route displaced 3-5 atomic facts per recap in
|
|
344
|
+
* top-K and regressed fact-anchored abilities; this flag lets recap
|
|
345
|
+
* narrative surface to the answer LLM without paying that displacement
|
|
346
|
+
* cost. Independent of `recapSearchEnabled` (recap-via-RRF) — typical
|
|
347
|
+
* config has the layer ON, recap-search OFF, and episodes-channel ON.
|
|
348
|
+
* Default false. Env: EPISODES_CHANNEL_ENABLED=true
|
|
349
|
+
*/
|
|
350
|
+
episodesChannelEnabled: boolean;
|
|
351
|
+
/**
|
|
352
|
+
* Top-K recap rows to fetch when the episodes channel is enabled.
|
|
353
|
+
* Default 2. Clamped to [1, 5] inside memory-search to bound prompt
|
|
354
|
+
* growth — large K dilutes the channel signal without lifting recall.
|
|
355
|
+
* Env: EPISODES_CHANNEL_TOP_K=2
|
|
356
|
+
*/
|
|
357
|
+
episodesChannelTopK: number;
|
|
358
|
+
/**
|
|
359
|
+
* Verifier pass (Sprint 3 v1.7 — H5 from haiku-080 master plan).
|
|
360
|
+
* Informational flag from AM core's perspective — the AMB adapter
|
|
361
|
+
* inspects `ATOMICMEMORY_VERIFIER_ENABLED` to decide whether to call
|
|
362
|
+
* `/v1/memories/verify` between its answer-LLM call and scoring. The
|
|
363
|
+
* flag is surfaced in core config for symmetry with the other channel
|
|
364
|
+
* flags so iteration env files can request the verifier pass.
|
|
365
|
+
* Default false. Env: VERIFIER_PASS_ENABLED=true
|
|
366
|
+
*/
|
|
367
|
+
verifierPassEnabled: boolean;
|
|
368
|
+
/**
|
|
369
|
+
* Layer 1 answer-format alignment (BEAM-0.85 Phase 0): when true,
|
|
370
|
+
* `buildInjection` prepends a per-question-type FORMAT hint to the
|
|
371
|
+
* injection prompt so the answer LLM produces structured output that
|
|
372
|
+
* matches the query shape (e.g. ordered lists, yes/no, prose).
|
|
373
|
+
* Default false. Env: ANSWER_FORMAT_ALIGNMENT_ENABLED=true
|
|
374
|
+
*/
|
|
375
|
+
answerFormatAlignmentEnabled: boolean;
|
|
376
|
+
/**
|
|
377
|
+
* Event-chain packaging (EO fix — data-driven detector). When true,
|
|
378
|
+
* `buildInjection` prepends a `## EVENT_CHAIN` block listing the
|
|
379
|
+
* chronological chain with the highest score detected in the retrieved
|
|
380
|
+
* top-K. The detector fires regardless of query phrasing — it inspects
|
|
381
|
+
* the retrieved data for 3+ memories sharing an entity across 3+ distinct
|
|
382
|
+
* observed_at dates. Default false (ships behind flag for incremental
|
|
383
|
+
* validation). Env: EVENT_CHAIN_PACKAGING_ENABLED=true
|
|
384
|
+
*/
|
|
385
|
+
eventChainPackagingEnabled: boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Reflect channel — query-time reflection retrieval (BEAM-0.85 Phase 1,
|
|
388
|
+
* Task 1.9). When true, after RRF + reranking produce the selected memories,
|
|
389
|
+
* the search pipeline also embeds the query and fetches top-K reflections
|
|
390
|
+
* from session_reflections. The result is threaded downstream to
|
|
391
|
+
* retrieval-format as a parallel signal alongside chainResult.
|
|
392
|
+
* Gated by question type (SUMMARY, CONTRADICTION, PREFERENCE, NUMERIC_COUNT,
|
|
393
|
+
* EXACT_DATE, ORDERED_LIST — see reflect-retrieval.ts ROUTED_TYPES).
|
|
394
|
+
* Default false. Env: REFLECT_ENABLED=true
|
|
395
|
+
*/
|
|
396
|
+
reflectEnabled: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Top-K reflections to fetch when reflect retrieval is enabled.
|
|
399
|
+
* Default 3. Env: REFLECT_RETRIEVAL_TOP_K=3
|
|
400
|
+
*/
|
|
401
|
+
reflectRetrievalTopK: number;
|
|
402
|
+
/**
|
|
403
|
+
* Anthropic model used by the reflect worker for observation generation.
|
|
404
|
+
* Default 'claude-sonnet-4-5'. Env: REFLECT_MODEL=<model-id>
|
|
405
|
+
*/
|
|
406
|
+
reflectModel: string;
|
|
407
|
+
/**
|
|
408
|
+
* Maximum observations per conversation the reflect worker will persist.
|
|
409
|
+
* Default 12. Env: REFLECT_MAX_OBSERVATIONS=12
|
|
410
|
+
*/
|
|
411
|
+
reflectMaxObservations: number;
|
|
412
|
+
/**
|
|
413
|
+
* Polling interval (ms) for the reflect background worker.
|
|
414
|
+
* Default 5000. Env: REFLECT_JOB_POLL_MS=5000
|
|
415
|
+
*/
|
|
416
|
+
reflectJobPollMs: number;
|
|
417
|
+
/**
|
|
418
|
+
* Debounce delay (ms) before a reflect job becomes eligible for processing.
|
|
419
|
+
* Not enforced in v1 worker but reserved for future use.
|
|
420
|
+
* Default 60000. Env: REFLECT_DEBOUNCE_MS=60000
|
|
421
|
+
*/
|
|
422
|
+
reflectDebounceMs: number;
|
|
423
|
+
/**
|
|
424
|
+
* Dev/test-only: when true, PUT /v1/memories/config mutates the runtime
|
|
425
|
+
* singleton. Production deploys leave this unset (false) — the route
|
|
426
|
+
* returns 410 Gone. Startup-validated; routes read the memoized value
|
|
427
|
+
* through configRouteAdapter, never re-check at request time.
|
|
428
|
+
*/
|
|
429
|
+
runtimeConfigMutationEnabled: boolean;
|
|
430
|
+
/**
|
|
431
|
+
* Phase 2 specialists gate (BEAM-0.85 Phase 2). When true, the specialist
|
|
432
|
+
* dispatcher runs after RRF + reranking produce top-K memories. The first
|
|
433
|
+
* specialist that matches the query pattern AND returns handled=true
|
|
434
|
+
* short-circuits the shared spine — its answer replaces the LLM output.
|
|
435
|
+
* Ingest-side: extractLiteralsFromFact runs fire-and-forget per new
|
|
436
|
+
* memory to populate entity_values for the IE/KU SQL lookup.
|
|
437
|
+
* Priority: CR → TR → MSR → IE/KU → shared spine.
|
|
438
|
+
* Default false. Env: PHASE2_SPECIALISTS_ENABLED=true
|
|
439
|
+
*/
|
|
440
|
+
phase2SpecialistsEnabled: boolean;
|
|
441
|
+
/**
|
|
442
|
+
* Master gate for all three abstention-rescue interventions.
|
|
443
|
+
* Compensates for Haiku over-abstention: the model writes answers like
|
|
444
|
+
* "context does not contain information (March 10, 2024)" — citing the
|
|
445
|
+
* answer while claiming not to find it.
|
|
446
|
+
* Interventions (all gated here):
|
|
447
|
+
* 1. Confidence prefix — prepended to injectionText on every call.
|
|
448
|
+
* 2. Iterative retrieval — second retrieval pass with extracted keywords
|
|
449
|
+
* when the first answer abstains and retrieval was non-empty.
|
|
450
|
+
* 3. Sonnet rescue — retry with Sonnet if Haiku still abstains.
|
|
451
|
+
* Default false. Env: ABSTENTION_RESCUE_ENABLED=true
|
|
452
|
+
*/
|
|
453
|
+
abstentionRescueEnabled: boolean;
|
|
454
|
+
/** Top-K for the iterative-retrieval rescue pass. Default 8. Env: ABSTENTION_RESCUE_RETRIEVE_K */
|
|
455
|
+
abstentionRescueRetrieveK: number;
|
|
456
|
+
/** Model used for the Sonnet rescue step. Default 'claude-sonnet-4-5'. Env: ABSTENTION_RESCUE_SONNET_MODEL */
|
|
457
|
+
abstentionRescueSonnetModel: string;
|
|
458
|
+
/**
|
|
459
|
+
* Per-question-type adaptive confidence prefix (v36). When true, the forced
|
|
460
|
+
* FORBIDDEN-abstention prefix only applies to SUMMARY/PREFERENCE/
|
|
461
|
+
* NUMERIC_COUNT/EXACT_DATE (where v34 showed +0.09 to +0.27 lifts); a soft
|
|
462
|
+
* prefix (rubric phrasing + KU temporal anchor, no FORBIDDEN block) applies
|
|
463
|
+
* to ORDERED_LIST/CONTRADICTION/OTHER (where v34 regressed −0.13 to −0.22
|
|
464
|
+
* by fabricating); ABSTAIN passes through unchanged. Requires
|
|
465
|
+
* `abstentionRescueEnabled=true`. Default false. Env:
|
|
466
|
+
* CONFIDENCE_PREFIX_ADAPTIVE_ENABLED=true
|
|
467
|
+
*/
|
|
468
|
+
confidencePrefixAdaptiveEnabled: boolean;
|
|
469
|
+
/**
|
|
470
|
+
* KU recency sort (v42). When true, NUMERIC_COUNT queries that ALSO match
|
|
471
|
+
* the KU-style framing pattern (isKuStyleQuery) reorder packaged retrieval
|
|
472
|
+
* by observed_at DESC before injection — so the answer LLM sees the most
|
|
473
|
+
* recent measurement first. Targets BEAM KU Mode B (wrong-value-forced)
|
|
474
|
+
* where Haiku picks the earlier of two competing values. Default false.
|
|
475
|
+
* Env: KU_RECENCY_SORT_ENABLED=true
|
|
476
|
+
*/
|
|
477
|
+
kuRecencySortEnabled: boolean;
|
|
478
|
+
/**
|
|
479
|
+
* MSR cross-conversation aggregator (v39-multihop). When true, queries
|
|
480
|
+
* classified as multi-session-reasoning (regex via `msr-detector.ts`) get
|
|
481
|
+
* an extra `## CROSS-SESSION SUMMARY` channel inserted before the standard
|
|
482
|
+
* OBSERVATIONS / TIMELINE / ENTITY_STATE blocks. Retrieved memories are
|
|
483
|
+
* grouped by `episode_id`; groups with >=2 memories are summarized via the
|
|
484
|
+
* configured chat LLM (default Haiku, ~30 tokens each); 1-memory groups
|
|
485
|
+
* pass through verbatim. Targets BEAM MSR (v36: 0.156/0.172) where gold
|
|
486
|
+
* facts span 2-4 conversations and the answer LLM cannot synthesize across
|
|
487
|
+
* them. Fail-closed on summary errors. Default false. Env:
|
|
488
|
+
* MSR_AGGREGATOR_ENABLED=true
|
|
489
|
+
*/
|
|
490
|
+
msrAggregatorEnabled: boolean;
|
|
491
|
+
/**
|
|
492
|
+
* Always-on ENTITY_CARD channel (BEAM-0.85 — Honcho parity). When true,
|
|
493
|
+
* the Reflect worker synthesizes per-entity summary cards alongside the
|
|
494
|
+
* existing observations, and the search pipeline injects all cards for
|
|
495
|
+
* the active conversation under `## ENTITY_STATE` at the top of every
|
|
496
|
+
* answer-LLM prompt. Default false. Env: ENTITY_CARD_ENABLED=true
|
|
497
|
+
*/
|
|
498
|
+
entityCardEnabled: boolean;
|
|
499
|
+
/** Max entity cards synthesized per Reflect run. Default 5. Env: ENTITY_CARD_MAX_PER_SESSION */
|
|
500
|
+
entityCardMaxPerSession: number;
|
|
501
|
+
/**
|
|
502
|
+
* Minimum observations an entity needs in a Reflect run before its card
|
|
503
|
+
* is synthesized. Default 3. Env: ENTITY_CARD_MIN_OBSERVATIONS
|
|
504
|
+
*/
|
|
505
|
+
entityCardMinObservations: number;
|
|
506
|
+
/**
|
|
507
|
+
* AUDN bilateral preservation for contradictions (BEAM CR fix). When true,
|
|
508
|
+
* AUDN's DELETE and SUPERSEDE outcomes are replaced by a bilateral path
|
|
509
|
+
* that keeps BOTH the prior memory and the new memory in `memories`,
|
|
510
|
+
* marks both with `contradiction_active=true` and bidirectional
|
|
511
|
+
* `contradicts_memory_id`, and records the pair in
|
|
512
|
+
* `memory_contradictions`. Targets the BEAM `contradiction_resolution`
|
|
513
|
+
* rubric, which requires the answer to quote BOTH sides verbatim.
|
|
514
|
+
* Default false. Env: CONTRADICTION_PRESERVATION_ENABLED=true
|
|
515
|
+
*/
|
|
516
|
+
contradictionPreservationEnabled: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* Retrieval-side surfacing of contradictions (BEAM CR fix). When true,
|
|
519
|
+
* after top-K assembly the search pipeline enriches the result set:
|
|
520
|
+
* - any memory in top-K with `contradiction_active=true` has its
|
|
521
|
+
* counterpart (`contradicts_memory_id`) injected into the final set,
|
|
522
|
+
* - a `## CONTRADICTIONS_DETECTED` section listing both sides verbatim
|
|
523
|
+
* is prepended to the injection text.
|
|
524
|
+
* Independent of `contradictionPreservationEnabled` so the retrieval
|
|
525
|
+
* lift can be measured against pre-existing contradiction state.
|
|
526
|
+
* Default false. Env: CONTRADICTION_SURFACING_ENABLED=true
|
|
527
|
+
*/
|
|
528
|
+
contradictionSurfacingEnabled: boolean;
|
|
529
|
+
/**
|
|
530
|
+
* BEAM v38: temporal state layer (focused Mem0 temporal-reasoning subset).
|
|
531
|
+
* When true:
|
|
532
|
+
* - At ingest, an LLM classifier tags each stored memory with a stable
|
|
533
|
+
* `state_key` for stateful facts (e.g. "user lives in Austin"); newly
|
|
534
|
+
* stored stateful memories supersede prior memories with the same key
|
|
535
|
+
* by setting their `event_end` to the new `event_start`.
|
|
536
|
+
* - At read, a regex-based intent classifier flags CURRENT_STATE
|
|
537
|
+
* queries; the retrieval pipeline reranks candidates so memories with
|
|
538
|
+
* active state (`event_end IS NULL`) outrank superseded ones.
|
|
539
|
+
* Targets the KU rubric (currently 0.25). Fail-closed: supersede UPDATE
|
|
540
|
+
* failures abort the ingest. Default false. Env: TEMPORAL_STATE_ENABLED=true
|
|
541
|
+
*/
|
|
542
|
+
temporalStateEnabled: boolean;
|
|
543
|
+
/**
|
|
544
|
+
* Document raw-content retention mode. `pointer_only` registers
|
|
545
|
+
* external references; `managed_blob` stores bytes through the
|
|
546
|
+
* configured raw-storage provider. `inline_small_text` is reserved.
|
|
547
|
+
*/
|
|
548
|
+
rawStorageMode: RawStorageMode;
|
|
549
|
+
/**
|
|
550
|
+
* Adapter behind `rawStorageMode = 'managed_blob'`. NULL for the
|
|
551
|
+
* pointer-only path; required at startup when `rawStorageMode =
|
|
552
|
+
* 'managed_blob'`. No fallback — misconfigured setups fail closed.
|
|
553
|
+
*/
|
|
554
|
+
rawStorageProvider: RawStorageProvider | null;
|
|
555
|
+
/** Optional global path prefix (e.g. `prod/core`) applied to every key. */
|
|
556
|
+
rawStoragePrefix: string;
|
|
557
|
+
/** Provider-specific options. Always populated, validated at startup. */
|
|
558
|
+
rawStorageLocalFsRoot: string | null;
|
|
559
|
+
rawStorageS3Bucket: string | null;
|
|
560
|
+
rawStorageS3Region: string | null;
|
|
561
|
+
rawStorageS3Endpoint: string | null;
|
|
562
|
+
rawStorageS3AccessKeyId: string | null;
|
|
563
|
+
rawStorageS3SecretAccessKey: string | null;
|
|
564
|
+
/** Per-request upload size cap for `PUT /v1/documents/:id/raw`. */
|
|
565
|
+
rawUploadMaxBytes: number;
|
|
566
|
+
/** Content codec applied between the upload service and the raw-content adapter. */
|
|
567
|
+
rawContentCodec: RawContentCodecName;
|
|
568
|
+
/**
|
|
569
|
+
* Parsed keyring entries keyed by operator-assigned id. Required and
|
|
570
|
+
* non-empty when `rawContentCodec='aes_gcm'`. Each value is a 32-byte
|
|
571
|
+
* key. Keys are kept in the ring so old rows stay decodable after
|
|
572
|
+
* rotation; new writes use `rawContentCodecActiveKeyId`.
|
|
573
|
+
*/
|
|
574
|
+
rawContentCodecKeys: ReadonlyMap<string, Buffer>;
|
|
575
|
+
/** Key id chosen for NEW encode operations. Must reference an entry in the ring. */
|
|
576
|
+
rawContentCodecActiveKeyId: string | null;
|
|
577
|
+
/** Required at startup; drives fail-closed policy in cross-validation. */
|
|
578
|
+
rawStorageDeploymentEnv: RawStorageDeploymentEnv;
|
|
579
|
+
/**
|
|
580
|
+
* Parsed Synapse-shaped Filecoin provider config. Populated only
|
|
581
|
+
* when `rawStorageProvider === 'filecoin'`; `null` otherwise. The
|
|
582
|
+
* cross-provider guard in `validateRawStorageConfig` rejects any
|
|
583
|
+
* `RAW_STORAGE_FILECOIN_*` env var on non-filecoin deployments
|
|
584
|
+
* before this field is computed, so the operator cannot leave
|
|
585
|
+
* stale Filecoin knobs lying around.
|
|
586
|
+
*/
|
|
587
|
+
filecoinProvider: FilecoinProviderConfig | null;
|
|
588
|
+
/**
|
|
589
|
+
* CSV of legacy providers kept registered as read-only stores so the
|
|
590
|
+
* cleanup-time registry can dispatch DELETEs against historical rows
|
|
591
|
+
* after the active provider has been switched. Validated for env-block
|
|
592
|
+
* completeness at startup. Never contains the active provider.
|
|
593
|
+
*/
|
|
594
|
+
rawStorageLegacyProviders: ReadonlyArray<RawStorageProvider>;
|
|
595
|
+
/**
|
|
596
|
+
* Closed allowlist of pointer-mode URI schemes the direct storage
|
|
597
|
+
* API accepts. Defaults to the safe set `https://, s3://, gs://,
|
|
598
|
+
* ipfs://`. Operators can opt in `http://` and `local-fs://` via
|
|
599
|
+
* `RAW_STORAGE_POINTER_URI_SCHEMES` (csv). Unknown tokens fail
|
|
600
|
+
* closed at startup. The server NEVER fetches pointer URIs — this
|
|
601
|
+
* is downstream-consumer hygiene, not SSRF defence.
|
|
602
|
+
*/
|
|
603
|
+
rawStoragePointerUriSchemes: ReadonlyArray<PointerUriScheme>;
|
|
604
|
+
}
|
|
605
|
+
/** Closed set of pointer-mode URI schemes operators can allowlist. */
|
|
606
|
+
export type PointerUriScheme = 'https' | 's3' | 'gs' | 'ipfs' | 'http' | 'local-fs';
|
|
607
|
+
/** Production providers backing `rawStorageMode='managed_blob'`. */
|
|
608
|
+
export type RawStorageProvider = 'local_fs' | 's3' | 'filecoin';
|
|
609
|
+
/**
|
|
610
|
+
* Fields accepted by `updateRuntimeConfig()`. Provider/model selection
|
|
611
|
+
* (embeddingProvider, embeddingModel, voyage*, llmProvider, llmModel) is
|
|
612
|
+
* intentionally absent: embedding.ts and llm.ts cache stateful provider
|
|
613
|
+
* instances at first call, so mid-flight mutation never took effect in v1.
|
|
614
|
+
* Freezing these as composition-time config is a bug fix. Server deployments
|
|
615
|
+
* still use env-backed startup config; isolated harnesses can pass an explicit
|
|
616
|
+
* RuntimeConfig to createCoreRuntime({ config }).
|
|
617
|
+
*/
|
|
618
|
+
export interface RuntimeConfigUpdates {
|
|
619
|
+
similarityThreshold?: number;
|
|
620
|
+
audnCandidateThreshold?: number;
|
|
621
|
+
clarificationConflictThreshold?: number;
|
|
622
|
+
maxSearchResults?: number;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Cross-field guard for the raw-storage knobs. Runs once at startup and
|
|
626
|
+
* fails closed when `managed_blob` is enabled without the provider
|
|
627
|
+
* fields the chosen adapter needs. No default values, no fallback
|
|
628
|
+
* provider — misconfiguration must surface deterministically per the
|
|
629
|
+
* Phase-3 plan.
|
|
630
|
+
*/
|
|
631
|
+
export interface RawStorageValidationInput {
|
|
632
|
+
mode: RawStorageMode;
|
|
633
|
+
provider: RawStorageProvider | null;
|
|
634
|
+
prefix: string;
|
|
635
|
+
localFsRoot: string | null;
|
|
636
|
+
s3Bucket: string | null;
|
|
637
|
+
s3Region: string | null;
|
|
638
|
+
s3AccessKeyId: string | null;
|
|
639
|
+
s3SecretAccessKey: string | null;
|
|
640
|
+
codec: RawContentCodecName;
|
|
641
|
+
codecKeys: ReadonlyMap<string, Buffer>;
|
|
642
|
+
codecActiveKeyId: string | null;
|
|
643
|
+
deploymentEnv: RawStorageDeploymentEnv;
|
|
644
|
+
legacyProviders: ReadonlyArray<RawStorageProvider>;
|
|
645
|
+
/**
|
|
646
|
+
* Names of `RAW_STORAGE_FILECOIN_*` env vars the operator set to a
|
|
647
|
+
* non-empty value, computed by
|
|
648
|
+
* `collectFilecoinProviderEnvKeys(process.env)` in `src/config.ts`.
|
|
649
|
+
* The cross-provider guard in `validateRawStorageConfig` rejects
|
|
650
|
+
* any non-empty list when `provider !== 'filecoin'`. Tests pass a
|
|
651
|
+
* fixed array directly.
|
|
652
|
+
*/
|
|
653
|
+
filecoinEnvKeysSet: ReadonlyArray<string>;
|
|
654
|
+
}
|
|
655
|
+
export declare function validateRawStorageConfig(args: RawStorageValidationInput): void;
|
|
656
|
+
export declare const config: RuntimeConfig;
|
|
657
|
+
export declare function applyRuntimeConfigUpdates(target: RuntimeConfig, updates: RuntimeConfigUpdates): string[];
|
|
658
|
+
export declare function updateRuntimeConfig(updates: RuntimeConfigUpdates): string[];
|
|
659
|
+
/**
|
|
660
|
+
* Public/supported operator config surface. Fields listed here are part of
|
|
661
|
+
* v2's stable contract: consumers can rely on their semantics and presence,
|
|
662
|
+
* and changes go through a documented deprecation cycle.
|
|
663
|
+
*
|
|
664
|
+
* This is a documentation type — it does not constrain threading. The runtime
|
|
665
|
+
* still carries a single `RuntimeConfig` object; this array tags the public
|
|
666
|
+
* subset so docs, tests, and future config-split work have a single source of
|
|
667
|
+
* truth. See also: https://docs.atomicmemory.ai/platform/consuming-core.
|
|
668
|
+
*/
|
|
669
|
+
export declare const SUPPORTED_RUNTIME_CONFIG_FIELDS: readonly ["databaseUrl", "openaiApiKey", "coreApiKey", "storageKeyHmacSecret", "port", "embeddingProvider", "embeddingModel", "embeddingDimensions", "embeddingApiUrl", "embeddingApiKey", "voyageApiKey", "voyageDocumentModel", "voyageQueryModel", "llmProvider", "llmModel", "llmApiUrl", "llmApiKey", "groqApiKey", "anthropicApiKey", "googleApiKey", "ollamaBaseUrl", "vectorBackend", "skipVectorIndexes", "llmSeed", "crossEncoderModel", "crossEncoderDtype", "maxSearchResults", "retrievalProfile", "retrievalProfileSettings", "entityGraphEnabled", "lessonsEnabled", "agenticRetrievalEnabled", "iterativeRetrievalEnabled", "hybridSearchEnabled", "repairLoopEnabled", "crossEncoderEnabled", "auditLoggingEnabled", "adaptiveRetrievalEnabled", "consensusValidationEnabled", "namespaceClassificationEnabled", "extractionCacheDir", "costLogDir", "costRunId", "costLoggingEnabled", "runtimeConfigMutationEnabled"];
|
|
670
|
+
/**
|
|
671
|
+
* Internal policy config — experimental / tuning flags. Fields here may
|
|
672
|
+
* change semantics, defaults, or be removed without notice. Consumers should
|
|
673
|
+
* NOT rely on these in production. Promoted into the supported contract when
|
|
674
|
+
* a field's behavior stabilizes.
|
|
675
|
+
*/
|
|
676
|
+
export declare const INTERNAL_POLICY_CONFIG_FIELDS: readonly ["similarityThreshold", "audnCandidateThreshold", "audnSafeReuseMinSimilarity", "crossAgentCandidateThreshold", "clarificationConflictThreshold", "repairLoopMinSimilarity", "repairSkipSimilarity", "repairDeltaThreshold", "repairConfidenceFloor", "adaptiveSimpleLimit", "adaptiveMediumLimit", "adaptiveComplexLimit", "adaptiveMultiHopLimit", "adaptiveAggregationLimit", "mmrEnabled", "mmrLambda", "linkExpansionEnabled", "linkExpansionMax", "linkSimilarityThreshold", "linkExpansionBeforeMMR", "scoringWeightSimilarity", "scoringWeightImportance", "scoringWeightRecency", "pprEnabled", "pprDamping", "stagedLoadingEnabled", "retrievalTraceEnabled", "ingestTraceDir", "ingestTraceEnabled", "extractionCacheEnabled", "embeddingCacheEnabled", "chunkedExtractionEnabled", "chunkedExtractionFallbackEnabled", "chunkSizeTurns", "chunkOverlapTurns", "consensusExtractionEnabled", "consensusExtractionRuns", "observationDateExtractionEnabled", "quotedEntityExtractionEnabled", "entropyGateEnabled", "entropyGateThreshold", "entropyGateAlpha", "affinityClusteringThreshold", "affinityClusteringMinSize", "affinityClusteringBeta", "affinityClusteringTemporalLambda", "trustScoringEnabled", "trustScoreMinThreshold", "trustPenaltyEnabled", "decayCycleEnabled", "decayRetentionThreshold", "decayMinAgeDays", "memoryCapEnabled", "memoryCapMax", "memoryCapWarnRatio", "entityResolutionThreshold", "entitySearchMinSimilarity", "lessonSimilarityThreshold", "consensusMinMemories", "queryExpansionEnabled", "queryExpansionMinSimilarity", "queryAugmentationEnabled", "queryAugmentationMaxEntities", "queryAugmentationMinSimilarity", "rerankSkipTopSimilarity", "rerankSkipMinGap", "literalListProtectionEnabled", "literalListProtectionMaxProtected", "temporalQueryConstraintEnabled", "temporalQueryConstraintBoost", "fastAudnEnabled", "fastAudnDuplicateThreshold", "observationNetworkEnabled", "deferredAudnEnabled", "deferredAudnBatchSize", "compositeGroupingEnabled", "compositeMinClusterSize", "compositeMaxClusterSize", "compositeSimilarityThreshold", "conflictAutoResolveMs", "tbcEnabled", "hierarchicalRetrievalEnabled", "topicAbstractionEnabled", "topicSearchEnabled", "rerankerEnabled", "rerankerTopN", "recapLayerEnabled", "recapMinClusterSize", "recapSearchEnabled", "recapClusterPivot", "counterEvidenceEnabled", "packagingUseObservedAt", "packagingDualDate", "timelineChannelEnabled", "answerOnlyRetrievalFilter", "retrievalDedupEnabled", "keywordRrfWeight", "entityAttributesEnabled", "entityAttributesTopK", "userProfileChannelEnabled", "episodesChannelEnabled", "episodesChannelTopK", "verifierPassEnabled", "answerFormatAlignmentEnabled", "eventChainPackagingEnabled", "reflectEnabled", "reflectRetrievalTopK", "reflectModel", "reflectMaxObservations", "reflectJobPollMs", "reflectDebounceMs", "phase2SpecialistsEnabled", "abstentionRescueEnabled", "abstentionRescueRetrieveK", "abstentionRescueSonnetModel", "confidencePrefixAdaptiveEnabled", "kuRecencySortEnabled", "msrAggregatorEnabled", "entityCardEnabled", "entityCardMaxPerSession", "entityCardMinObservations", "contradictionPreservationEnabled", "contradictionSurfacingEnabled", "temporalStateEnabled", "rawStorageMode", "rawStorageProvider", "rawStoragePrefix", "rawStorageLocalFsRoot", "rawStorageS3Bucket", "rawStorageS3Region", "rawStorageS3Endpoint", "rawStorageS3AccessKeyId", "rawStorageS3SecretAccessKey", "rawUploadMaxBytes", "rawContentCodec", "rawContentCodecKeys", "rawContentCodecActiveKeyId", "rawStorageDeploymentEnv", "filecoinProvider", "rawStorageLegacyProviders", "rawStoragePointerUriSchemes"];
|
|
677
|
+
export type SupportedRuntimeConfigField = typeof SUPPORTED_RUNTIME_CONFIG_FIELDS[number];
|
|
678
|
+
export type InternalPolicyConfigField = typeof INTERNAL_POLICY_CONFIG_FIELDS[number];
|
|
679
|
+
export type SupportedRuntimeConfig = Pick<RuntimeConfig, SupportedRuntimeConfigField>;
|
|
680
|
+
export type InternalPolicyConfig = Pick<RuntimeConfig, InternalPolicyConfigField>;
|