Skip to main content

TRACEFORGE

Behavioral CI/CD and Runtime Intelligence Platform for AI Applications.

TRACEFORGE Foundation v0.1 provides an end-to-end local vertical slice for capturing, ingesting, persisting, and querying execution traces from AI agents, LLM calls, retrieval engines, and tools.


Architecture Overview

[ Example Agent App ]
         │
  (TRACEFORGE SDK)
         │
 (OpenTelemetry API)
         │
         ▼
[ FastAPI Collector ] ──POST /api/v1/traces──► [ PostgreSQL ]
                                                      ▲
[ REST API / Consumer ] ──GET /api/v1/traces/{id}─────┘

Component Layout

  • sdk/traceforge/: Python SDK built on OpenTelemetry API for wrapping trace & span executions.
  • collector/app/: FastAPI server for receiving telemetry payloads (main.py, schemas.py) and PostgreSQL storage persistence (db.py, models.py).
  • examples/basic_agent/: Minimal runnable script simulating nested agent operations (agent_run -> llm_call, retrieval, tool_call).
  • tests/: Automated unit and integration test suite (test_sdk.py, test_api.py, test_storage.py).
  • docs/: Product specification (product.md) and technical architecture details (architecture.md).

Getting Started

1. Environment Setup & Dependencies

Requires Python 3.12+.

# Create and activate a virtual environment
python -m venv .venv

# Windows (PowerShell)
.venv\Scripts\Activate.ps1

# Linux/macOS
source .venv/bin/activate

# Install dependencies and local packages in editable mode
pip install traceforge-sdk ".[dev]"

2. Configuration & Environment Variables

Configure application settings via environment variables or a local .env file:

DATABASE_URL=postgresql+psycopg://traceforge:traceforge_dev_pass@localhost:5432/traceforge
TRACEFORGE_COLLECTOR_URL=http://localhost:8000/api/v1/traces
HOST=0.0.0.0
PORT=8000

3. Start PostgreSQL Database

Launch the local PostgreSQL 16 container via Docker Compose:

docker compose up -d postgres

Verify that PostgreSQL container is running and healthy:

docker compose ps

4. Start TRACEFORGE Collector & REST API

Run the FastAPI server using uvicorn:

uvicorn collector.app.main:app --host 0.0.0.0 --port 8000 --reload

The service will automatically create database tables (traces and spans) upon startup.

Check health status:

curl http://localhost:8000/health

Expected response:

{"status":"ok","database":"ok"}

5. Run the Showcase Agent Application

In a separate terminal:

python examples/showcase_agent/main.py

Output:

🚀 Starting TRACEFORGE End-to-End Showcase Agent Application...
📌 [TRACE CREATED] Trace ID: a2923d86b435089276886de2a0b6e256
  🔍 [SPAN: retrieval] Executing vector database retrieval...
  🤖 [SPAN: llm] Calling LLM engine (claude-3-5-sonnet)...
  🗄️ [SPAN: database] Querying account database...
  🛠️ [SPAN: tool] Executing billing upgrade action...
✅ Showcase Agent execution finished!

✨ Evaluation Completed! Overall Status: PASS
   ✅ [latency_sla] Score: 1.0 | Status: PASS
   ✅ [token_budget] Score: 1.0 | Status: PASS
   ✅ [retrieval_relevancy] Score: 1.0 | Status: PASS

6. Interactive CLI Tool (traceforge-cli)

Use the built-in command-line tool to inspect traces, visualize span waterfalls, run behavioral evaluations, and view platform metrics:

# List recent recorded traces
python -m traceforge.cli list

# Inspect a trace with span waterfall rendering
python -m traceforge.cli get <TRACE_ID>

# Run automated behavioral evaluation suite
python -m traceforge.cli eval <TRACE_ID>

# View aggregate runtime analytics and SLA metrics
python -m traceforge.cli stats

7. REST API Endpoints

  • POST /api/v1/traces: Ingest telemetry payload safely and idempotently.
  • GET /api/v1/traces: List recorded traces with pagination (limit, offset).
  • GET /api/v1/traces/{trace_id}: Fetch complete trace hierarchy and span waterfall details.
  • POST /api/v1/evaluations/run/{trace_id}: Trigger automated behavioral evaluations (Latency SLA, Token Budget, Retrieval Relevancy).
  • GET /api/v1/traces/{trace_id}/evaluations: Retrieve evaluation report for a trace.
  • GET /api/v1/analytics/summary: Aggregate metrics (total traces, total tokens, total cost, pass rate, p50/p90/p99 duration).

Automated Test Suite

Execute the comprehensive pytest suite:

pytest -v

Tests cover:

  • SDK trace & span creation, timing, decorator ergonomics, context hierarchy, and attribute recording.
  • SDK exporter graceful failure handling on network errors.
  • REST API health check, ingestion, pagination, evaluation scoring, analytics, and 422/404 error handling.
  • Ingestion safe idempotence for duplicate submissions.
  • Behavioral evaluation rules (LatencyEvaluator, TokenBudgetEvaluator, RetrievalRelevancyEvaluator).
  • SQLAlchemy 2.0 trace, span, and evaluation model persistence.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traceforge_telemetry-0.1.0.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traceforge_telemetry-0.1.0-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file traceforge_telemetry-0.1.0.tar.gz.

File metadata

  • Download URL: traceforge_telemetry-0.1.0.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for traceforge_telemetry-0.1.0.tar.gz
Algorithm Hash digest
SHA256 3adacf647f4471cd6fbb6407f81ada7939f7eaabfef9aa578a20fb1b4502326b
MD5 02be236491bc160887f3e0c929cdb485
BLAKE2b-256 98c3ed362775b4f75f286f251086d944710918d6cf2d9654254924cb1ba59c21

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceforge_telemetry-0.1.0.tar.gz:

Publisher: publish-pypi.yml on pranavsaxena2405/traceforge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file traceforge_telemetry-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for traceforge_telemetry-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9673c2a55bae7e84fb7a2e6a99039a34be3f153e5c3d254836828a1071f67765
MD5 f59577f0f7f57a688e0aafb99e466891
BLAKE2b-256 571becd06a149ed0483904a28ccc9e2be6e353ed099dc903383a49f3f4a2100e

See more details on using hashes here.

Provenance

The following attestation bundles were made for traceforge_telemetry-0.1.0-py3-none-any.whl:

Publisher: publish-pypi.yml on pranavsaxena2405/traceforge

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page