agentmemory-offline AGENTS.md

A project instruction file for agentmemory, a persistent memory system for AI coding agents. It documents the system’s architecture, coding rules, and the files that must stay consistent when tools or endpoints change.

In plain words
What is it for?
Use it when working on agentmemory’s TypeScript code, MCP tools, REST endpoints, function and trigger registration, tests, builds, or documentation.
Why use it?
It gives coding agents the project context they need to make changes without bypassing the system’s design or leaving related files out of sync.

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/rmarquesa/agentmemory-offline/agents-md
Clone the repo
git clone --depth 1 https://github.com/rmarquesa/agentmemory-offline

Made for: Codex, OpenCode.

Per session 1,546 This file is loaded in full into every session.
When invoked 1,546 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin 91% copy Near-identical to another mod 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.01546 $0.01546
Opus 5 $0.00773 $0.00773
Sonnet 5 $0.00309 $0.00309
Haiku 4.5 $0.00155 $0.00155

Measured 2d ago against content hash d39c24bec7ab, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

agentmemory-offline 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 2d ago.

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.

Origin

This is a copy

91% identical to agentmemory AGENTS.md — 12 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

AGENTS.md · 125 lines

How it starts

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

agentmemory — Agent Instructions

Architecture

agentmemory is a persistent memory system for AI coding agents, built on iii-engine's three primitives (Worker/Function/Trigger). Everything goes through registerFunction/registerTrigger/sdk.trigger() — never bypass iii-engine with standalone SQLite or in-process alternatives.

  • Engine: iii-sdk (WebSocket to iii-engine on port 49134)
  • State: File-based SQLite via iii-engine's StateModule (./data/state_store.db)
  • Build: TypeScript → ESM via tsdown, output to dist/
  • Test: vitest (npm test excludes integration tests)

Consistency Rules

When adding or removing MCP tools, you MUST update ALL of the following:

  1. src/mcp/tools-registry.ts — tool definition + getAllTools() array
  2. src/mcp/server.ts — handler case in the mcp::tools::call switch
  3. src/triggers/api.ts — REST endpoint registration
  4. src/index.ts — function registration + endpoint count in the log line
  5. test/mcp-standalone.test.ts — tool count assertion
  6. README.md — tool counts (search for "MCP tools")
  7. plugin/.claude-plugin/plugin.json — tool count in description
  8. plugin/plugin.json and plugin/.mcp.copilot.json (when present) — tool count or MCP exposure

When adding REST endpoints, you MUST update:

  1. src/triggers/api.ts — endpoint registration
  2. src/index.ts — endpoint count in the log line
  3. README.md — endpoint count (search for "REST endpoints" and "endpoints on port")

When bumping version, you MUST update ALL of the following:

  1. package.json — version field
  2. src/version.ts — VERSION constant and type union
  3. src/types.ts — ExportData version union
  4. src/functions/export-import.ts — supportedVersions set
  5. test/export-import.test.ts — version assertion
  6. plugin/.claude-plugin/plugin.json — version field
  7. plugin/plugin.json (when present) — version field

When adding new KV scopes:

  1. src/state/schema.ts — add to the KV object
  2. src/types.ts — add the corresponding interface

Read the full file on GitHub · 125 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. 2d ago First seen · 125 lines · 1,546 tokens per session scan A d39c24bec7ab

Subscribe to this mod's changes

agentmemory-offline AGENTS.md is an instructions file published in the GitHub repository rmarquesa/agentmemory-offline (0 stars, last pushed 3d ago), licensed Apache-2.0. It adds 1,546 tokens to every session, about $0.0077 per session on Opus 5. A static security scan graded it A with 0 findings. It is 91% identical to agentmemory AGENTS.md, differing in 12 lines, and is treated as a copy.