AxioDB / Email
AGENTS.md35 starsChanged 9 days agoMITView on GitHub
Global rules live in ../AGENTS.md. This file only adds Email/ specifics — read the root first. Role — an autonomous Cloudflare Email Worker (axiodb-email-agent) that handles incoming emails routed to AxioDB (e.g. connect@ankan.in). It performs early spam filtering and triage, vectorless RAG against AxioDB documentation, multi-model AI response generation, and outbound replies via Resend API or forwarding via Cloudflare Email Routing. Zero relation to the core npm package (excluded via .npmignore). Cloudflare Workers (compatibility date 2024-02-28) · postal-mime (email MIME…
- Reads credentials
- Installs packages
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.
Of the AGENTS.md files we read, the 31,843 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository12 other files it gives its agents.
- AGENTS.mdAGENTS.md
- cli/AGENTS.mdAGENTS.md
- Docker/AGENTS.mdAGENTS.md
- Document/AGENTS.mdAGENTS.md
- electron/AGENTS.mdAGENTS.md
- GUI/AGENTS.mdAGENTS.md
- Scripts/AGENTS.mdAGENTS.md
- source/AGENTS.mdAGENTS.md
- Test/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- skillSkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 48
Enforce daily quotas: Check KV counters (AI_DAILY_LIMIT and RESEND_DAILY_LIMIT) before executing AI runs and Resend sends.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Email/ — AxioDB Email Worker Agent (Agent Instructions)
Global rules live in ../AGENTS.md. This file only adds Email/ specifics — read the root first.
Role — an autonomous Cloudflare Email Worker (axiodb-email-agent) that handles incoming emails routed to AxioDB (e.g. connect@ankan.in). It performs early spam filtering and triage, vectorless RAG against AxioDB documentation, multi-model AI response generation, and outbound replies via Resend API or forwarding via Cloudflare Email Routing. Zero relation to the core npm package (excluded via .npmignore).
Stack
Cloudflare Workers (compatibility date 2024-02-28) · postal-mime (email MIME parsing) · resend (transactional email reply dispatch) · Cloudflare Workers AI (@cf/meta/llama-3.1-8b-instruct, @cf/meta/llama-3.3-70b-instruct-fp8-fast) · Cloudflare KV (EMAIL_KV for daily AI and Resend rate limit counters) · Cloudflare Email Routing.
Layout
index.js entrypoint: exports default worker email handler from src/config/index.js
wrangler.toml Cloudflare Worker config (AI binding, KV namespaces, vars, placement)
package.json ESM module dependencies (postal-mime, resend)
src/
config/
index.js orchestrates the end-to-end email pipeline (triage → RAG → writer → send)
constants.js KV keys, AI models, and configuration constants
prompts.js system prompts for triage and response generation
triage/
decisionEngine.js fast triage classifier with Clef/Flash model (DROP, FORWARD, REPLY + urgency)
rag/
knowledgeBase.js fetches AxioDB documentation context for RAG
vectorlessRag.js in-memory keyword and TF-IDF relevance retriever over documentation
writer/
modelExtractor.js invokes multi-model writer routing and parses structured outputs
jsonParser.js safely extracts JSON verdicts from model responses
utils/
counter.js KV quota helpers (readCount, bumpCount)
emailSender.js Resend API reply sender and Cloudflare message.forward() dispatcherCommands
cd Email
npm install
npx wrangler dev # local worker development
npx wrangler deploy # deploy worker to Cloudflare
npx wrangler secret put RESEND_API_KEY # configure secret keyHard rules
- No hardcoded secrets: API keys (e.g.,
RESEND_API_KEY) must never be committed in plaintext inwrangler.tomlor source code; configure them via Cloudflare Worker secrets (wrangler secret put). - Enforce daily quotas: Check KV counters (
AI_DAILY_LIMITandRESEND_DAILY_LIMIT) before executing AI runs and Resend sends. Fall back to forwarding directly toDESTINATION_EMAILif limits are reached. - Triage early: Discard spam (
DROP) immediately without consuming model writer quotas or sending replies. Forward human-intervention or high-urgency queries without unnecessary reply generation. - Graceful failure: In the event of parser or AI generation failures, always fall back to forwarding the raw email to destination instead of dropping valid user communications.
- Clean workspace:
node_modules/,.mf/, and local test artifacts are gitignored and.npmignored — never commit them.
Version sync (this folder)
Email/package.json→"version"(updated byScripts/versionController.sh)
Done for this folder
- All secrets and tokens managed via Cloudflare Worker secrets, not committed in code
- Email pipeline handles
DROP,FORWARD, andREPLYcleanly with fallback forwarding on errors or quota limits - Worker deploys successfully via
wrangler deploywithout unresolved imports
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

