Graph-based agent framework powered by oauth-codex
Project description
Fabrix
Language: English | 한국어
API Guides: English | 한국어
Overview
Fabrix is a graph-based agent framework built on top of oauth-codex>=2.2.0.
It provides a structured execution graph with streaming events for tool-driven workflows.
Key Features
- Graph-based 4-state execution:
reasoning,tool_call,response,finish - Structured state outputs powered by Pydantic models
- Sequential tool execution with strict payload validation
- Async streaming event API for step-by-step observability
Installation
pip install fabrix-ai
Quickstart
import asyncio
from pydantic import BaseModel
from fabrix import Agent
from fabrix.events import (
ReasoningEvent,
ResponseEvent,
TaskFailedEvent,
TaskFinishedEvent,
ToolEvent,
)
class AddInput(BaseModel):
a: int
b: int
def add_numbers(payload: AddInput) -> int:
return payload.a + payload.b
async def main() -> None:
agent = Agent(
instructions="You are a precise assistant.",
model="gpt-5.3-codex",
tools=[add_numbers],
)
async for event in agent.run_task_stream("Use add_numbers to compute 3 + 9"):
print(f"[step={event.step}] {event.event_type}")
if isinstance(event, ReasoningEvent):
print("reasoning:", event.reasoning)
print("focus:", event.focus)
elif isinstance(event, ToolEvent):
if event.phase == "start":
print("tool call:", event.tool_name, event.arguments)
elif event.result is not None:
print("tool result:", event.result.model_dump())
elif isinstance(event, ResponseEvent):
print("response:", event.response)
elif isinstance(event, TaskFinishedEvent):
print("completion reason:", event.completion_reason)
print("final:", event.final_output)
elif isinstance(event, TaskFailedEvent):
print("failed:", event.error_code, event.message)
asyncio.run(main())
Tool Contract
Fabrix accepts tools in this shape:
def tool(payload: BaseModel) -> Any: ...
- The tool must accept exactly one parameter.
- The parameter type must be a Pydantic
BaseModel. - Runtime arguments must be a JSON object matching payload fields.
- Extra argument keys are rejected.
- Both sync and async tools are supported.
Event Stream
run_task_stream(...) yields these event types:
reasoningtool(phase="start"/phase="finish")responsetask_finishedtask_failed
reasoning is a step-level decision trace / plan summary, not raw internal chain-of-thought.
Typical flow:
reasoning- zero or more
toolstart/finish pairs - optional
response task_finishedortask_failed
Documentation
- API usage guide (English):
docs/api.md - API 사용 가이드 (한국어):
docs/api.ko.md - Korean README:
README.ko.md
Examples
- Minimal quickstart:
examples/minimal/quickstart.py - Data workflow:
examples/advanced/data_workflow.py - Incident response workflow:
examples/advanced/incident_response.py
Notes
- Public runtime entry point is
fabrix.Agent. - Execution defaults are fixed internally:
max_steps=128and no public per-tool timeout option. - If
max_stepsis reached and at least oneresponsewas emitted, the stream ends withtask_finished(completion_reason="max_steps_reached") using the last response. - If
max_stepsis reached before any response/final output, the stream ends withtask_failed(error_code="max_steps_reached").
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fabrix_ai-1.0.0.tar.gz.
File metadata
- Download URL: fabrix_ai-1.0.0.tar.gz
- Upload date:
- Size: 25.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
35d9ccf2e0d085094ce7506aecb3412af12019ec510f87a3bc1811015897dd4a
|
|
| MD5 |
795952805ce6590ea0b9915c254ab8db
|
|
| BLAKE2b-256 |
b78d9ca006044404551627c4b25d3f44ee775d84330e2689fd8a9600826a3ae9
|
Provenance
The following attestation bundles were made for fabrix_ai-1.0.0.tar.gz:
Publisher:
publish-pypi.yml on smturtle2/fabrix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fabrix_ai-1.0.0.tar.gz -
Subject digest:
35d9ccf2e0d085094ce7506aecb3412af12019ec510f87a3bc1811015897dd4a - Sigstore transparency entry: 954393879
- Sigstore integration time:
-
Permalink:
smturtle2/fabrix@27c88bf9e5b3d4c6b3fd72455fbb214c2098339b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/smturtle2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@27c88bf9e5b3d4c6b3fd72455fbb214c2098339b -
Trigger Event:
push
-
Statement type:
File details
Details for the file fabrix_ai-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fabrix_ai-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95899933c650d4a10d6827c316525b1e99fd798127071f836a96cf258a6875cd
|
|
| MD5 |
2846206d50529355bdfdc7f6e6247b82
|
|
| BLAKE2b-256 |
23ac8302550114ba653539af418ff03eb91d4295728d91c784ed08336f64540e
|
Provenance
The following attestation bundles were made for fabrix_ai-1.0.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on smturtle2/fabrix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fabrix_ai-1.0.0-py3-none-any.whl -
Subject digest:
95899933c650d4a10d6827c316525b1e99fd798127071f836a96cf258a6875cd - Sigstore transparency entry: 954393880
- Sigstore integration time:
-
Permalink:
smturtle2/fabrix@27c88bf9e5b3d4c6b3fd72455fbb214c2098339b -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/smturtle2
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@27c88bf9e5b3d4c6b3fd72455fbb214c2098339b -
Trigger Event:
push
-
Statement type: