@agentic-kernel/memory-postgres
v0.9.0
Published
PostgreSQL-backed long-term `MemoryManager` — scoped retrieval, provenance, and supersede/tombstone lifecycle — through a host-injected pg-compatible client.
Readme
@agentic-kernel/memory-postgres
PostgreSQL-backed long-term MemoryManager — scoped retrieval, provenance, and supersede/tombstone lifecycle — through a host-injected pg-compatible client.
Part of Agentic Kernel — a microkernel agent runtime, feature-paired across TypeScript and Python.
Install
npm install @agentic-kernel/memory-postgresUsage
import { PostgresMemory } from "@agentic-kernel/memory-postgres";
const memory = new PostgresMemory({ client });See the documentation site for guides and the full API.
Recommended indexes
Retrieval filters on scope + lifecycle and orders by coalesce(score, 0) desc,
created_at desc; the optional text filter is a content ILIKE '%…%', which a
btree cannot serve. On non-trivial tables create (default table agent_memory):
-- scope + ranking (serves the retrieve() filter/order)
create index if not exists agent_memory_scope_rank
on agent_memory (scope, (coalesce(score, 0)) desc, created_at desc)
where tombstoned_at is null;
-- substring matching for the text filter (requires the pg_trgm extension)
create extension if not exists pg_trgm;
create index if not exists agent_memory_content_trgm
on agent_memory using gin (content gin_trgm_ops);License
Apache-2.0
