Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.sigmic.ai/llms.txt

Use this file to discover all available pages before exploring further.

Use Cases

The Task API is more than a wrapper around an LLM. Each task runs inside an isolated cloud sandbox with access to tools — file I/O, shell commands, web search, MCP server integrations — and the agent can call these tools iteratively, adapting its approach based on each result. This makes it suited for complex, multi-step workflows that a single LLM call cannot handle.
These use cases leverage the agent’s ability to chain dozens of tool calls, where each step’s output informs the next step’s input. The fire-and-forget execution model means your application doesn’t need to stay connected — just create the task, then poll or stream for results.

Data Reconciliation

Query two systems via MCP, match records, identify discrepancies, and produce a downloadable report.

Document Processing

Upload a ZIP of documents, parse each adaptively, and produce a consolidated dataset as downloadable artifacts.

Recurring Pipeline

Schedule daily tasks that query multiple systems, compare metrics against targets, and alert on anomalies.

Cross-System Data Reconciliation

Problem: Manually comparing records across two systems (e.g., payment processor vs. internal database) is tedious, error-prone, and time-consuming. Solution: The agent queries both systems via MCP servers, matches records, identifies discrepancies, and produces a downloadable report.

How It Works

The agent performs dozens of tool calls across two MCP-connected systems:
  1. Queries the internal database for all paid orders in a date range
  2. Paginates through the payment processor API to fetch all matching payments
  3. Writes and runs a matching script inside the sandbox (fuzzy matching on amount, email, timestamp)
  4. For each mismatch, drills into both systems to pull full record details
  5. Produces a reconciliation report and discrepancy CSV as downloadable artifacts

Why This Needs the Task API

  • Multiple MCP servers — the agent queries two independent systems in a single task
  • Pagination — payment APIs return paginated results; the agent must loop through pages
  • Adaptive logic — the matching strategy depends on what fields are available, discovered at runtime
  • Shell execution — the agent writes and runs a Python script for fuzzy matching inside the sandbox
  • Artifact generation — the final CSV and summary report are real files the caller can download

Example

# Create a reconciliation task with database and Stripe credentials
curl -s -X POST https://api.sigmic.ai/api/v1/tasks \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Reconcile all paid orders from January 2026 in our database against Stripe payments. Find any mismatches — orders without payments and payments without orders. Produce a summary report and a CSV of discrepancies.",
    "secrets": {
      "DATABASE_URL": "postgres://user:pass@host/db",
      "STRIPE_API_KEY": "sk_live_..."
    },
    "env": {
      "DATE_FROM": "2026-01-01",
      "DATE_TO": "2026-01-31"
    }
  }'

What the Agent Produces

After completion, the artifacts endpoint returns files like:
{
  "files": [
    {
      "name": "reconciliation_discrepancies.csv",
      "path": "downloads/reconciliation_discrepancies.csv",
      "size": 15234,
      "category": "csv"
    },
    {
      "name": "reconciliation_summary.md",
      "path": "downloads/reconciliation_summary.md",
      "size": 3891,
      "category": "markdown"
    }
  ]
}
This use case requires MCP servers configured with access to your database and payment provider. Use dynamic token injection with secrets to pass credentials securely per-request.

Bulk Document Processing

Problem: You have a batch of documents (invoices, reports, contracts) in varying formats that need to be parsed, normalized, and aggregated into a single structured dataset. Solution: Upload a ZIP archive of documents. The agent extracts the archive, reads each file, adapts its parsing strategy per document format, and produces a consolidated output.

How It Works

  1. The ZIP archive is auto-extracted on upload into the sandbox workspace
  2. The agent lists the extracted files and inspects sample documents to understand the format variation
  3. For each document, the agent reads the content and extracts structured fields (vendor, date, amount, line items, etc.)
  4. When a document has an unexpected format, the agent adapts — trying different parsing strategies rather than failing
  5. The agent runs a Python script to aggregate, deduplicate, and validate the extracted data
  6. Produces a consolidated CSV ledger and an anomaly report as downloadable artifacts

Why This Needs the Task API

  • ZIP extraction — the archive is auto-extracted; the agent discovers the file count at runtime
  • Per-file iteration — processing 50+ documents requires 50+ read operations, each with unique parsing
  • Adaptive parsing — real-world documents have inconsistent formats; the agent must adjust its strategy per file
  • Shell execution — aggregation, deduplication, and anomaly detection run as Python scripts in the sandbox
  • Long-running — processing a large batch takes minutes; fire-and-forget execution with SSE streaming keeps the caller informed

Example

