Skip to content

Cursor, Codex, AGENTS.md

If your AI front-end is not Claude Code, you can still get high-quality NamiDB context with a small rule file in your project root. The patterns below are all opinionated, NamiDB-tuned templates — drop them in your repo and they take effect immediately.

Universal template: AGENTS.md

The emerging AGENTS.md convention (adopted by Codex, Cursor, Continue, Aider, and others) is the most portable starting point. Drop this at your repo root:

AGENTS.md
This project uses **NamiDB** — a cloud-native graph database with
Cypher / GQL on top of an S3-compatible bucket.
## Read this first
Pull the canonical engine context once per session:
https://docs.namidb.com/llms-full.txt
## NamiDB ground truth (do not deviate)
- The bucket is the database. State lives as plain S3 objects.
No Raft. No etcd. No DynamoDB lock table.
- `_id` is the internal NodeId since v0.3. `id` is a plain user
property. Older training data mixes these — always flag.
- Six URI schemes: memory://, file://, s3://, gs://, az://. The
`?ns=` parameter is required everywhere except memory://<ns>.
- Cypher writes commit on return (WAL + manifest CAS). Call
flush() periodically to push memtable → L0.
- Single writer per namespace. Two writers racing → loser gets
412 PreconditionFailed. That's the fencing protocol.
- Bulk ingest: use `merge_nodes`/`merge_edges` (Python) or the
Rust `upsert_node`/`upsert_edge` API, not per-row Cypher CREATE.
## Do NOT generate
- Unsupported Cypher: CALL {} subqueries, LOAD CSV, CREATE
INDEX/CONSTRAINT, unbounded *paths (use *1..N).
- Suggestions for external lock services (DynamoDB, etcd, ZooKeeper).
- Code using `id(n)` semantics from v0.2 — always use `_id` or the
function form `id(n)` for the internal NodeId.
## Project conventions
[Add your team's specifics here: namespace naming, IAM template,
preferred storage backend, deploy region, etc.]

Cursor: .cursorrules

Cursor reads .cursorrules at the repo root. Same content as AGENTS.md, just renamed:

Terminal window
cp AGENTS.md .cursorrules

Or keep them in sync with a symlink:

Terminal window
ln -s AGENTS.md .cursorrules

GitHub Copilot: .github/copilot-instructions.md

Copilot reads a markdown file from your repo. Drop the same content at .github/copilot-instructions.md — it’ll be inlined into every completion request.

Codex CLI: ~/.codex/AGENTS.md or per-repo AGENTS.md

Codex CLI uses AGENTS.md directly at the repo root (or ~/.codex/AGENTS.md for user-global). The universal template above is plug-and-play.

Continue / Aider / Cline

All three support a markdown rules file at the repo root. Use AGENTS.md or their tool-specific filename:

ToolFile
Continue.continue/context.md or AGENTS.md
Aider.aider.conf.yml (with read: AGENTS.md)
Cline.clinerules

Pulling fresh context each session

For ephemeral environments (CI, code reviewers, batch jobs), pull fresh context at the top of every run instead of pinning a static snapshot:

Terminal window
# Bash
curl -s https://docs.namidb.com/llms-full.txt > /tmp/namidb-context.md
# Python
import urllib.request
context = urllib.request.urlopen(
"https://docs.namidb.com/llms-full.txt"
).read().decode()

Then prepend context to the agent’s system prompt.

Pattern: prompt-caching the context

Both Anthropic and OpenAI support prompt caching. Cache the llms-full.txt block once and pay only the delta on subsequent calls in the same session.

client.messages.create(
model="claude-opus-4-7",
max_tokens=2048,
system=[
{
"type": "text",
"text": namidb_context,
"cache_control": {"type": "ephemeral"},
}
],
messages=[...],
)

See Anthropic prompt caching docs.

Validating that the rules took effect

Quick sanity check across any tool:

Write a Cypher query that creates 5 Person nodes with random UUIDs as internal NodeId, then a KNOWS edge between consecutive pairs.

A correctly-rule’d agent will:

  • Use {_id: ...} (NOT {id: ...})
  • Use MERGE or CREATE per the v0.3 grammar
  • Use tg.Client("s3://...?ns=...") (if Python) or parse_uri(...) (if Rust)
  • Not invent unsupported clauses like CREATE INDEX or CALL { ... }

If any of those fail, the rules aren’t being read by the agent — check the file name, location, and that your tool’s “rules” feature is enabled.

See also