rag-design-for-overall-program

rag-design-for-overall-program is a cursor rule for Cursor from Intrafere/MOTO-Autonomous-ASI. It costs 19 tokens per session (5,746 once invoked), scanned A, original, MIT.

A set of rules for deciding which information an AI system should place directly in its working context and which information it may retrieve through RAG, or retrieval-augmented generation.

In plain words
What is it for?
Use it when changing the context allocator or retrieval behavior in Aggregator, Compiler, or Autonomous modes. It governs mandatory source material, evidence reserves, and the active solution path.
Why use it?
It prevents required evidence from being shortened or left out, and avoids including the same source both directly and through retrieval. It also defines what happens when required context is too large.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when changing the context allocator or retrieval behavior in Aggregator, Compiler, or Autonomous modes. It governs mandatory source material, evidence reserves, and the active solution path.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/intrafere/moto-autonomous-asi/rag-design-for-overall-program
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.

Clone the repo
git clone --depth 1 https://github.com/Intrafere/MOTO-Autonomous-ASI

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for rag-design-for-overall-program

README.md
[![agentmods](https://agentmods.dev/badge/rules/intrafere/moto-autonomous-asi/rag-design-for-overall-program/github.svg)](https://agentmods.dev/rules/intrafere/moto-autonomous-asi/rag-design-for-overall-program)
Your own site
<a href="https://agentmods.dev/rules/intrafere/moto-autonomous-asi/rag-design-for-overall-program"><img src="https://agentmods.dev/badge/rules/intrafere/moto-autonomous-asi/rag-design-for-overall-program/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for rag-design-for-overall-program

Your own site · 80×15
<a href="https://agentmods.dev/rules/intrafere/moto-autonomous-asi/rag-design-for-overall-program"><img src="https://agentmods.dev/badge/rules/intrafere/moto-autonomous-asi/rag-design-for-overall-program.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,746 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00019 $0.05746
Opus 5 $0.00010 $0.02873
Sonnet 5 $0.00004 $0.01149
Haiku 4.5 $0.00002 $0.00575

Measured 9d ago against content hash 71b6caa76833, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

rag-design-for-overall-program 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 9d 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.

.cursor/rules/rag-design-for-overall-program.mdc · 268 lines

How it starts

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

Important Notes When Editing RAG Systems

The RAG system in this program is very advanced, be certain that any changes you make to the RAG system are correct changes.

Canonical Direct-Injection / RAG Policy

Direct injection is preferred for source content, but the allocator may offload an otherwise-fitting optional block to RAG when direct injection would starve the reserved evidence budget. Code currently keeps a 5000-token reserve for RAG/evidence in the shared context allocator.

Some inputs are mandatory direct-inject and must never be RAG'd, summarized, compressed, truncated, excerpted, or replaced by partial views. If mandatory direct-inject context does not fit the configured model context, halt with an explicit context-overflow error and tell the user which mandatory context overflowed.

If an item is direct injected, its RAG counterpart must NOT also be included.

The active Progressive Solution Path is never RAG-indexed. Before five accepted brainstorm ideas it is absent; afterward, only the bounded Main Submitter 1-approved canonical revision is optional advisory direct context for relevant solving and semantic-validator calls. It may be shed before mandatory user/source/candidate/tool context when budget requires, and pending, rejected, stale, and historical revisions never enter model context. The path is not evidence and may always be ignored for a better route.

Paper-Writing / Research Offload Order

These priorities apply to Aggregator, Compiler, and Autonomous paper-writing workflows. They do not describe LeanOJ proof-only memory ordering.

Mode Mandatory direct context Optional direct-first blocks RAG/offload order
Aggregator submitter User prompt, role/schema instructions Shared training DB, local submitter DB, rejection log, user uploads Shared Training DB → Local Submitter DB → Rejection Log → User Upload Files
Aggregator validator User prompt, role/schema instructions, submission(s) under review Shared training DB, user uploads Shared Training DB → User Upload Files
Aggregator cleanup review User prompt, cleanup schema/instructions Accepted-submissions DB if it fits with reserve Accepted-submissions DB via normal RAG fallback; cleanup never skips solely because DB is large
Compiler construction/review User prompt, current outline Current paper, autonomous brainstorm/source DB when injected by the caller, rejection/acceptance logs Reference Papers → Brainstorm/Source DB → Current Paper → Rejection/Acceptance Logs
Compiler outline update User prompt, current outline Current paper, rejection/acceptance logs Current Paper → Rejection/Acceptance Logs
Compiler rigor User prompt, current outline, current paper, Lean candidate/attempt context Existing verified-proof summaries and recent failed-proof hints Shared Training DB / reference evidence → Rejection/Acceptance Logs → User Upload Files
Autonomous topic/title/metadata agents User research prompt, compact metadata/candidate lists Usually none; metadata is capped direct context No RAG unless the specific browsing/expansion step calls for full-content fallback
Autonomous brainstorm/paper context User research prompt, topic/title/outline as applicable Brainstorm DB when the compiler caller injects it, current paper Reference and prior-brainstorm papers are indexed as high-priority RAG evidence; oversized direct source blocks fail or use the mode's explicit fallback
Autonomous proof verification User prompt, complete source content, proof candidate/formalization context Verified proof summaries and failed-proof hints Proof agents operate outside Chroma RAG; Lean source files are not indexed

Read the full file on GitHub · 268 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. 9d ago First seen · 268 lines · 19 tokens per session scan A 71b6caa76833

Subscribe to this mod's changes

rag-design-for-overall-program is a cursor rule published in the GitHub repository Intrafere/MOTO-Autonomous-ASI (83 stars, last pushed 5d ago), licensed MIT. It adds 19 tokens to every session and 5,746 once invoked, about $0.0001 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-30.