Skip to content

justindobbs/tracecore-openai

TraceCore OpenAI

License: MIT Python 3.12+ TraceCore Project

tracecore-openai is a Python-first examples repository for building OpenAI Agents SDK applications with the same local FastAPI + uvicorn workflow already used in TraceCore.

What this repo includes

  • A shared OpenAI Agents runtime adapter
  • A FastAPI app exposing example agent-powered routes
  • Two initial examples:
    • chat_assistant
    • support_triage
  • A deterministic local verification flow for app behavior

Start here if you are evaluating the repo

Read docs/repo_scope.md for a short explanation of what this repository demonstrates, what it does not demonstrate, and how it fits TraceCore's core mission as an agent evaluation tool.

Why no Docker

Docker is optional. These examples call OpenAI-hosted models over HTTPS, so a normal Python process is enough for local development and verification.

Quickstart

Everything needed to run this example is declared in pyproject.toml, so once you clone the repo you can install it with a single command.

git clone https://github.com/justindobbs/tracecore-openai.git
cd tracecore-openai
python -m venv .venv
.venv\Scripts\activate
pip install -e .[dev]
copy .env.example .env

Set OPENAI_API_KEY in your environment or .env loader of choice.

If you installed tracecore in a different environment, make sure the tracecore command is available in your shell before running bundle commands from this repo.

Run the app

uvicorn tracecore_openai.main:app --reload

Open http://127.0.0.1:8000.

Deterministic verification

The verification harness runs the app in a fake deterministic mode so you can validate behavior without spending API credits while staying inside the native TraceCore workflow.

set TRACECORE_OPENAI_FAKE_RUNNER=1
tracecore run --agent agents/chat_assistant_agent.py --task chat_assistant_example@1 --seed 0
tracecore verify --latest

Use the rest of the CLI to inspect and compare agent behavior as you iterate:

tracecore inspect --run <run_id>
tracecore diff <run_a> <run_b>
tracecore baseline --agent <agent> --task <task> --compare <run_a> <run_b>
tracecore runs list --limit 5
tracecore runs summary --limit 5

Real OpenAI Agents mode

By default, the app uses the OpenAI Agents SDK. For deterministic tests, set:

set TRACECORE_OPENAI_FAKE_RUNNER=1

API routes

  • GET /
  • POST /api/chat-assistant
  • POST /api/support-triage
  • GET /healthz

Suggested workflow

uvicorn tracecore_openai.main:app --reload

tracecore run --agent agents/chat_assistant_agent.py --task chat_assistant_example@1 --seed 0
tracecore verify --latest
tracecore inspect --run <run_id>
tracecore diff <run_a> <run_b>
tracecore baseline --agent agents/chat_assistant_agent.py --task chat_assistant_example@1 --compare <run_a> <run_b>
tracecore runs list --limit 5
tracecore runs summary --limit 5
tracecore bundle seal --latest

pytest
ruff check .

About

End-to-end TraceCore example that runs OpenAI Agents surfaces, exercises deterministic verification, and shows how to carry the evidence into bundle workflows

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors