docs

Examples Working Examples

Every example ships with a mimic.json config, a database schema, and a fully wired AI agent. Clone, seed, and chat — each example works end-to-end out of the box.

Mimic ships with ten working examples that demonstrate different database backends, API mock adapters, persona styles, and agent architectures. Each example lives in the examples/ directory and follows the same pattern:

  1. Define personas in mimic.json — describe who generates the data
  2. Provide a schema — SQL DDL, Prisma schema, or nothing at all (MongoDB auto-discovers)
  3. Seed the database with mimic seed — persona-consistent synthetic data
  4. Run the agent — a tool-equipped AI agent queries the seeded data
ExampleDatabaseAPI AdapterDomainAgent SDKKey Feature
tasks-sqliteSQLiteTask managementVercel AI SDKZero-infrastructure — no Docker required
ecommerce-mysqlMySQLE-commerce storefrontVercel AI SDKRelational schema with FKs, categories, orders
blog-mongodbMongoDBTechnical blogVercel AI SDKSchema-free — no DDL files needed
fintech-multi-dbPostgreSQL + MongoDBPersonal financeOpenAI Agents SDKMulti-database seeding + MCP tools
finance-assistantPostgreSQL (Prisma)Personal financeVercel AI SDKPrisma schema + mimic test scenarios
billing-agentPostgreSQL (Prisma)StripeSaaS billingOpenAI Agents SDKStripe MCP + HTTP dual-mode, cross-surface data
budget-agentPostgreSQL (Prisma)PlaidPersonal budgetingOpenAI Agents SDKPlaid bank accounts + budgets + savings goals
payments-monitorPostgreSQL (Prisma)StripePayment operationsOpenAI Agents SDKRevenue metrics, failure analysis, dunning
meeting-notesPostgreSQL (Prisma)SlackTeam meetingsOpenAI Agents SDKMeeting summaries posted to Slack channels
cfo-agentPostgreSQL (Prisma)Stripe + Paddle + Chargebee + GoCardless + RevenueCat + Lemon Squeezy + Zuora + RecurlySaaS CFO / billing intelligenceLangChain + LangGraph8 billing platforms, supervisor + sub-agent, Next.js UI

Tasks — SQLite

The simplest way to get started. No Docker, no external database servers — SQLite is file-based, so you just need Node.js and an Anthropic API key.

Domain: A project and task management app with projects, tasks, labels, and comments. Two personas generate different usage patterns: a busy-developer (heavy task creator, 3 active projects, extensive label usage) and a project-manager (milestone-focused, delegates across 8 team members, tracks blockers).

Config

jsonexamples/tasks-sqlite/mimic.json
{
  "domain": "project and task management app",
  "llm": { "provider": "anthropic", "model": "claude-haiku-4-5" },
  "personas": [
    {
      "name": "busy-developer",
      "description": "29yo full-stack dev, manages 3 active projects, heavy task creator, uses labels extensively"
    },
    {
      "name": "project-manager",
      "description": "35yo PM, oversees team of 8, focuses on milestones and deadlines, tracks blockers"
    }
  ],
  "generate": { "volume": "3 months", "seed": 42 },
  "databases": {
    "local": {
      "type": "sqlite",
      "path": "./tasks.db",
      "walMode": true,
      "seedStrategy": "truncate-and-insert"
    }
  }
}

Schema

Five tables capture the task management domain: projects, tasks (with status and priority enums), labels, task_labels (many-to-many), and comments.

sqlexamples/tasks-sqlite/schema.sql
CREATE TABLE projects (
  id          INTEGER PRIMARY KEY AUTOINCREMENT,
  name        TEXT NOT NULL,
  description TEXT,
  status      TEXT CHECK(status IN ('active', 'completed', 'archived')) DEFAULT 'active',
  created_at  TEXT DEFAULT (datetime('now')),
  updated_at  TEXT DEFAULT (datetime('now'))
);
​
CREATE TABLE tasks (
  id              INTEGER PRIMARY KEY AUTOINCREMENT,
  project_id      INTEGER NOT NULL REFERENCES projects(id),
  title           TEXT NOT NULL,
  status          TEXT CHECK(status IN ('todo', 'in_progress', 'review', 'done', 'blocked')),
  priority        TEXT CHECK(priority IN ('low', 'medium', 'high', 'urgent')),
  assignee        TEXT,
  due_date        TEXT,
  estimated_hours REAL,
  actual_hours    REAL,
  -- ...timestamps
);
​
CREATE TABLE labels ( id INTEGER PRIMARY KEY, name TEXT UNIQUE, color TEXT );
CREATE TABLE task_labels ( task_id INTEGER, label_id INTEGER, PRIMARY KEY (task_id, label_id) );
CREATE TABLE comments ( id INTEGER PRIMARY KEY, task_id INTEGER, author TEXT, body TEXT, created_at TEXT );

