Skip to main content

LangGraph-compatible agent orchestration with message-native state, checkpointing, and KaTrace Studio.

Project description

KaGraph

KaGraph is a LangGraph-compatible agent orchestration framework built on top of kaggle_benchmarks conversation primitives. It helps you build stateful, multi-node agent workflows with traceable execution, message-aware state updates, checkpointing, and a built-in web studio for inspecting graph behavior.

If you find this project helpful and would like to support its development, consider buying me a coffee!

Buy Me A Coffee

Features

  • Native kaggle_benchmarks Integration: Preserves message roles and objects directly without flattening context.
  • Stateful Workflows: Define your state schema and update it incrementally through independent graph nodes.
  • Advanced Control Flow: Supports conditional routing, fan-out/fan-in, timeouts, and retry policies.
  • Built-in Checkpointing: Pause, inspect, and resume graph execution for human-in-the-loop workflows.
  • KaTrace Studio: Visualize graph paths, inspect trace events, review LLM calls, compare messages, and replay past runs.

Prerequisites

KaGraph relies on the kaggle_benchmarks library. In Kaggle notebooks, it is already available. In a local environment, install and configure it before running KaGraph.

For local development, configure your model proxy credentials:

cp .env.example .env

Then fill in MODEL_PROXY_API_KEY and MODEL_PROXY_URL.

Installation

pip install kagraphx

For local development from source:

git clone https://github.com/anpc849/ka-graph.git
cd ka-graph
pip install -e ".[dev]"

Quick Start

Start KaTrace Studio first so traces from your graph run are captured and visible:

# Local machine
kagraph-studio --mode local

# Kaggle notebook or remote environment
!kagraph-studio --mode localtunnel

Open http://127.0.0.1:3000 in local mode, or use the printed LocalTunnel URL in tunnel mode.

Once Studio is running, execute a traced graph:

from kagraph import START, END, StateGraph, MessagesState
from kagraph.llms import load_llm
from kagraph.prompts import invoke_llm
from kagraph.messages import HumanMessage
from kagraph.tracing import trace

llm = load_llm("qwen/qwen3-235b-a22b-instruct-2507")

def agent(state: MessagesState):
    response = invoke_llm(llm, messages=state["messages"], prompt="Answer the user.")
    return {"messages": [response]}

graph = StateGraph(MessagesState)
graph.add_node("agent", agent)
graph.add_edge(START, "agent")
graph.add_edge("agent", END)
app = graph.compile()

with trace("MyFirstAgent"):
    result = app.invoke({"messages": [HumanMessage("Hello!")]})

print(result["messages"][-1].content)

Learn More

Use the docs for API details and the tutorial notebooks for runnable workflows:

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

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

Source Distribution

kagraphx-0.1.1.tar.gz (193.3 kB view details)

Uploaded Source

Built Distribution

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

kagraphx-0.1.1-py3-none-any.whl (189.1 kB view details)

Uploaded Python 3

File details

Details for the file kagraphx-0.1.1.tar.gz.

File metadata

  • Download URL: kagraphx-0.1.1.tar.gz
  • Upload date:
  • Size: 193.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kagraphx-0.1.1.tar.gz
Algorithm Hash digest
SHA256 8a2501b7dafb0e911db5f69ce4ea342799d46ce117da02dde60a04825b1fc5e6
MD5 4af1f1222ae52bede4b3a2b13a8f9cf3
BLAKE2b-256 871fee35754418ad7aab53fb76a3a74fcf2ae5e4c0dfe61436db7057634ad43b

See more details on using hashes here.

File details

Details for the file kagraphx-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: kagraphx-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 189.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for kagraphx-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fc1f4b9170333527e9fd68d7a6e9ee8f80009d79d0695f1c0fffe0b86bdfe473
MD5 630b7a27e1be5a9dcce4ddf59623481f
BLAKE2b-256 28f54244971009c112aa9fcd1ed02dcd47de3610f78e5424f6a74f53ed78c7a8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page