docs

Configuration mimic.json

The mimic.json file is the single entry point for all of Mimic's behaviour. It lives in your project root and defines what your agent's world looks like — the domain, the people in it, which databases to seed, and how to test the agent.

Created automatically by mimic init, or write one by hand. Only two fields are required: domain and personas. Everything else is optional with sensible defaults.

Minimal example

jsonmimic.json — bare minimum
{
  "domain": "personal finance assistant",
  "personas": [
    {
      "name": "young-professional",
      "description": "28yo product designer, $95K salary, Austin TX"
    }
  ]
}

That’s it. Two fields and you can run mimic run to generate blueprints. Add a databases block when you’re ready to seed real data.

Full example

jsonmimic.json — all options
{
  "domain": "personal finance and banking platform",
​
  "llm": {
    "provider": "anthropic",
    "model": "claude-haiku-4-5"
  },
​
  "personas": [
    {
      "name": "active-trader",
      "description": "31yo software engineer, $140K salary, active stock trader, 5+ bank accounts"
    },
    {
      "name": "saver",
      "description": "27yo teacher, $55K salary, focuses on saving, tracks every dollar"
    }
  ],
​
  "generate": {
    "volume": "6 months",
    "seed": 42
  },
​
  "databases": {
    "postgres": {
      "type": "postgres",
      "url": "$DATABASE_URL",
      "schema": { "source": "introspect" },
      "seedStrategy": "truncate-and-insert"
    },
    "mongodb": {
      "type": "mongodb",
      "url": "$MONGO_URL",
      "database": "mimic_fintech",
      "seedStrategy": "delete-and-insert",
      "autoCreateIndexes": true
    }
  },
​
  "apis": {
    "stripe": { "enabled": true, "mcp": true }
  },
​
  "test": {
    "agent": "http://localhost:3000/chat",
    "scenarios": [
      {
        "name": "balance-check",
        "persona": "active-trader",
        "goal": "Ask about current account balance",
        "expect": {
          "tools_called": ["get_accounts"],
          "response_accurate": true
        }
      }
    ]
  }
}

Field reference

FieldRequiredTypeDescription
domainYesstringWhat your app does — used as context during data generation
personasYesarrayOne or more persona definitions (min 1)
llmNoobjectLLM provider and model for blueprint generation
generateNoobjectVolume, seed, and per-table row overrides
databasesNoobjectNamed database targets to seed
apisNoobjectAPI mock adapters to enable (Stripe, Plaid, Paddle, etc.)
testNoobjectAgent endpoint and test scenarios

domain

A plain-English description of what your application does. This is the most important field — it’s the primary context given to the LLM when generating persona blueprints. Be specific: “personal finance assistant” generates better data than “app”.

json
"domain": "e-commerce storefront with product catalog, shopping cart, and order tracking"

Good domain descriptions include the kind of data your app works with. Here are examples from the bundled examples:

personas

An array of fictional identities that drive data generation. Each persona produces a different style of data — different volumes, different patterns, different values — even though they share the same schema.

json
"personas": [
  {
    "name": "power-shopper",
    "description": "34yo marketing exec, frequent online buyer, $120K salary, loves electronics and fashion"
  },
  {
    "name": "casual-browser",
    "description": "22yo grad student, occasional buyer, budget-conscious, mostly books and supplies"
  }
]
FieldRequiredTypeDescription
nameYesstringUnique identifier. Lowercase, hyphens, numbers only (^[a-z0-9-]+$)
descriptionYesstringDetailed persona description — the LLM reads this to generate data
blueprintNostringPath to a pre-built JSON blueprint file (skips LLM generation)
**Writing good descriptions:** Include age, occupation, salary range, and behavioural patterns. The more specific you are, the more realistic the generated data. "29yo full-stack dev, manages 3 active projects, heavy task creator, uses labels extensively" produces much better data than "developer".

Each persona generates its own blueprint and seeds its own dataset. When you run mimic seed, every persona’s data is inserted into the same database, giving you a realistic multi-user environment.

llm

Configures which LLM provider and model to use for blueprint generation. If omitted, defaults to Anthropic Claude Haiku.

json
"llm": {
  "provider": "anthropic",
  "model": "claude-haiku-4-5"
}
FieldRequiredTypeDefaultDescription
providerYesstringanthropicanthropic, openai, ollama, or custom
modelYesstringclaude-haiku-4-5Model identifier for the chosen provider
apiKeyNostringfrom envAPI key — defaults to ANTHROPIC_API_KEY or OPENAI_API_KEY
baseUrlNostringCustom endpoint for ollama or custom providers

