How Raft.build scales agent log analytics
Raft.build paired PostgreSQL, RisingWave, and Redis with ScopeDB so engineers and agents query raw trace logs via ScopeQL without table migrations.
By Dillip Chowdary • Dec 03, 2026 • Source: scopedb.io

At a glance
- Company
- Raft.build and ScopeDB
- Primary store
- ScopeDB queried via ScopeQL
- Core tables
- raft.trace_events_v2 and product.events
- Operational stack
- PostgreSQL, RisingWave, Redis
- Public mirror
- botiverse/raft-source
- Example triage
- v1.21.23 vs v1.21.22 (142 vs 2 errors)
In this post
Raft.build adopted ScopeDB as a single queryable observability store so both human engineers and dedicated AI agents can inspect high-concurrency trace and event logs, according to scopedb.io's report. As more autonomous agents collaborated inside Raft's shared channels, threads, and tasks, trace volume grew beyond what its primary PostgreSQL database could sustainably absorb.
This engineering breakdown covers how Raft separated transactional state from telemetry, designed semi-structured ScopeDB tables without rigid migrations, and equipped observability agents to debug production regressions using ScopeQL pipeline queries. It is written for backend engineers, SREs, and platform teams scaling multi-agent observability.
01Separating transactional state from agent telemetry
Raft operates an agent-native workspace where AI agents hold their own identities, memory, and workspaces while claiming tasks, reviewing code, and working alongside people in joint channels. Behind every chat thread lies continuous backend activity spanning API calls, message routing, retries, task handoffs, and database queries.
As additional agents entered those workspaces, telemetry multiplied faster than transactional workloads. In Raft's operational stack, PostgreSQL stores live messages, tasks, and audit records, RisingWave consumes PostgreSQL change streams to power real-time views like inboxes and unread counts, and Redis coordinates active services.
Pushing weeks of high-concurrency agent traces into PostgreSQL threatened transactional stability. Raft placed ScopeDB alongside those operational stores to retain raw server, browser, and local daemon traces without slowing live workspace state.
02Shared channels between humans and agents
Beyond serving as a passive log sink, ScopeDB became part of a cross-company engineering workflow. ScopeDB founder Yu Lei, Raft CTO Tenny Zhuang, and agents from both organizations collaborate inside a shared Raft channel.
When an engineer needs to inspect a query pattern, check materialized index coverage, or verify telemetry after a rollout, they ask Raft's dedicated observability agent Leiysky directly in the room rather than opening tickets. Zhuang noted that the shared channel turned a vendor-customer relationship into a two-way proving ground where ScopeDB hardens against concurrent agent workloads and Raft gains verifiable observability.
Because agents and engineers query the exact same ScopeDB tables, post-release verification and incident triage happen inside the conversation where code changes are already discussed.
03Typed trace tables and schema-free properties
Advertisement
Tech Pulse Daily
Get tomorrow's pulse first
Join engineers who read Tech Pulse before stand-up. Free, weekday mornings.
Raft emits server traces directly to ScopeDB while routing browser and daemon telemetry through an upload service. Each record logs service name, deployment version, trace and span IDs, operation name, timestamp, and outcome inside a typed table called raft.trace_events_v2.
Product usage events land in a companion product.events table pairing typed dimensions—timestamp, deployment_environment, uuid, app_version, platform, and event—with a semi-structured object column named properties. When a new feature introduces fresh attributes, engineers ship without running table migrations or rewriting ingestion pipelines.
Queries extract and cast nested attributes on the fly, such as properties['operation_id']::string, and Raft publishes its trace contracts and ScopeDB writers in the public botiverse/raft-source mirror. When a nested field becomes heavily queried, the team adds an index in place instead of copying history into another store.
04Pipeline ScopeQL queries for regression triage
Before a release rolls out, Raft's observability agents inspect release-candidate traces on staging; after deployment, they compare production spans against the previous version or the prior day's window. ScopeQL uses a top-to-bottom pipeline syntax—FROM, WHERE, DISTINCT ON, GROUP BY, and AGGREGATE—that avoids the nested subqueries and CTEs where agent-generated SQL often drops column scope.
In a documented v1.21.23 rollout scenario where messages.insert errors spiked to 142 compared with 2 on v1.21.22, the investigating agent filtered completed server.db.query spans in raft.trace_events_v2, deduplicated on service_name, trace_id, and span_id, and grouped by service_version, db_system, query_name, and outcome.
| Query Stage | Filter or Grouping | Purpose in Agent Triage |
|---|---|---|
| Stage 1: Volume check | DISTINCT ON span_id, GROUP BY service_version, query_name, outcome | Isolate which release and query spiked |
| Stage 2: Error drilldown | WHERE outcome = 'error', GROUP BY phase, reason, sqlstate, error_message | Distinguish statement_timeout (57014) from constraint errors |
| Stage 3: Trace lookup | max_by(trace_id, event_time) AS latest_trace_id | Pull full request context and verify post-fix recovery |
Returning raw driver errors, SQLSTATE codes such as 57014 for statement timeouts, and a sample latest_trace_id gives the service owner an actionable root cause in seconds.
05Keeping raw events queryable for future checks
Traditional monitoring pipelines frequently aggregate metrics at ingest time, discarding individual span attributes to save storage. Raft's architecture preserves raw event-level rows so engineers and agents can ask unpredicted questions weeks later without building new ETL jobs or summary tables.
Filtering, full-text search, aggregations, and joins all execute over the same ScopeDB tables. Once an agent isolates a regression window, widening the time filter reveals whether the failure predated the release, and re-running the identical ScopeQL pipeline after a patch confirms clearance.
As multi-agent systems generate denser cross-process call graphs, separating transactional databases from raw, agent-queryable trace stores gives teams a reliable pattern for automated verification without risking production database contention.
Frequently asked questions
Why did Raft.build move agent trace logs out of PostgreSQL?
PostgreSQL already managed Raft's live messages, tasks, and transactional state, so storing weeks of high-concurrency agent traces and events in the same database was not sustainable.
How does Raft handle changing product event schemas in ScopeDB?
Raft keeps core fields like timestamp, app_version, and platform in typed columns inside product.events and stores feature-specific payloads in a semi-structured properties object column, avoiding table migrations.
Why does ScopeQL work well for AI observability agents?
ScopeQL executes in a linear pipeline order (FROM, WHERE, DISTINCT ON, GROUP BY, AGGREGATE), letting agents deduplicate spans and compare releases without complex nested subqueries or CTEs.
What else sits in Raft's operational data stack alongside ScopeDB?
Raft uses PostgreSQL for transactional records, RisingWave to materialize live inbox and unread views from Postgres changes, and Redis for service coordination.
Sources
Author
Dillip Chowdary
Writes Tech Bytes coverage of AI, engineering, and the tools that actually ship. Editor of Tech Pulse Daily.
Related on Tech Bytes
The Zero-Trust Economy: sharing with a stranger's agent
Read →
It's a Harness, Not a Dollhouse
Read →
Backbone’s PlayStation-friendly mobile controller now looks more like a DualShock
Read →
Device-code phishing campaign plants rogue devices in 305 Entra tenants
Read →
Today's Tech Pulse briefing
Full briefing →
Advertisement