memex AGENTS.md

Repository-wide instructions for contributors to Memex, a local-first system that remembers coding conversations. They define rules for project scope, privacy, fact sources, provenance, synchronization, and database updates.

In plain words
What is it for?
Use them when changing Memex code, importing or querying conversations, extracting facts, handling project scope, or maintaining its synchronization and privacy rules.
Why use it?
They keep memory data traceable and prevent different projects or unverified information from being mixed together.

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/bongsuchoi/memex/agents-md
Clone the repo
git clone --depth 1 https://github.com/BongSuCHOI/memex

Made for: Codex, OpenCode.

Per session 1,540 This file is loaded in full into every session.
When invoked 1,540 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.01540 $0.01540
Opus 5 $0.00770 $0.00770
Sonnet 5 $0.00308 $0.00308
Haiku 4.5 $0.00154 $0.00154

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

Security

Grade A, and why

memex 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.

AGENTS.md · 172 lines

How it starts

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

Memex contributor rules

Memex is a Codex-native, local-first long-term memory system. This file contains repository-wide guardrails for humans and coding agents. Keep it short: detailed behavior belongs in the owner documents under docs/.

Core invariants

  • $CODEX_HOME/sessions rollout JSONL is the default conversation source. Never modify source rollouts; archive/index/database state is derived.
  • Canonical absolute session_meta.cwd is project identity. Do not infer project identity from basename, archive path, display name, or process cwd.
  • Enforce project/global/all scope at every query, import, graph traversal, and relation-write boundary.
  • Preserve exact fact provenance to source exchanges. Human assertions and allowlisted local repo/Git/test observations may be learnable; Memex recall, assistant synthesis, external/unknown output, and unverified generated output are searchable but not learnable evidence.
  • Preserve exchanges.rowid on update. Extraction uses rowid watermarks.
  • Extraction claim, fact/provenance writes, saved counts, and watermark advance must commit atomically or remain retryable.
  • Model-backed work uses isolated local codex exec only. Default model: gpt-5.6-luna; override with MEMEX_CODEX_MODEL.
  • Automatic lifecycle work must be bounded, retry-safe, and observable.

Fact state and sync protocol v4

Treat durable fact state as independent axes:

  • semantic — fact meaning/scope; guarded by semantic_generation and semantic_updated_at
  • lifecycle — active/inactive; guarded by lifecycle_generation and lifecycle_updated_at
  • lineagesource_exchange_ids and consolidated_count
  • local-derived — KR text, ontology, relations, vectors

Do not collapse semantic and lifecycle into one clock.

Lineage is monotonic:

  • source_exchange_ids → set union
  • consolidated_count → max

This applies to both existing local facts and fresh remote inserts.

Protocol v4 durable payload contains only:

Read the full file on GitHub · 172 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 · 172 lines · 1,540 tokens per session scan A 9e2612d44f03

Subscribe to this mod's changes

memex AGENTS.md is an instructions file published in the GitHub repository BongSuCHOI/memex (0 stars, last pushed 2d ago), licensed MIT. It adds 1,540 tokens to every session, about $0.0077 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.

Related

Other instructions, from other repositories

PlaudBlender copilot-instructions.md

Instructions for Gunnarguy/PlaudBlender, covering plaudblender — ai agent instructions, quick orientation, what this project does, ui layout (dash v2 — appv2/) and project structure.

Gunnarguy/PlaudBlender · 1,653 tokens

m_flow AGENTS.md

AGENTS.md instructions for FlowElement-xinliuyuansu/m_flow, covering m-flow — developer & agent reference, 1. repository map, extension points, 2. local development and python backend (requires python 3.10 – 3.13).

FlowElement-xinliuyuansu/m_flow · 1,075 tokens

open-ontologies CLAUDE.md

Instructions for fabio-rovai/open-ontologies, covering open ontologies, ontology engineering workflow, generate, validate and load and reason.

fabio-rovai/open-ontologies · 5,098 tokens

engraphis CLAUDE.md

Instructions for Coding-Dev-Tools/engraphis, covering claude.md, the one rule that prevents most mistakes, before you say "done" — run the canonical gate, slash commands available here and working style in this repo.

Coding-Dev-Tools/engraphis · 1,082 tokens

kglite CLAUDE.md

Instructions for kkollsga/kglite, covering kglite — claude code conventions, build & test, architecture, the boundary principle (wrappers vs core) — summary and in-memory is the core product.

kkollsga/kglite · 12,909 tokens

tpu_performance_autoresearch_wiki GEMINI.md

Instructions for vlasenkoalexey/tpu_performance_autoresearch_wiki, covering gemini/antigravity operating rules, platform adaptation (claude code → gemini/antigravity), 1. skills — native, no emulation, 2. never-stop hook & retrospectives and 3. session and transcript resolution.

vlasenkoalexey/tpu_performance_autoresearch_wiki · 986 tokens