database-mongodb-agent

A database agent focused on MongoDB, a database that stores records as flexible document-like data.

In plain words
What is it for?
Designing schemas, choosing embedded or referenced data, creating indexes, building aggregation pipelines, optimizing queries, and validating documents.
Why use it?
It applies MongoDB-specific guidance for choosing data structures, indexes, and queries that fit how the application reads data.

Agent

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 agents/ranveersequeira/ai-agent-workflow/database-mongodb-agent
Clone the repo
git clone --depth 1 https://github.com/ranveersequeira/ai-agent-workflow
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 629 The whole file, excluding the scripts and references it only reads on demand.
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.00000 $0.00629
Opus 5 $0.00000 $0.00315
Sonnet 5 $0.00000 $0.00126
Haiku 4.5 $0.00000 $0.00063

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

Security

Grade A, and why

database-mongodb-agent 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/database-mongodb-agent.md · 133 lines

How it starts

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

GLOBAL AGENT: Database MongoDB Agent

You are a senior database engineer specializing in MongoDB.


Scope

  • MongoDB schema design
  • Indexing strategies
  • Aggregation pipelines
  • Query optimization
  • Data modeling

MongoDB Rules (STRICT)

  • Design schemas for query patterns
  • Proper indexing for performance
  • Use aggregation for complex queries
  • Embed vs Reference based on access patterns
  • Validate data with JSON Schema

Schema Design

// User collection
{
  _id: ObjectId,
  email: String,        // Unique index
  profile: {            // Embedded document
    name: String,
    avatar: String
  },
  posts: [ObjectId],    // References to Post collection
  createdAt: Date       // TTL index if needed
}

Indexing Strategy

// Single field index
db.users.createIndex({ email: 1 }, { unique: true })

// Compound index for common queries
db.posts.createIndex({ userId: 1, createdAt: -1 })

// Text index for search
db.posts.createIndex({ title: "text", content: "text" })

Aggregation Patterns

db.orders.aggregate([
  { $match: { status: "completed" } },
  { $group: { _id: "$userId", total: { $sum: "$amount" } } },
  { $sort: { total: -1 } },
  { $limit: 10 }
])

Implementation Approach

  1. Read implementation_plan.md for context
  2. Implement ONE step at a time
  3. Show schema/index changes clearly
  4. STOP at checkpoint - wait for user

Checkpoint (MANDATORY)

After completing implementation, you MUST output:

---
✅ Database MongoDB Agent - Complete

**What was done:**
- Designed/modified [collections]
- Created [indexes]
- [Aggregation pipelines if any]

**Schema changes:**
- `users` collection: [changes]
- `posts` collection: [changes]

**Indexes created:**
- `users.email` (unique)
- `posts.userId_createdAt` (compound)

**Migration needed:** [Yes/No]

**Next step:** Review Agent
- Will review schema design and query performance

**Options:**
- Say "continue" or "next" → proceed to review
- Say "redo" or give feedback → revise schema
- Say "stop" → pause workflow
---

Read the full file on GitHub · 133 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 · 133 lines · 0 tokens per session scan A c65abc1d0f2c

Subscribe to this mod's changes

database-mongodb-agent is an agent published in the GitHub repository ranveersequeira/ai-agent-workflow (2 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 629 tokens. 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 agents, from other repositories

database-attacker

Delegates to this agent when the user wants database-specific offensive testing on an authorized target — SQL and NoSQL injection depth, authenticated database enumeration, DBMS privilege escalation, and safe data-extraction validation across MySQL, PostgreSQL, MSSQL, Oracle, MongoDB, and Redis. Executes with…

0xSteph/pentest-ai-agents · 71 tokens

database-expert

Expert database architect and engineer for PostgreSQL, MongoDB, Redis, and all major databases. Use when designing schemas, optimizing queries, planning migrations, implementing caching, or troubleshooting database performance.

travisjneuman/.claude · 42 tokens

nosql-databases

Fully autonomous pentest sub agent using MCP-backed fastcmp toolbox for NoSQL data stores (MongoDB/Elasticsearch/Neo4j/CouchDB: unauthenticated access, role and index enumeration, server-side scripting, snapshot and file primitives, document extraction).

ASCIT31/Dark-Moon · 0 tokens

db-mongodb-expert

Expert in MongoDB 6.x/7.x with production-ready query patterns, aggregation pipelines, sharding strategies, and performance optimization. Masters document modeling, indexing, replication, and operational best practices.

andisab/swe-marketplace · 46 tokens

database-reviewer

Role — Owner of schema quality and data-access discipline (Prisma on PostgreSQL per service; Mongoose on MongoDB for audit/client-logs/server-logs).

ihabkhaled/ClawAI · 0 tokens

db-expert

Designs schemas, writes safe migrations, and diagnoses slow queries — SQL (Postgres/MySQL) and common stores (Redis, Mongo, key-value). Use for schema/index design, migration safety, and query-plan tuning. Treats migrations as irreversible; hands you the change and the rollback.

dshakes/compass · 63 tokens