The LLM is only called during mimic run (blueprint generation). Once blueprints are generated and cached in .mimic/blueprints/, subsequent mimic seed commands work entirely offline.

generate

Controls the volume and reproducibility of generated data.

json
"generate": {
  "volume": "6 months",
  "seed": 42,
  "tables": {
    "transactions": 500,
    "users": "auto"
  }
}
FieldRequiredTypeDefaultDescription
volumeNostring6 monthsTime span of synthetic data. Examples: "3 months", "1 year", "2 weeks"
seedNointeger42PRNG seed for deterministic generation — same seed = same data every time
tablesNoobjectOverride row counts per table. Value is a number or "auto"

The volume field tells the blueprint expander how far back in time to generate data. A “busy-developer” persona with "3 months" might create 40-60 tasks, while "1 year" for the same persona would produce 150-200. The seed makes this deterministic — use it for reproducible test environments and CI pipelines.

databases

A named map of database targets to seed. Each key is a label you choose (e.g. "primary", "analytics", "cache"), and the value configures the connection and seeding behaviour. The type field determines which adapter is used.

Mimic supports four database types: PostgreSQL, MySQL, SQLite, and MongoDB. You can configure multiple databases — even of different types — and mimic seed populates them all in a single command.

PostgreSQL

json
"primary": {
  "type": "postgres",
  "url": "$DATABASE_URL",
  "schema": {
    "source": "prisma",
    "path": "./prisma/schema.prisma"
  },
  "seedStrategy": "truncate-and-insert"
}
FieldRequiredTypeDescription
typeYes"postgres"Selects the PostgreSQL adapter
urlYesstringConnection string: postgresql://user:pass@host:port/db
schema.sourceNostring"prisma", "sql", or "introspect" (reads live DB)
schema.pathNostringFile path for prisma or sql sources
seedStrategyNostring"truncate-and-insert" (default), "append", or "upsert"

Schema sources tell Mimic how to discover your table structure:

MySQL

json
"primary": {
  "type": "mysql",
  "url": "$DATABASE_URL",
  "schema": { "source": "introspect" },
  "seedStrategy": "truncate-and-insert"
}
FieldRequiredTypeDescription
typeYes"mysql"Selects the MySQL adapter
urlYesstringConnection string: mysql://user:pass@host:port/db
schema.sourceNostring"sql" or "introspect"
schema.pathNostringFile path for sql source
seedStrategyNostring"truncate-and-insert" (default), "append", or "upsert"
excludeTablesNoarrayTable names to skip during seeding (e.g. ["_migrations"])

SQLite

json
"local": {
  "type": "sqlite",
  "path": "./tasks.db",
  "walMode": true,
  "seedStrategy": "truncate-and-insert"
}
FieldRequiredTypeDescription
typeYes"sqlite"Selects the SQLite adapter
pathYesstringFile path to the SQLite database (e.g. "./data.db")
walModeNobooleanEnable Write-Ahead Logging for better concurrency. Default: false
seedStrategyNostring"truncate-and-insert" (default) or "append"

SQLite requires no server — the database is a single file. Use "walMode": true if your agent reads the database while Mimic is seeding, to avoid locking issues.

MongoDB

json
"documents": {
  "type": "mongodb",
  "url": "$MONGO_URL",
  "database": "mimic_blog",
  "seedStrategy": "delete-and-insert",
  "autoCreateIndexes": true
}
FieldRequiredTypeDescription
typeYes"mongodb"Selects the MongoDB adapter
urlYesstringConnection string: mongodb://host:port or mongodb+srv://...
databaseNostringDatabase name. If omitted, uses the name from the URL
seedStrategyNostring"delete-and-insert" (default), "drop-and-insert", "append", or "upsert"
autoCreateIndexesNobooleanAuto-create indexes on common fields (user_id, email, created_at, etc.)
collectionsNoarrayLimit seeding to specific collections. If omitted, seeds all

MongoDB does not require a schema file. Mimic generates document shapes from the domain description and persona, making it the fastest database to get started with. Set "autoCreateIndexes": true to automatically index common query fields.

**Multi-database:** You can define multiple databases of different types in the same config. `mimic seed` populates them all in one command with consistent user IDs across databases. See the fintech-multi-db example.

Schema source availability

SourcePostgreSQLMySQLSQLiteMongoDB
prismaYes
sqlYesYes
introspectYesYesYes
Schema-freeYes

Seed strategies

