agentfootprint
Version:
The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.
84 lines • 6.97 kB
JavaScript
;
/**
* memory-providers — memory store adapters.
*
* RedisStore, AgentCoreStore, sqliteVectorStore, pgVectorStore, s3VectorsStore
* and future stores (DynamoDB, Pinecone, …) all live here — a new store adds an
* export, never a new import path.
*
* Pattern: Adapter (GoF) — each store translates the `MemoryStore`
* interface onto a specific backend (Redis, DynamoDB-style
* AWS Bedrock AgentCore Memory, etc.).
* Role: Outer ring (Hexagonal). All store adapters lazy-require
* their vendor SDKs at construction time, so importing this
* barrel costs ZERO peer-dep load — only the stores you
* actually instantiate pull their SDK in.
*
* @example
* import { RedisStore, AgentCoreStore } from 'agentfootprint/memory';
*
* Not an import path of its own since 9.0.0. This is the implementation barrel
* behind `agentfootprint/memory`, which re-exports every name here — same
* symbols, one door. Import from the door.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.BedrockAgentMemory = exports.s3VectorsStore = exports.PgVectorSchemaError = exports.pgVectorStore = exports.EmbedderMismatchError = exports.SqliteUnavailableError = exports.UnreadableIndexFileError = exports.sqliteVectorStore = exports.scoreFromDistance = exports.MAX_CARRIED_JSON = exports.MAX_PAGE_SIZE = exports.MemoryBankStore = exports.memoryBankStore = exports.agentCoreNamespaceValue = exports.UnreadableMemoryEntryError = exports.AgentCoreStore = exports.RedisStore = void 0;
// Lazy-required peer-dep stores. Both adapters defer their vendor SDK
// `require()` to constructor time; importing this barrel doesn't load
// `ioredis` or `@aws-sdk/client-bedrock-agent-runtime`.
var redis_js_1 = require("./adapters/memory/redis.js");
Object.defineProperty(exports, "RedisStore", { enumerable: true, get: function () { return redis_js_1.RedisStore; } });
var agentcore_js_1 = require("./adapters/memory/agentcore.js");
Object.defineProperty(exports, "AgentCoreStore", { enumerable: true, get: function () { return agentcore_js_1.AgentCoreStore; } });
Object.defineProperty(exports, "UnreadableMemoryEntryError", { enumerable: true, get: function () { return agentcore_js_1.UnreadableMemoryEntryError; } });
// A tenant id in the alphabet AgentCore admits for a namespace variable,
// one-to-one — what `defineMemory({ namespaceScope })` and `searchNamespace` map with.
Object.defineProperty(exports, "agentCoreNamespaceValue", { enumerable: true, get: function () { return agentcore_js_1.agentCoreNamespaceValue; } });
// Vertex AI Memory Bank — a NATURAL-LANGUAGE memory service, not a vector
// store: it declares `supportsVectorSearch: false` and `ranksBy: 'server-text'`
// so the corpus builders refuse it by name, and it converts the service's
// DISTANCE (smaller is closer) rather than forwarding it as a similarity
// (higher is closer). Read the module header before the first write: `scope` is
// immutable, so the convention cannot be changed afterwards. An entry's
// `source`, caller `metadata` and `decayPolicy` are CARRIED (9.30.0) — a field
// trial caught 9.29.0 accepting and silently dropping them.
var memoryBank_js_1 = require("./adapters/memory/memoryBank.js");
Object.defineProperty(exports, "memoryBankStore", { enumerable: true, get: function () { return memoryBank_js_1.memoryBankStore; } });
Object.defineProperty(exports, "MemoryBankStore", { enumerable: true, get: function () { return memoryBank_js_1.MemoryBankStore; } });
Object.defineProperty(exports, "MAX_PAGE_SIZE", { enumerable: true, get: function () { return memoryBank_js_1.MAX_PAGE_SIZE; } });
Object.defineProperty(exports, "MAX_CARRIED_JSON", { enumerable: true, get: function () { return memoryBank_js_1.MAX_CARRIED_JSON; } });
Object.defineProperty(exports, "scoreFromDistance", { enumerable: true, get: function () { return memoryBank_js_1.scoreFromDistance; } });
// A durable vector index in one SQLite file — zero dependencies (node:sqlite is
// inside Node), exact search, and the corpus embedded once rather than on every
// restart. Lazy-loads `node:sqlite` at construction, so importing this barrel
// costs nothing for consumers who never build one.
var sqliteVector_js_1 = require("./adapters/memory/sqliteVector.js");
Object.defineProperty(exports, "sqliteVectorStore", { enumerable: true, get: function () { return sqliteVector_js_1.sqliteVectorStore; } });
Object.defineProperty(exports, "UnreadableIndexFileError", { enumerable: true, get: function () { return sqliteVector_js_1.UnreadableIndexFileError; } });
// The SAME refusal `sqliteSessions` raises for the same missing module — one
// class, so catching it does not require knowing which store was being built.
var sqliteUnavailable_js_1 = require("./lib/sqliteUnavailable.js");
Object.defineProperty(exports, "SqliteUnavailableError", { enumerable: true, get: function () { return sqliteUnavailable_js_1.SqliteUnavailableError; } });
// ONE refusal for every store that can tell a vector met an index built by a
// different embedder (9.3.0). It lived in sqliteVector.ts from 8.9.0; when
// pgVectorStore and s3VectorsStore learned the same check it moved to lib/, so
// `catch (e) { if (e instanceof EmbedderMismatchError) }` cannot depend on
// which store threw. The old import path still works.
var embedderMismatch_js_1 = require("./lib/embedderMismatch.js");
Object.defineProperty(exports, "EmbedderMismatchError", { enumerable: true, get: function () { return embedderMismatch_js_1.EmbedderMismatchError; } });
// Postgres + pgvector: the corpus beside the application's own data, inheriting
// its backups, failover and access control. `pg` is lazy-required at the first
// call — pass `client` to reuse the pool your app already has.
var pgVector_js_1 = require("./adapters/memory/pgVector.js");
Object.defineProperty(exports, "pgVectorStore", { enumerable: true, get: function () { return pgVector_js_1.pgVectorStore; } });
Object.defineProperty(exports, "PgVectorSchemaError", { enumerable: true, get: function () { return pgVector_js_1.PgVectorSchemaError; } });
// Amazon S3 Vectors: a durable corpus with nothing to run, that can be added to
// from a cron job rather than at the next deploy. Lazy-requires
// `@aws-sdk/client-s3vectors` at the first call.
var s3Vectors_js_1 = require("./adapters/memory/s3Vectors.js");
Object.defineProperty(exports, "s3VectorsStore", { enumerable: true, get: function () { return s3Vectors_js_1.s3VectorsStore; } });
// Read-only reader for the legacy Bedrock Agents auto session-summary memory.
// NOT a MemoryStore (Bedrock owns the writes) — see the class docstring.
var bedrockAgentMemory_js_1 = require("./adapters/memory/bedrockAgentMemory.js");
Object.defineProperty(exports, "BedrockAgentMemory", { enumerable: true, get: function () { return bedrockAgentMemory_js_1.BedrockAgentMemory; } });
//# sourceMappingURL=memory-providers.js.map