Agent

The agent uses the Vercel AI SDK with better-sqlite3 for read-only queries. It exposes six tools to the LLM: list_projects, search_tasks, get_task_details, get_project_tasks, get_task_comments, and get_blocked_tasks. All queries are prepared statements — no string interpolation, no SQL injection risk.

Quick start

bash
# No Docker needed — SQLite is file-based
$ cd examples/tasks-sqlite
$ ./init-db.sh                       # Create the SQLite database
$ mimic run                           # Generate blueprints
$ mimic seed --verbose                # Seed tasks.db# Start the agent
$ cd agent && npm install && npm start
​
# Chat with it
$ curl -s -X POST http://localhost:3002/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What projects are currently active?"}' | jq .
​
$ curl -s -X POST http://localhost:3002/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Show me all blocked tasks"}' | jq .

Best for: Getting started quickly, local development, demos, and environments where you can't run Docker. Cleanup is just rm tasks.db.

E-Commerce — MySQL

A full relational e-commerce storefront with customers, categories (self-referencing for sub-categories), products, orders, order items, and reviews. Demonstrates Mimic with a traditional relational MySQL schema including foreign keys, unique constraints, and CHECK constraints.

Personas: A power-shopper (34yo marketing exec, frequent buyer, $120K salary, loves electronics and fashion — generates ~25-40 orders over 6 months) and a casual-browser (22yo grad student, budget-conscious, mostly books — generates ~8-12 orders).

Config

jsonexamples/ecommerce-mysql/mimic.json
{
  "domain": "e-commerce storefront",
  "personas": [
    { "name": "power-shopper",  "description": "34yo marketing exec, frequent online buyer, $120K salary" },
    { "name": "casual-browser", "description": "22yo grad student, occasional buyer, budget-conscious" }
  ],
  "databases": {
    "primary": {
      "type": "mysql",
      "url": "$DATABASE_URL",
      "schema": { "source": "introspect" },
      "seedStrategy": "truncate-and-insert"
    }
  }
}

Schema highlights

Six tables with full relational integrity. Categories support self-referencing parent-child hierarchy. Products have unique SKUs and slugs. Orders track status through a lifecycle (pendingconfirmedshippeddelivered or cancelled). Reviews enforce a 1-5 rating CHECK constraint.

sqlexamples/ecommerce-mysql/schema.sql (excerpt)
CREATE TABLE customers ( id INT AUTO_INCREMENT PRIMARY KEY, email VARCHAR(255) UNIQUE, ... );
CREATE TABLE categories ( id INT AUTO_INCREMENT PRIMARY KEY, slug VARCHAR(120) UNIQUE, parent_id INT REFERENCES categories(id) );
CREATE TABLE products ( id INT AUTO_INCREMENT PRIMARY KEY, category_id INT, price DECIMAL(10,2), sku VARCHAR(50) UNIQUE );
CREATE TABLE orders ( id INT AUTO_INCREMENT PRIMARY KEY, customer_id INT, status ENUM('pending','confirmed','shipped','delivered','cancelled') );
CREATE TABLE order_items ( order_id INT, product_id INT, quantity INT, unit_price DECIMAL(10,2) );
CREATE TABLE reviews ( product_id INT, customer_id INT, rating TINYINT CHECK(rating BETWEEN 1 AND 5) );

Agent tools

ToolDescription
search_productsSearch by name, category, price range; filter in-stock only
get_ordersCustomer order history with status and date filters
get_order_detailsFull order breakdown with line items and product info
get_customer_infoCustomer profile with total order count and lifetime spend
get_reviewsProduct reviews with optional rating filter and averages

Quick start

bash
$ cd examples/ecommerce-mysql
$ docker compose up -d               # Start MySQL
$ export DATABASE_URL="mysql://mimic:mimic@localhost:3306/mimic_ecommerce"
$ mimic run && mimic seed --verbose
​
$ cd agent && npm install && npm start
​
$ curl -s -X POST http://localhost:3001/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What electronics do you have under $50?"}' | jq .
​
$ curl -s -X POST http://localhost:3001/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What are the highest rated products?"}' | jq .

Blog — MongoDB

Demonstrates Mimic's schema-free mode. No Prisma files, no SQL DDL — just describe your domain and personas in mimic.json and Mimic figures out the document shapes automatically. This makes MongoDB the fastest way to get started.

