Skip to main content

fractal-graph-react-agent

ReAct agent with MCP tools — part of the fractal-agents-runtime graph catalog.

Overview

This package provides a portable, self-contained ReAct agent graph built on LangGraph with:

  • MCP tool integration — connects to Model Context Protocol servers for extensible tool use
  • RAG tool factory — creates retrieval-augmented generation tools from document collections
  • OAuth token exchange — handles MCP server authentication with token caching
  • Multi-provider LLM support — OpenAI, Anthropic, Google, and custom OpenAI-compatible endpoints

Installation

uv add fractal-graph-react-agent

Usage

The graph is a portable factory function that accepts a RunnableConfig and optional persistence components via dependency injection:

from react_agent import graph
from langchain_core.runnables import RunnableConfig

# Build the agent graph — runtime injects persistence
config = RunnableConfig(configurable={"model_name": "openai:gpt-4o"})
agent = await graph(config, checkpointer=my_checkpointer, store=my_store)

# Invoke
result = await agent.ainvoke({"messages": [{"role": "user", "content": "Hello!"}]})

Dependency Injection

The graph() factory uses dependency injection for persistence — it never imports from any specific runtime:

# The runtime (e.g., Robyn server) creates and injects these:
from my_runtime.database import get_checkpointer, get_store

agent = await graph(
    config,
    checkpointer=get_checkpointer(),  # Thread-level conversation memory
    store=get_store(),                  # Cross-thread long-term memory
)

When checkpointer and store are None (the default), the agent runs without persistence — useful for testing or stateless invocations.

Configuration

The graph is configured via RunnableConfig.configurable:

Key Type Default Description
model_name str "openai:gpt-4o" LLM provider and model
temperature float 0.7 Sampling temperature
max_tokens int 4000 Maximum generation tokens
system_prompt str Generic helpful assistant System prompt
mcp_config dict None MCP server configuration
rag dict None RAG collection configuration
base_url str None Custom OpenAI-compatible endpoint

Architecture

This package is part of the 3-layer architecture:

apps/          → Thin HTTP wrappers (Robyn, FastAPI, etc.)
  ↓ depends on
graphs/        → Portable agent architectures (this package)
  ↓ depends on
infra/         → Shared runtime infrastructure (tracing, auth, store namespace)

Graphs have zero coupling to any runtime — they can be deployed to LangGraph Platform, embedded in any server framework, or run standalone.

License

MIT

Metadata

Release files for fractal-graph-react-agent 0.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fractal-graph-react-agent 0.0.0
File Size Uploaded
fractal_graph_react_agent-0.0.0.tar.gz 13.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fractal-graph-react-agent 0.0.0
File Interpreter ABI Platform
fractal_graph_react_agent-0.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 27.7 kB

Release files / fractal_graph_react_agent-0.0.0.tar.gz

Download URL fractal_graph_react_agent-0.0.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
cda8a8b42d09f23226fdaeba507e0927d86a6f5e3ac988a4ea0d1792ae969a16
BLAKE2b-256 checksum
How to use checksums
c50c45d1ad9d4e49fa75c78d21ac0b7e4ee65bf7a0c749d195aaf1c1d6093be7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.

Transparency log

Release files / fractal_graph_react_agent-0.0.0-py3-none-any.whl

Download URL fractal_graph_react_agent-0.0.0-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4621b2b0878a160fe32320e764011e2d2a74e8e9b1c43895e09169c6d1938744
BLAKE2b-256 checksum
How to use checksums
f60b3df70a18d020af0ca432ad710f5a8cb5d677844b61f4cbf73ab40b794151
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.0 This release

2 release 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