StrategyBehaviourAvailable on
truncate-and-insertClears all rows, then inserts fresh data. IdempotentPostgres, MySQL, SQLite
delete-and-insertDeletes all documents, then inserts. IdempotentMongoDB
drop-and-insertDrops collection entirely, recreates, then insertsMongoDB
appendAdds rows/documents without removing existing dataAll
upsertInserts or updates based on primary key / _idPostgres, MySQL, MongoDB

apis

A named map of API mock adapters. Each key is the adapter ID (e.g. "stripe", "plaid", "paddle"), and the value configures the adapter’s behaviour. When mimic host runs, enabled adapters are registered as Fastify routes on the mock server. When mcp: true, the adapter’s tools are also registered on the unified MCP server.

json
"apis": {
  "stripe": { "enabled": true, "mcp": true },
  "plaid": { "enabled": true, "mcp": true }
}
FieldRequiredTypeDefaultDescription
adapterNostringkey nameMaps to the @mimicai/adapter-<name> package. If omitted, uses the key
versionNostringAPI version (e.g. "v1")
portNonumberOverride per-adapter port
enabledNobooleantrueSet to false to skip this adapter during mimic host
mcpNobooleanfalseRegister this adapter's tools on the unified MCP server
configNoobjectAdapter-specific configuration

Use mimic adapters add stripe to install and configure an adapter, or add the entry to mimic.json by hand.


test

Defines test scenarios that mimic test runs against your agent. Each scenario sends a goal to the agent and verifies the response against expected outcomes — which tools were called, whether the response contains expected keywords, and whether the response is factually accurate.

json
"test": {
  "agent": "http://localhost:3000/chat",
  "mode": "text",
  "evaluator": "both",
  "scenarios": [
    {
      "name": "monthly-spending",
      "persona": "young-professional",
      "goal": "Ask about total spending last month",
      "expect": {
        "tools_called": ["get_transactions"],
        "response_contains": ["spending", "total"],
        "response_accurate": true,
        "no_hallucination": true,
        "max_latency_ms": 5000
      }
    }
  ]
}
FieldRequiredTypeDescription
agentYesstring (URL)Your agent's chat endpoint. Must accept POST {"{"} "message": "..." {"}"}
modeNostring"text" (default) or "voice"
evaluatorNostring"keyword", "llm", or "both" (default)
scenariosNoarrayList of test scenario objects (see below)
auto_scenariosNobooleanEnable auto-scenario generation from fact manifest. Default: false
scenario_tiersNoarrayFilter auto-scenarios by tier: "smoke", "functional", "adversarial"
exportNostringDefault export format: "mimic", "promptfoo", "braintrust", "langsmith", or "inspect"

Auto-scenario generation

When auto_scenarios is true, mimic test reads the fact manifest (.mimic/fact-manifest.json, written by mimic run) and generates test scenarios via an LLM call. Each fact in the manifest becomes a scenario with a natural-language question and specific assertions grounded in the generated data. Use scenario_tiers to limit which tiers are generated, and export to set a default export format. See Testing & Auto-Scenarios for the full guide.

json
"test": {
  "agent": "http://localhost:3000/chat",
  "auto_scenarios": true,
  "scenario_tiers": ["smoke", "functional"],
  "export": "promptfoo",
  "scenarios": []
}

Scenario fields

FieldRequiredTypeDescription
nameYesstringUnique scenario identifier
personaNostringWhich persona's data to test against
goalYesstringWhat the test asks the agent to do
inputNostringExplicit input string (if omitted, goal is used)

Expectation fields

FieldTypeDescription
tools_calledarray of stringsAgent must have called these tools
response_containsarray of stringsResponse must contain these substrings
response_accuratebooleanLLM checks factual accuracy against seeded data
no_hallucinationbooleanLLM checks that response doesn't fabricate data
max_latency_msnumberResponse must arrive within this many milliseconds

Environment Variables

Any string value in mimic.json can reference an environment variable using the $VARIABLE_NAME syntax. Variables are resolved at config load time.

json
// In mimic.json:
"url": "$DATABASE_URL"// Resolved from your shell:
// export DATABASE_URL="postgresql://user:pass@localhost:5432/mydb"

Common environment variables used across examples:

VariableUsed byDescription
DATABASE_URLPostgres, MySQLDatabase connection string
MONGO_URLMongoDBMongoDB connection string
ANTHROPIC_API_KEYLLM providerRequired for blueprint generation with Anthropic models
OPENAI_API_KEYLLM providerRequired when using "provider": "openai"
Missing environment variables cause a `ConfigInvalidError` at load time with a clear message telling you which variable is missing. Never hardcode secrets in `mimic.json` — always use `$VARIABLE_NAME` references.