Personas: A prolific-writer (32yo senior engineer, writes 2-3 posts/week on distributed systems and Rust, ~50-70 posts over 6 months) and a casual-reader (24yo junior dev, reads daily, bookmarks tutorials, ~80-120 bookmarks).

Config

jsonexamples/blog-mongodb/mimic.json
{
  "domain": "technical blog and content platform",
  "personas": [
    { "name": "prolific-writer", "description": "32yo senior engineer, writes 2-3 posts/week on distributed systems and Rust" },
    { "name": "casual-reader",   "description": "24yo junior dev, reads daily, comments occasionally, bookmarks tutorials" }
  ],
  "databases": {
    "primary": {
      "type": "mongodb",
      "url": "$MONGO_URL",
      "database": "mimic_blog",
      "seedStrategy": "delete-and-insert",
      "autoCreateIndexes": true
    }
  }
}

Notice there is no schema file. Mimic auto-discovers collections from the database and generates documents matching the domain description. Collections created: users, posts, comments, bookmarks.

Agent tools

The agent leverages MongoDB's aggregation pipeline and $lookup for join-like queries:

ToolDescription
search_postsFull-text search with optional tag, author, and date range filters
get_postRetrieve a single post by ID with full body content
get_commentsPaginated comments for a post, with author info via $lookup
get_author_postsAll posts by an author (by ID or username), plus their profile
get_popular_postsPosts ranked by engagement score (views + 5× likes + 10× comments)
search_by_tagPosts matching tags (AND/OR mode), with tag frequency breakdown

Quick start

bash
$ cd examples/blog-mongodb
$ docker compose up -d               # Start MongoDB
$ export MONGO_URL="mongodb://localhost:27017"
$ mimic run && mimic seed --verbose   # No schema file needed!$ cd agent && npm install && npm start
​
$ curl -X POST http://localhost:3003/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What are the most popular posts about Rust?"}'

Schema-free mode: MongoDB is the fastest way to prototype with Mimic. No schema files, no migrations — just define personas and mimic seed. Mimic generates documents that match your domain description.

Fintech — Multi-Database

The flagship example demonstrating Mimic's multi-database capabilities. A personal finance platform where structured financial data (users, accounts, transactions) lives in PostgreSQL and semi-structured activity data (activity logs, preferences, notifications) lives in MongoDB — with a single AI agent querying both transparently.

Architecture

textmulti-database architecture
                      +---------------------+
                      |    AI Agent (:3004)  |
                      |  OpenAI Agents SDK   |
                      |  + Claude Haiku      |
                      +----------+----------+
                                 |
                +----------------+----------------+
                |                                 |
          MCP (stdio)                      Direct Driver
                |                                 |
       +--------+--------+             +----------+----------+
       |   PostgreSQL    |             |      MongoDB        |
       |   (port 5432)  |             |   (port 27017)      |
       |                 |             |                     |
       |  users          |             |  activity_logs      |
       |  accounts       |             |  user_preferences   |
       |  transactions   |             |  notifications      |
       +-----------------+             +---------------------+

How it works: The agent uses the OpenAI Agents JS SDK with Claude as the model. It spawns mimic host --transport stdio as a subprocess for auto-discovered PostgreSQL MCP tools, and connects directly to MongoDB for document-based tools. The AI model decides which database to query based on the user's question.

Config

jsonexamples/fintech-multi-db/mimic.json
{
  "domain": "personal finance and banking platform",
  "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" }
  ],
  "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
    }
  }
}

Both databases are seeded from the same generated data set with a single mimic seed command, ensuring consistent user IDs across databases.

What gets seeded

DatabaseTable / CollectionActive TraderSaver
PostgreSQLusers1 row1 row
PostgreSQLaccounts5+ rows2-3 rows
PostgreSQLtransactions500+ rows100+ rows
MongoDBactivity_logsLogin events, page views, transfers, settings changes
MongoDBuser_preferencesNotification settings, budget goals, feature flags
MongoDBnotificationsAlerts, warnings, promotions, info messages

Agent tools

The agent combines two tool sources — auto-discovered MCP tools from PostgreSQL and hand-written MongoDB tools:

SourceToolDescription
MCP (Postgres)get_transactionsQuery with date range, category, merchant filters
MCP (Postgres)get_accountsList accounts, filter by type or institution
Direct (Mongo)get_activity_logQuery activity events by user, action, date range
Direct (Mongo)get_user_preferencesNotification settings, display prefs, budget goals
Direct (Mongo)get_notificationsAlerts with read/unread and type filtering

