start here

start using MongoDB with your agents

sign up, open a project, and add MongoDB to its setup script in settings → server.

Start 7-day trial with MongoDB
integrationstechnologyupdated
schematic diagram of the work aldena agents do through MongoDB
MongoDB

mongodb ai agent: a mongodb server in each conversation's own sandbox

add mongodb community server to a project's setup script and its agents load fixtures, run queries and aggregations, check indexes, and test on a live instance.

runs on
conversation sandbox
installed by
setup script
category
datastore

document databases are unforgiving of assumptions, because the shape of the data is whatever was written. installing mongodb in each conversation's sandbox gives an agent the one thing that settles those arguments: the ability to run the query and look.

what agents do with it

once the setup script has run, mongod is running in the conversation's sandbox. agents point the application at localhost, load fixture documents, and run finds and aggregation pipelines against them. for an aggregation that returns the wrong count, an agent runs the pipeline one stage at a time and reads what each stage emits, which is how the stage that drops documents gets found rather than guessed.

indexes and explain

an index that exists in the migration is not an index that exists in the database. with mongodb in the conversation's sandbox an agent lists the actual indexes, runs an explain, and reports which query is still doing a collection scan. that is a claim it can back rather than a suggestion.

example tasks

  • 01

    the aggregation returns fewer orders than the dashboard. find the stage that drops them.

    the agent loads sample documents into the project's mongodb, runs the pipeline stage by stage, and names the match that is filtering on a field some documents never had.

    bashreadedit
  • 02

    check every query in the repo has an index behind it.

    it lists the indexes on the project's instance, runs explain over the queries it found in the code, and reports the ones still scanning the collection.

    grepbash

what to know before installing

the project needs a sandbox, and mongodb beside an application is a reason to choose the standard size or larger. a setup script for it adds the mongodb apt repository, installs the server, and enables the service, and settings → server shows that run's output.

how to install MongoDB

MongoDB goes in the project's setup script, not once per team and not on your laptop.

  1. give the project a sandbox

    MongoDB runs in each conversation's sandbox, on your team's own sandbox provider account. an owner or admin connects a provider once on the team's providers page, then picks it and a default size for the project, at creation or later in settings → server. a project with no sandbox has nowhere to run it.

  2. add it to the setup script

    settings → server holds the project's setup script, a bash script that runs once on each new sandbox, in /project, with sudo. add MongoDB's install commands there and save.

  3. the next sandbox runs it

    the script runs when a conversation's sandbox is created or reused, on the conversation's first turn. settings shows the last run with its exit code and output, and a failed run leaves the sandbox usable rather than blocking the project.

  4. agents use it through bash

    from then on every agent in the project reaches MongoDB with the bash tool, on the same filesystem as the checkout they are working in. the conversation's sandbox keeps it between turns, sleeping when idle and waking with the next one.

where MongoDB actually lives

each conversation in a project gets its own sandbox on your team's sandbox provider account, and the project's setup script in settings → server decides what is on it. two projects never share a filesystem, so a version pinned for one client cannot collide with another's.

the sandbox provider bills its machine time to your team's account while it runs, and aldena adds nothing. the sizes are on isolated projects, and what agents may run in the sandbox is governed by the project's tool permissions.

faq

what does installing mongodb on a project give the agents?

a running mongod service in each conversation's own sandbox, plus the mongodb tooling on the path. agents point the application at localhost, load fixtures, and run queries and aggregation pipelines against real data instead of a stubbed driver.

is this connected to my production cluster?

no. the setup script puts a mongodb server in each conversation's sandbox for development and testing. a production cluster is only reachable if you deliberately put its connection string in that project's environment variables, and that credential never leaves the project.

can an agent test an aggregation pipeline properly?

yes, and this is where a live instance pays off. an agent loads representative documents, runs the pipeline stage by stage, and reads what each stage emits, which is the only reliable way to find the stage that quietly drops documents.

does the data survive between sessions?

only within a conversation. each conversation's sandbox keeps its files between turns, sleeping when idle and waking with the next one, so a loaded dataset is still there next time. a new conversation gets its own sandbox, and the setup script runs on it again. a conversation left quiet for 7 days gives its sandbox back, and its next turn starts fresh.

ready when you are

spin up your first project.

one project per client, product, or piece of work, staffed with intake, requirements, build and code review agents.