# Upload a ZIP of invoices for batch processing
curl -s -X POST https://api.sigmic.ai/api/v1/tasks \
  -H "Authorization: Bearer $API_KEY" \
  -F "message=Process all invoices in this archive. For each invoice, extract: vendor name, invoice number, date, line items, subtotal, tax, and total. Produce a consolidated CSV ledger and flag any anomalies (duplicates, missing fields, unusual amounts)." \
  -F "files=@invoices_q4.zip"

Iterating with Follow-ups

After the initial processing completes, use follow-up messages to refine the results without re-uploading files:
# The agent still has access to all extracted files in the workspace
curl -s -X POST https://api.sigmic.ai/api/v1/tasks/$TASK_ID/messages \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Now split the ledger into separate CSV files by vendor. Also convert all amounts to USD using today'\''s exchange rates."}'
The agent searches for current exchange rates, applies the conversion, and generates per-vendor CSV files — all within the same sandbox session. If the session expired, it is automatically restored.

Recurring Data Pipeline (Cron-Triggered)

Problem: Your team needs a daily operations report that pulls data from multiple sources — databases, payment systems, monitoring tools — compares metrics against targets, and alerts on anomalies. Building and maintaining a custom pipeline for this is expensive. Solution: A scheduled job calls the Task API daily. The agent queries multiple systems, synthesizes the data, generates a report artifact, and posts alerts to Slack when metrics are off-track.

How It Works

  1. A cron job (or scheduler) fires POST /api/v1/tasks daily with the current date in env
  2. The agent queries the database via MCP for revenue, signups, and churn numbers
  3. The agent queries the payment processor via MCP for payment volume and failure rates
  4. The agent runs a Python script to compare actuals vs. targets and compute trends
  5. The agent generates a formatted daily report as a downloadable artifact
  6. If any metric is off-track, the agent posts an alert to Slack via MCP with the specific numbers

Why This Needs the Task API

  • Multi-source aggregation — the agent queries 2-3 MCP servers and the web in a single task
  • Computed analysis — the agent writes and runs scripts to compare actuals vs. targets, compute week-over-week trends
  • Conditional branching — alerts are only sent when metrics breach thresholds; the agent decides at runtime
  • Unattended execution — the fire-and-forget model is designed for scheduled, headless operation
  • Artifacts — the report is a real downloadable file, not just text in a response

Example: Scheduler Integration

import cron from 'node-cron';

// Run daily at 8:00 AM
cron.schedule('0 8 * * *', async () => {
  const today = new Date().toISOString().split('T')[0];

  const response = await fetch(`${BASE_URL}/api/v1/tasks`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      message: `Generate the daily operations report for ${today}.
        Pull revenue, signups, and churn from the database.
        Pull payment volume and failure rates from Stripe.
        Compare all metrics against our targets.
        Save the report as a downloadable markdown file.
        If any metric is more than 10% off target, post an alert
        to the #ops-alerts Slack channel with the specific numbers.`,
      env: {
        REPORT_DATE: today,
        REVENUE_TARGET: '15000',
        SIGNUP_TARGET: '50',
        CHURN_TARGET: '2'
      },
      secrets: {
        DATABASE_URL: process.env.DATABASE_URL,
        STRIPE_API_KEY: process.env.STRIPE_API_KEY,
        SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN
      },
      showInHistory: false
    })
  });

  const { data: { id: taskId } } = await response.json();
  console.log(`Daily report task started: ${taskId}`);
});

Retrieving the Report

After the task completes, download the generated report:
# List artifacts to find the report
curl -s https://api.sigmic.ai/api/v1/tasks/$TASK_ID/artifacts \
  -H "Authorization: Bearer $API_KEY" | jq

# Download the report
curl -O https://api.sigmic.ai/api/v1/tasks/$TASK_ID/artifacts/download?path=downloads/daily_report_2026-02-16.md \
  -H "Authorization: Bearer $API_KEY"
Set showInHistory: false for automated pipeline tasks so they don’t clutter the conversation list in the chat UI.

Common Patterns Across Use Cases

These use cases share architectural patterns that apply to any complex Task API integration:

Fire-and-Forget + Poll/Stream

All three examples use the same flow: create the task, then either stream or poll for completion. Your application doesn’t need to maintain a long-lived connection during execution.

Secrets for Credential Injection

Use secrets to pass credentials that the agent needs at runtime. Secrets are never stored, never logged, and never returned in any API response. They are held in memory only for the task’s duration.

Artifacts as Outputs

The agent writes its final outputs to the sandbox filesystem. Use the artifacts API to list and download these files after the task completes.

Follow-ups for Iteration

After reviewing the initial output, send follow-up messages to refine results. The agent retains full context from the original task, and expired sessions are automatically restored.

What’s Next

Create a Task

Start building with the Task API

MCP Servers

Connect external systems to extend agent capabilities

Streaming Events

Monitor task execution in real-time

Artifacts

Download files generated by the agent