Quick start

bash
$ cd examples/fintech-multi-db
$ docker compose up -d               # Starts PostgreSQL + MongoDB
$ export DATABASE_URL="postgresql://mimic:mimic@localhost:5432/mimic_fintech"
$ export MONGO_URL="mongodb://localhost:27017"
$ mimic run && mimic seed --verbose   # Seeds BOTH databases$ cd agent && npm install && npm start
​
# Query PostgreSQL (transactions)
$ curl -s -X POST http://localhost:3004/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What are my account balances?"}' | jq
​
# Query MongoDB (activity)
$ curl -s -X POST http://localhost:3004/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Show my unread notifications"}' | jq
​
# Cross-database query (both!)
$ curl -s -X POST http://localhost:3004/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "How much did I spend on dining last month, and do I have any alerts about it?"}' | jq

Cross-database queries: Ask about spending and notifications in the same question. The agent decides which database to query and combines results from both PostgreSQL and MongoDB into a single response.

Finance Assistant — PostgreSQL + Prisma

The original Mimic example and the only one that includes test scenarios. Uses a Prisma schema to define the database structure (no raw SQL needed) and demonstrates mimic test with scenario-based evaluation.

Personas: A young-professional (28yo product designer, $95K salary, Austin TX) and a college-student (21yo CS student, part-time barista, tight budget).

Schema (Prisma)

Instead of SQL DDL, this example uses a Prisma schema that Mimic parses with prisma-ast:

