Event-native metrics layer

Business metrics that move when events happen.

Every metric declares which events move it, and the serving layer keeps reads fresh by invalidating its cache when events arrive — a measured 1.1 s p50 event-to-metric freshness. Query live entities and metrics over typed contracts, from Python or TypeScript. Consumers are whoever needs the number now: people, dashboards, services, and AI agents.

Core stack
Kafka -> Flink -> DuckDB or Iceberg -> FastAPI
SDKs
Python and TypeScript
License
MIT

Problem

A decision is only as good as the number behind it.

BI on a replica answers yesterday's questions, and most workflows still read from stale warehouse snapshots, ad hoc service calls, or a cache that quietly serves 30-second-old numbers. That breaks down fastest in support, operations, and merchandising, where a six-hour-old answer is often worse than no answer at all. AgentFlow turns live operational data into a serving layer with typed entities, metrics, query endpoints, and explicit freshness signals.

User journeys

Built for the moments where stale context costs money.

Support Live entity lookup

Answer "where is my order?" from current state.

GET /v1/entity/order/ORD-20260404-1001

{
  "status": "delivered",
  "freshness_seconds": 12.4
}
Ops Freshness and SLO

Check pipeline health before the incident worsens.

GET /v1/health
GET /v1/slo

healthy
error_budget_remaining: 0.91
Merch Query and ranking

Rank top products without writing SQL by hand.

POST /v1/query

{
  "question": "top products by revenue today",
  "limit": 5
}

Why AgentFlow

A serving layer, not another dashboard tool.

Freshness surfaced

Responses carry freshness and health context so agents can caveat or escalate instead of bluffing.

Dual SDK parity

The same core API is reachable from Python and TypeScript without custom wrappers per workflow.

Contracts, not guesswork

Schema contracts, diffs, and version-aware responses make downstream agent tooling safer to evolve.

Self-directed deployment

Run the local demo path now, or extend toward the full streaming stack without rewriting the API surface.

Performance baseline

Current benchmark numbers from the repository baseline.

Source: docs/benchmark-baseline.json, checked on 2026-04-18.

56 ms aggregate p50 latency
260 ms aggregate p95 latency
330 ms aggregate p99 latency
27.8 RPS single-node requests per second
0% observed failure rate

Get started

Run the local path first.

Start with the demo path, inspect the API surface, then move into the benchmark, contracts, and operational routes. The quickest way to get signal is to query a seeded order and one live metric.

pip install agentflow-client

from agentflow import AgentFlowClient

client = AgentFlowClient(
    "http://localhost:8000",
    api_key="dev-key",
)
print(client.get_metric("revenue", "24h").value)