agentleFS
FullFranFullFran/Agent-skills-POC/.agents/skills/mongodb/SKILL.md

mongodb

Skill1 starsChanged 10 months agoMITView on GitHub

Expert guidance on MongoDB implementation for RAG, including aggregation pipelines and search patterns.

11 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use redis, postgresql and 6 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • Sorcha-PlatformSkill

    redis

    Implements Redis caching, session management, and distributed coordination for the Sorcha platform. Use when: Adding caching layers, token revocation, rate limiting, SignalR backplane, or distributed state.

    Also in 4 projects that use this

  • xfstudioSkill

    postgresql

    Design a PostgreSQL-specific schema. Covers best-practices, data types, indexing, constraints, performance patterns, and advanced features

    Also in 3 projects that use this

  • VercelSkill

    aws

    Emulated AWS cloud services (S3, SQS, Cognito, IAM, STS) for local development and testing. Use when the user needs to interact with AWS API endpoints locally, test S3 bucket and object operations, emulate SQS queues and messages, test Cognito sign-up, sign-in, JWTs, or Identity Pools, manage IAM users/roles/access keys, test STS assume role, or work without hitting real AWS APIs. Triggers include "AWS emulator", "emulate AWS", "mock S3", "local SQS", "test IAM", "emulate S3", "AWS locally", "STS assume role", or any task requiring local AWS service emulation.

    Also in 3 projects that use this

  • wrsmith108Skill

    docker

    Container-based development for isolated, reproducible environments. Use when running npm commands, installing packages, executing code, or managing project dependencies. Trigger phrases include "npm install", "run the build", "start the server", "install package", or any code execution request.

    Also in 4 projects that use this

  • klauswgSkill

    performance

    Optimize web performance for faster loading and better user experience. Use when asked to "speed up my site", "optimize performance", "reduce load time", "fix slow loading", "improve page speed", or "performance audit".

    Also in 3 projects that use this

  • 0xSeroSkill

    security

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 0 are distinctive, and 5 are very specific to this project.

  • 0

    Common

    Most of the 8 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 5

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Score Meta: Use {"$meta": "vectorSearchScore"} for semantic scores and {"$meta": "searchScore"} for text scores.

    line 15
  2. Very specific:

    Semantic Search: Use $vectorSearch aggregation.

    line 19
  3. Very specific:

    Text Search: Use $search (Atlas Search) in chunks collection.

    line 20
  4. Very specific:

    Joins: Always use $lookup to fetch document metadata (title, source) when returning search results.

    line 22
  5. Very specific:

    Async First: Use motor (AsyncIOMotorClient) for all database operations.

    line 26

“Common” is measured: kept by at least 6 in 10 of the 8 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

MongoDB Expert Skill

This skill provides patterns for implementing RAG logic with MongoDB Atlas.

📂 Storage Pattern

  • Two-Collection Pattern:
    • documents: Stores source document text and global metadata.
    • chunks: Stores text fragments, embeddings (list[float]), and a foreign key (document_id) to the source document.
  • Score Meta: Use {"$meta": "vectorSearchScore"} for semantic scores and {"$meta": "searchScore"} for text scores.

🔍 Search Patterns

  • Semantic Search: Use $vectorSearch aggregation. Default numCandidates: 100.
  • Text Search: Use $search (Atlas Search) in chunks collection.
  • Hybrid Search: Currently implemented via manual Reciprocal Rank Fusion (RRF) in RAGService by merging results from semantic and text search.
  • Joins: Always use $lookup to fetch document metadata (title, source) when returning search results.

🛠️ Code Standards

  • Async First: Use motor (AsyncIOMotorClient) for all database operations.
  • List Embeddings: Embeddings MUST be stored and queried as Python lists of floats (e.g., 1536 dims for OpenAI).
  • ID Handling: Convert string IDs to bson.ObjectId where necessary.
  • Graceful Failure: Handle missing search indexes (code 291) with clear error messages.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.