pgmnemo AGENTS.md

Integration instructions for pgmnemo, a PostgreSQL extension that stores and retrieves an AI agent's memories inside an existing PostgreSQL database. PostgreSQL is a database system, and an extension adds functions to it.

In plain words
What is it for?
Use them when deciding whether to adopt pgmnemo, installing it with SQL, integrating memory storage and retrieval, or measuring its use.
Why use it?
They explain how to avoid scattering agent memories across separate search and storage systems and how to keep memory data in the database you control.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/pgmnemo/pgmnemo/agents-md
Clone the repo
git clone --depth 1 https://github.com/pgmnemo/pgmnemo

Made for: Codex, OpenCode.

Per session 8,496 This file is loaded in full into every session.
When invoked 8,496 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.08496 $0.08496
Opus 5 $0.04248 $0.04248
Sonnet 5 $0.01699 $0.01699
Haiku 4.5 $0.00850 $0.00850

Measured yesterday against content hash 106256b515bd, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

pgmnemo AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 800 lines

How it starts

The opening of the file, as written. The whole thing — 800 lines — stays where its author put it; the contents beside it link to each section on GitHub.

pgmnemo — Agent Integration Guide

Version: 0.8.0
License: Apache-2.0
Install: CREATE EXTENSION pgmnemo CASCADE in your existing PostgreSQL database.

This document is the canonical reference for an AI agent or developer evaluating or integrating pgmnemo. One read covers: what it is, when to adopt it, every capability with working SQL, and how to measure adoption ROI.


1. What pgmnemo is — and the problem it solves

The problem

AI agents accumulate memory — lessons, observations, summaries, decisions — that must persist across runs and be recalled at query time. The dominant approaches each introduce the same failure cluster:

Symptom Root cause
Scattered stores, split query plans Vector search, keyword search, graph edges, and metadata filters live in separate systems. Final ranking happens in application code. No single EXPLAIN shows why a memory ranked first.
Data egress on every write Cloud memory APIs send observations to vendor infrastructure for LLM-powered fact extraction (~$0.17–$0.36 per 1,000 writes). Every write crosses a trust boundary you don't own.
Context-token bloat Retrieval without budget discipline returns full lesson texts for everything above a score threshold. Agents receive 8,000 tokens of memory and use 200.
Opaque ranking Score = some float from a black box. You cannot EXPLAIN it, regression-test it, or tune it without guess-and-check.
Hallucinated memory accumulates silently No write-path enforcement links a memory to a verifiable artifact. Broken agent runs produce plausible-but-wrong memories that survive all future recalls.

The solution: single-plan multimodal fusion inside your existing Postgres

pgmnemo is a PostgreSQL extension (CREATE EXTENSION pgmnemo CASCADE) — no separate service, no API key, no new container.

It ranks across four retrieval channels inside one SQL query plan:

HNSW vector search (pgvector)
  + BM25 full-text (tsvector / GIN index)
  + graph-edge proximity (mem_edge BFS, causal + temporal)
  + JSONB metadata predicate pushdown (GIN index)
  + relational filters (role, project_id, state, verified_at)

Read the full file on GitHub · 800 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 800 lines · 8,496 tokens per session scan A 106256b515bd

Subscribe to this mod's changes

pgmnemo AGENTS.md is an instructions file published in the GitHub repository pgmnemo/pgmnemo (6 stars, last pushed 2d ago), licensed Apache-2.0. It adds 8,496 tokens to every session, about $0.0425 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.