prismaexamples/finance-assistant/prisma/schema.prisma
enum AccountType { CHECKING  SAVINGS  CREDIT }
enum TransactionCategory { INCOME  RENT  GROCERIES  DINING  ENTERTAINMENT  // ...12 more }
enum TransactionStatus   { PENDING  POSTED  CANCELLED }
​
model User {
  id        Int       @id @default(autoincrement())
  email     String    @unique
  firstName String    @map("first_name")
  accounts  Account[]
  @@map("users")
}
​
model Account {
  id            Int          @id @default(autoincrement())
  userId        Int          @map("user_id")
  name          String       /// e.g. "Chase Checking"
  type          AccountType
  balance       Decimal      @db.Decimal(12, 2)
  transactions  Transaction[]
  @@map("accounts")
}
​
model Transaction {
  id       Int                    @id @default(autoincrement())
  amount   Decimal                @db.Decimal(12, 2)  /// +credit, -debit
  category TransactionCategory
  merchant String
  status   TransactionStatus      @default(POSTED)
  @@map("transactions")
}

Test scenarios

This is the only example that defines mimic test scenarios. Each scenario specifies a persona, a goal for the agent, and expected outcomes:

jsonmimic.json — test section
"test": {
  "agent": "http://localhost: 3000/chat",
  "scenarios": [
    {
      "name": "monthly-spending",
      "persona": "young-professional",
      "goal": "Ask about total spending last month",
      "expect": {
        "tools_called": ["get_transactions"],
        "response_accurate": true,
        "no_hallucination": true
      }
    },
    {
      "name": "category-breakdown",
      "persona": "young-professional",
      "goal": "Ask for a breakdown of spending by category",
      "expect": {
        "tools_called": ["get_transactions_summary"],
        "response_contains": ["dining", "groceries"],
        "response_accurate": true
      }
    }
  ]
}

Run the test suite with mimic test. Scenarios verify that the agent calls the right tools and returns accurate, non-hallucinated responses grounded in the seeded data.

Quick start

bash
$ cd examples/finance-assistant
$ export DATABASE_URL="postgresql://localhost:5432/mimic_finance"
$ mimic run && mimic seed --verbose
​
# Start the agent
$ cd agent && npm install && npm start
​
# Run test scenarios
$ mimic test --verbose

Prisma + testing: This example shows the full Mimic workflow: Prisma schema → persona-driven data generation → seeding → agent testing with mimic test. Use it as a template when you want to add evaluation to your agent development cycle.

Billing Agent — PostgreSQL + Stripe

A SaaS billing and subscription management agent that combines PostgreSQL (customer records, subscriptions, invoices, payments) with the Stripe API mock adapter. Demonstrates Mimic's cross-surface data consistency — the same customers appear in both the database and Stripe with matching IDs.

Personas: A growth-startup (50 customers across 3 tiers, mix of monthly/annual subscriptions, some past-due invoices, increasing MRR) and an established-saas (200+ customers, low churn, mostly enterprise annual contracts, clean billing history).

Architecture

textdual-surface architecture
                    +-------------------------+
                    |   Billing Agent (:3010)  |
                    |   OpenAI Agents SDK      |
                    |   + Claude Haiku         |
                    +-----------+-------------+
                                |
                   +------------+------------+
                   |                         |
             MCP (stdio)              MCP or HTTP
                   |                         |
          +--------+--------+     +----------+----------+
          |   PostgreSQL    |     |   Stripe Mock API   |
          |  (via Mimic)    |     |   (Mimic adapter)   |
          |                 |     |                     |
          |  customers      |     |  /v1/customers      |
          |  subscriptions  |     |  /v1/charges        |
          |  invoices       |     |  /v1/subscriptions  |
          |  payments       |     |  /v1/invoices       |
          +-----------------+     +---------------------+

Dual Stripe mode: The agent supports two approaches for interacting with Stripe — set USE_HTTP_STRIPE=true for direct HTTP tool calls, or leave it unset (default) to use the Stripe MCP server. Both approaches connect to the same Mimic mock adapter.

Config

jsonexamples/billing-agent/mimic.json
{
  "domain": "SaaS billing and subscription management platform",
  "personas": [
    { "name": "growth-startup", "description": "50 customers across 3 pricing tiers, mix of monthly/annual, some past-due invoices" },
    { "name": "established-saas", "description": "200+ customers, low churn, mostly enterprise annual contracts" }
  ],
  "databases": {
    "primary": {
      "type": "postgres",
      "url": "$DATABASE_URL",
      "schema": { "source": "prisma", "path": "./prisma/schema.prisma" }
    }
  },
  "apis": { "stripe": { "enabled": true, "mcp": true } }
}

Schema highlights

Four tables with Stripe ID cross-references: customers (with stripe_customer_id), subscriptions (with stripe_subscription_id), invoices (with stripe_invoice_id), and payments (with stripe_payment_id). This enables the agent to correlate database records with Stripe API objects.

Agent tools

SourceToolDescription
MCP (Postgres)get_customersQuery customers by name, email, plan, or status
MCP (Postgres)get_subscriptionsList subscriptions with status and billing info
MCP (Postgres)get_invoicesInvoice history with payment status
Stripe (MCP/HTTP)stripe_create_chargeCreate a charge against a Stripe customer
Stripe (MCP/HTTP)stripe_create_refundIssue full or partial refund on a charge
Stripe (MCP/HTTP)stripe_list_subscriptionsList subscriptions via Stripe API
Stripe (MCP/HTTP)stripe_get_balanceRetrieve account balance
Stripe (MCP/HTTP)stripe_list_invoicesList invoices via Stripe API

Quick start

bash
$ cd examples/billing-agent
$ docker compose up -d               # Start PostgreSQL
$ export DATABASE_URL="postgresql://mimic:mimic@localhost:5433/mimic_billing"
$ mimic run && mimic seed --verbose   # Seed database + Stripe mock
$ mimic host --background             # Start Stripe mock API$ cd agent && npm install && npm start
​
# Query billing data
$ curl -s -X POST http://localhost:3010/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Show customers with past-due invoices"}' | jq .
​
# Issue a refund via Stripe
$ curl -s -X POST http://localhost:3010/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Refund the last charge for customer cus_001"}' | jq .

Cross-surface consistency: Customers in PostgreSQL have matching stripe_customer_id values. The agent queries the database for customer info, then uses the Stripe ID to perform payment operations — exactly how a real billing agent works.

Budget Agent — PostgreSQL + Plaid

A personal budgeting assistant that combines PostgreSQL (budgets, savings goals) with the Plaid API mock adapter (linked bank accounts, transactions). Demonstrates how to build agents that bridge internal application data with external financial APIs.

Personas: A budget-conscious professional (tracks every dollar, strict monthly budgets, some overspending patterns) and a high-earner engineer (multiple accounts including investment, loose budgets, focused on savings rate).

Config

jsonexamples/budget-agent/mimic.json
{
  "domain": "Personal finance and budgeting app",
  "personas": [
    { "name": "budget-conscious", "description": "Young professional tracking every dollar, strict monthly budgets" },
    { "name": "high-earner", "description": "Senior engineer, multiple accounts, focused on savings rate" }
  ],
  "databases": {
    "primary": {
      "type": "postgres",
      "url": "$DATABASE_URL",
      "schema": { "source": "prisma", "path": "./prisma/schema.prisma" }
    }
  },
  "apis": { "plaid": { "enabled": true, "mcp": true } }
}

Schema highlights

Four tables covering the budgeting domain: accounts (with plaid_account_id cross-reference), transactions (with plaid_txn_id), budgets (per-category monthly limits with unique constraint on category+month), and savings_goals (target amounts with progress tracking).

Agent tools

SourceToolDescription
MCP (Postgres)get_budgetsQuery budget status per category and month
MCP (Postgres)get_savings_goalsCheck savings goal progress
MCP (Postgres)get_transactionsStored transaction history from database
Plaid (MCP/HTTP)get_plaid_accountsFetch linked bank accounts and balances
Plaid (MCP/HTTP)get_plaid_transactionsFetch recent transactions with date filters
Plaid (MCP/HTTP)get_plaid_balanceReal-time balance for a specific account

Quick start

bash
$ cd examples/budget-agent
$ docker compose up -d               # Start PostgreSQL
$ export DATABASE_URL="postgresql://mimic:mimic@localhost:5434/mimic_budget"
$ mimic run && mimic seed --verbose   # Seed database + Plaid mock
$ mimic host --background             # Start Plaid mock API$ cd agent && npm install && npm start
​
$ curl -s -X POST http://localhost:3011/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Am I over budget on dining this month?"}' | jq .
​
$ curl -s -X POST http://localhost:3011/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "How is my emergency fund savings goal going?"}' | jq .

Plaid integration: Accounts have matching plaid_account_id values, so the agent can correlate Plaid bank data with internal budget tracking. Ask about spending patterns, and the agent fetches live transactions from Plaid while checking budgets from PostgreSQL.

Payments Monitor — PostgreSQL + Stripe

A payment operations monitoring agent for SaaS platforms. Combines PostgreSQL (payment metrics, charges, subscriptions, daily aggregates) with the Stripe API (live payment operations). Built for ops teams who need to monitor payment health, investigate failures, and take action on at-risk subscriptions.

Personas: A healthy-business (95% payment success rate, <2% churn, steady MRR growth, 500 active subscriptions) and a struggling-business (15% failure rate, 8% churn, rising refunds, needs dunning and recovery workflows).

Config

jsonexamples/payments-monitor/mimic.json
{
  "domain": "Payment operations dashboard for a SaaS platform",
  "personas": [
    { "name": "healthy-business", "description": "95% success rate, <2% churn, 500 subscriptions" },
    { "name": "struggling-business", "description": "15% failure rate, 8% churn, needs dunning workflows" }
  ],
  "databases": {
    "primary": {
      "type": "postgres",
      "url": "$DATABASE_URL",
      "schema": { "source": "prisma", "path": "./prisma/schema.prisma" }
    }
  },
  "apis": { "stripe": { "enabled": true, "mcp": true } }
}

Schema highlights

Five tables for payment operations: customers (with stripe_id), charges (with failure codes like card_declined, expired_card, insufficient_funds), subscriptions (with cancel reasons), payment_events (webhook-style event log), and daily_metrics (pre-aggregated success rates, revenue, churn by day).

Agent tools

SourceToolDescription
Direct (Postgres)get_payment_success_rateSuccess rate for a date or range from daily_metrics
Direct (Postgres)get_failed_chargesList failed charges with failure reasons and customer info
Direct (Postgres)get_mrr_and_churnCurrent MRR, churn rate, and churned subscriptions
Direct (Postgres)get_at_risk_subscriptionsPast-due or unpaid subscriptions needing outreach
Direct (Postgres)get_revenue_timelineDaily revenue and charge metrics for trend analysis
Stripe (HTTP)retry_failed_paymentRetry a failed charge via Stripe API
Stripe (HTTP)issue_refundIssue full or partial refund
Stripe (HTTP)get_stripe_balanceCheck current Stripe account balance

Quick start

bash
$ cd examples/payments-monitor
$ docker compose up -d               # Start PostgreSQL
$ export DATABASE_URL="postgresql://mimic:mimic@localhost:5435/mimic_payments"
$ mimic run && mimic seed --verbose
​
$ cd agent && npm install && npm start
​
# Monitor payment health
$ curl -s -X POST http://localhost:3012/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What is the payment success rate this week?"}' | jq .
​
# Investigate failures
$ curl -s -X POST http://localhost:3012/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Show me the most common failure reasons and which customers are affected"}' | jq .
​
# Check churn
$ curl -s -X POST http://localhost:3012/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What is our MRR and churn rate?"}' | jq .

Persona contrast: Switch between the healthy-business and struggling-business personas to see radically different payment data. The healthy business shows clean metrics; the struggling one surfaces failure patterns, at-risk subscriptions, and churn spikes — perfect for testing monitoring and alerting agents.

Meeting Notes — PostgreSQL + Slack

A team meeting management agent that combines PostgreSQL (meetings, action items, decisions, team members) with the Slack API mock adapter (posting summaries, searching messages, listing channels). Demonstrates how agents can bridge internal data with communication platforms.

Personas: An engineering-team (10-person team with daily standups, weekly sprint planning, bi-weekly retros, active Slack workspace) and a cross-functional team (product/engineering/design with weekly syncs, monthly all-hands, design reviews).

Config

jsonexamples/meeting-notes/mimic.json
{
  "domain": "Team meeting management and note-taking platform",
  "personas": [
    { "name": "engineering-team", "description": "10-person team, daily standups, sprint planning, retros" },
    { "name": "cross-functional", "description": "Product/eng/design team, weekly syncs, monthly all-hands" }
  ],
  "databases": {
    "primary": {
      "type": "postgres",
      "url": "$DATABASE_URL",
      "schema": { "source": "prisma", "path": "./prisma/schema.prisma" }
    }
  },
  "apis": { "slack": { "enabled": true, "mcp": true } }
}

Schema highlights

Five tables capturing the meeting domain: meetings (with type enum: standup, sprint-planning, retro, sync, all-hands, design-review; includes slack_channel and slack_thread_ts for cross-referencing), team_members (with slack_user_id), meeting_participants (attendance tracking), action_items (with status lifecycle), and decisions (with context and attribution).

Agent tools

SourceToolDescription
Direct (Postgres)get_recent_meetingsList meetings with participant/action item counts
Direct (Postgres)search_action_itemsSearch by status, assignee, or keyword
Direct (Postgres)get_meeting_decisionsDecisions with context and attribution
Direct (Postgres)get_team_membersTeam info with attendance stats and open items
Slack (HTTP)list_slack_channelsAvailable channels for posting summaries
Slack (HTTP)post_meeting_summaryCompose and post formatted summary to a channel
Slack (HTTP)search_slackSearch messages for prior discussions

Quick start

bash
$ cd examples/meeting-notes
$ docker compose up -d               # Start PostgreSQL
$ export DATABASE_URL="postgresql://mimic:mimic@localhost:5436/mimic_meetings"
$ mimic run && mimic seed --verbose
$ mimic host --background             # Start Slack mock API$ cd agent && npm install && npm start
​
# Review meetings
$ curl -s -X POST http://localhost:3013/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What were the key decisions from last sprint planning?"}' | jq .
​
# Track action items
$ curl -s -X POST http://localhost:3013/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Show all open action items assigned to engineers"}' | jq .
​
# Post to Slack
$ curl -s -X POST http://localhost:3013/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Post the summary of meeting #5 to the #engineering channel"}' | jq .

Slack integration: Meeting records in PostgreSQL have slack_channel and slack_thread_ts fields that update when summaries are posted. Team members have slack_user_id for mention support. The agent composes rich Slack Block Kit messages with headers, action items, and decisions.

CFO Agent — PostgreSQL + 8 Billing Platforms

The most complete Mimic example. A conversational CFO assistant for a growth-stage SaaS company that reasons across 8 billing platforms simultaneously (Stripe, Paddle, Chargebee, GoCardless, RevenueCat, Lemon Squeezy, Zuora, Recurly) plus a PostgreSQL product database. Uses a LangGraph supervisor + sub-agent architecture and ships with a full Next.js chat UI.

Persona: A single richly-detailed growth-saas persona — Verida Analytics, a growth-stage B2B analytics company with ~£127k MRR split across all 8 platforms: Stripe (£77k, 61%), Paddle (£28k EU, 22%), RevenueCat (£15k mobile, 12%), plus Chargebee, GoCardless, Lemon Squeezy, Zuora, and Recurly for specialised segments. The persona includes deliberate anomalies: a RevenueCat dip from an App Store outage, 3 overdue Chargebee invoices, GoCardless funds pending settlement, and 14 Pro users who haven't logged in for 30+ days.

Architecture

textcfo-agent architecture
Browser (localhost:3000)
  └─ Next.js UI → POST /api/chat
       └─ CFO Agent server (localhost:3003)
            └─ LangGraph Supervisor
                 ├─ query_postgres
                 ├─ query_stripe
                 ├─ query_paddle
                 ├─ query_chargebee
                 ├─ query_gocardless
                 ├─ query_revenuecat
                 ├─ query_lemonsqueezy
                 ├─ query_zuora
                 └─ query_recurly

mimic host (separate terminal) ├─ postgres MCP :4201 ├─ stripe API :4101 | MCP :4202 ├─ paddle API :4102 | MCP :4203 ├─ chargebee API :4103 | MCP :4204 ├─ gocardless API :4104 | MCP :4205 ├─ revenuecat API :4105 | MCP :4206 ├─ lemonsqueezy API:4106 | MCP :4207 ├─ zuora API :4107 | MCP :4208 └─ recurly API :4108 | MCP :4209

Config

jsonexamples/cfo-agent/mimic.json
{
  "domain": "Multi-platform SaaS billing — Verida Analytics, ~£127k MRR across 8 billing platforms",
  "llm": { "provider": "anthropic", "model": "claude-sonnet-4-6" },
  "personas": [{ "name": "growth-saas", "description": "Verida Analytics — £127k MRR, 2,847 customers, 8 billing platforms..." }],
  "generate": { "volume": "6 months", "seed": 42 },
  "databases": {
    "primary": { "type": "postgres", "url": "$DATABASE_URL", "schema": { "source": "prisma", "path": "./prisma/schema.prisma" } }
  },
  "apis": {
    "stripe":       { "enabled": true, "mcp": true },
    "paddle":       { "enabled": true, "mcp": true },
    "chargebee":    { "enabled": true, "mcp": true },
    "gocardless":   { "enabled": true, "mcp": true },
    "revenuecat":   { "enabled": true, "mcp": true },
    "lemonsqueezy": { "enabled": true, "mcp": true },
    "zuora":        { "enabled": true, "mcp": true },
    "recurly":      { "enabled": true, "mcp": true }
  }
}

PostgreSQL schema

Four tables designed for cross-platform reconciliation. The billing_platform and external_id columns on users let the supervisor correlate product-side records against any of the 8 billing platforms.

TableKey columns
usersemail, plan, status, billing_platform, external_id, mrr_cents, last_login_at
eventsuser_id, event_type, properties, created_at
usage_metricsuser_id, period (YYYY-MM), api_calls, seats_used, storage_gb, exports
feature_flagsuser_id, flag_name, enabled

Agent tools

The LangGraph supervisor routes each question to the right sub-agent. Each sub-agent connects to its MCP server over Streamable HTTP (since mimic host starts multiple servers).

Sub-agentMCP portWhat it answers
query_postgres:4201User records, usage metrics, feature flags, events, churn risk
query_stripe:4202Core web subscriptions, charges, invoices, refunds (£77k MRR)
query_paddle:4203EU & international billing, VAT-inclusive prices (£28k MRR)
query_chargebee:4204Enterprise invoicing, overdue invoices, contract management
query_gocardless:4205UK direct debit mandates, payment collection, settlement status
query_revenuecat:4206Mobile app subscriptions, App Store / Play Store entitlements
query_lemonsqueezy:4207Individual dev licenses, one-time purchases
query_zuora:4208Enterprise usage-based contracts, metered billing
query_recurly:4209Legacy subscriber management, migrated long-term accounts

Quick start

bash
# 1. Start PostgreSQL
$ cd examples/cfo-agent
$ docker compose up -d
​
# 2. Configure environment
$ cp .env.example .env
# Add ANTHROPIC_API_KEY (or OPENAI_API_KEY)# 3. Set up Prisma schema
$ export $(cat .env | xargs)
$ npx prisma generate && npx prisma migrate dev --name init
​
# 4. Generate and seed
$ pnpm exec mimic run
$ pnpm exec mimic seed --verbose
​
# 5. Start mimic host (new terminal) — brings up all 9 MCP servers
$ export $(cat .env | xargs) && pnpm exec mimic host
​
# 6. Start the agent (new terminal)
$ cd agent && npm install && export $(cat ../.env | xargs) && npm start
​
# 7. Start the UI (new terminal)
$ cd ui && npm install && npm run dev
# Open http://localhost:3000

Demo questions

bash
$ curl -s -X POST http://localhost:3003/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "What'\''s our MRR right now?"}' | jq .
​
$ curl -s -X POST http://localhost:3003/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Give me the full picture for my investor meeting"}' | jq .
​
$ curl -s -X POST http://localhost:3003/chat \
    -H "Content-Type: application/json" \
    -d '{"message": "Are any customers paying for a plan they'\''re not using?"}' | jq .

The flagship example: This is Mimic at full scale — one persona, 8 billing platforms, 9 simultaneous MCP servers, a supervisor agent that routes across all of them, and a polished chat UI. Use it to see what end-to-end agent testing looks like when your product touches multiple billing providers.