Back to Changelog
|v1.5.0

AgentPost v1.5 -- Production & Intelligence

apisdknew-feature

AgentPost v1.5 is a major milestone that takes the platform from developer-ready to production-ready. This release adds billing and subscription management, AI-powered email intelligence, full-text search, automatic labeling, data retention policies, four production-ready example applications, and comprehensive deployment and monitoring infrastructure.

Billing and Subscriptions

AgentPost now supports Stripe-powered billing with a complete subscription lifecycle. You can create checkout sessions, manage plan changes (upgrades and downgrades with proration), cancel subscriptions, and access a billing portal for invoice history.

Usage-based overage metering tracks consumption beyond plan limits and reports it to Stripe automatically. Trial expiry handling and a full dunning flow with grace periods ensure that non-paying organizations are suspended gracefully -- and reinstated when payment resumes.

The console includes a billing page with invoice history, plan management, and a usage dashboard. All billing functionality is behind the BILLING_ENABLED feature flag, so self-hosted deployments can skip it entirely.

Usage Tracking and Alerts

Per-organization usage counters now track messages sent, messages received, storage bytes, API calls, and webhook deliveries in real time. You can configure soft and hard limits per org tier, and AgentPost will emit usage.warning and usage.exceeded webhook events when thresholds are crossed.

The console usage dashboard shows real-time counters with limit indicators, and weekly usage summary emails keep organization owners informed.

Data Retention and Backup

A new retention policy API lets you set per-organization message retention periods. Automatic cleanup workers handle expired messages and orphan attachments on schedule, with warning emails sent before deletion begins.

A full organization data export endpoint (GET /organizations/:id/export) packages all org data for download. On the infrastructure side, database backup and restore scripts support pg_dump custom format and WAL archiving for point-in-time recovery.

AI-Powered Email Intelligence

AgentPost now integrates with OpenAI to generate email embeddings using the text-embedding-3-small model. Each organization can configure AI settings independently -- bring your own OpenAI API key or use a platform-provided key.

Cost tracking includes monthly token budgets with an automatic circuit breaker that pauses embedding when the budget is exhausted. A backfill service lets you generate embeddings for existing messages, and Prometheus metrics provide visibility into the AI pipeline.

All AI features require an OPENAI_API_KEY environment variable and are gracefully disabled when it is not configured.

A new hybrid search endpoint combines vector similarity (powered by the AI embeddings above) with traditional keyword matching, scored using Reciprocal Rank Fusion (RRF). You can filter results by inbox, date range, labels, and read status.

Search analytics track query patterns for monitoring. Both the TypeScript and Python SDKs include search resources:

// TypeScript
const results = await client.search.query({
  query: "invoice from Acme",
  inbox_id: "inbox_01JQ...",
});
# Python
results = client.search.query(
    query="invoice from Acme",
    inbox_id="inbox_01JQ...",
)

A 3-second timeout on embedding generation ensures search stays fast -- if the embedding times out, AgentPost falls back to keyword-only search automatically.

The console includes a search results page with filters, accessible via the Ctrl+K command palette.

Auto-Labeling and Extraction

Rule-based auto-labeling lets you classify incoming emails automatically using AI or keyword matching. Create classification rules via POST /auto-label-rules with preset patterns available for common categories (spam, support, billing, and more).

Data extraction configs let you define structured data schemas per inbox -- AgentPost will extract fields from incoming messages using GPT-4o-mini and attach the results as structured metadata.

Classification runs automatically on message.received events via a background worker, so your agents can react to labeled and enriched messages immediately.

The console includes management pages for auto-label rules and extraction configs under the Intelligence navigation group.

Example Applications

Four production-ready example applications demonstrate common AgentPost patterns:

  • Auto-Reply Agent -- Automatic email responses using AI-generated replies
  • Support Ticket Router -- Classify and route support emails to the right team
  • Invoice Processor -- Extract structured invoice data from emails with AI
  • Newsletter Digest -- Compile periodic email digests from incoming messages

Each example includes a README, .env.template, and a simulate mode for testing without live email.

Infrastructure and Security

This release includes comprehensive production deployment tooling:

  • Docker Compose deployment with Caddy reverse proxy and automatic TLS
  • LXC deployment option for Proxmox users
  • CI/CD pipelines via GitHub Actions: lint, test, Docker build, security scanning (CodeQL)
  • Prometheus and Grafana monitoring stack with Alertmanager and pre-built dashboards
  • Rate limiting per-route and per-auth-level with Redis-backed sliding windows
  • Security hardening including CORS, CSP headers, SSRF protection, and OWASP audit
  • Connection pooling with PgBouncer support
  • Graceful shutdown with ordered resource drain

Integration Testing

A new integration test suite uses Vitest projects with schema-per-suite isolation for reliable parallel execution. Coverage includes auth, webhook, domain, inbox, message, and thread flows, plus SDK contract tests. All tests run in CI via GitHub Actions.

Bug Fixes

  • Fixed orphaned usage counters for webhook_deliveries and auth failure tracking
  • S3 health check now uses ListObjectsV2 instead of HeadBucket for more reliable status checks
  • pg-boss cron queue creation now happens before scheduling to prevent startup race conditions
  • Usage tracking middleware properly scoped to API routes (excludes health, metrics, and webhook receiver endpoints)

Marketing Site

New marketing landing page at agent-post.dev with feature overview, pricing comparison, and documentation links.

Getting Started

If you are upgrading from v1.0, no breaking changes are required. New features are additive and gated behind configuration:

  • Set BILLING_ENABLED=true and configure Stripe keys to enable billing
  • Set OPENAI_API_KEY to enable AI intelligence, search, and auto-labeling
  • See the deployment guide for Docker Compose and LXC setup