Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

KAgent LangGraph Integration

This package provides LangGraph integration for KAgent with A2A (Agent-to-Agent) server support.

Features

  • A2A Server Integration: Compatible with KAgent's Agent-to-Agent protocol
  • Event Streaming: Real-time streaming of graph execution events
  • FastAPI Integration: Ready-to-deploy web server for agent execution

Quick Start

from kagent.core import AsyncControllerClient, AsyncFileTokenProvider, KAgentConfig
from kagent.langgraph import KAgentApp
import os
import sqlite3
from langgraph.checkpoint.sqlite import SqliteSaver
from langgraph.graph import StateGraph
from langchain_core.messages import BaseMessage
from typing import TypedDict, Annotated, Sequence

class State(TypedDict):
    messages: Annotated[Sequence[BaseMessage], "The conversation history"]

config = KAgentConfig()
controller_client = AsyncControllerClient(
    config.grpc_url,
    agent_name=config.app_name,
    token_provider=AsyncFileTokenProvider(),
)

# Define and compile your graph
builder = StateGraph(State)
# Add nodes and edges...
checkpointer = SqliteSaver(sqlite3.connect(
    os.getenv("KAGENT_CHECKPOINT_DB", "/tmp/langgraph-checkpoints.sqlite"),
    check_same_thread=False,
))
graph = builder.compile(checkpointer=checkpointer)

# Create KAgent app
app = KAgentApp(
    graph=graph,
    agent_card={
        "name": "my-langgraph-agent",
        "description": "A LangGraph agent with KAgent integration",
        "version": "0.1.0",
        "capabilities": {"streaming": True},
        "defaultInputModes": ["text"],
        "defaultOutputModes": ["text"]
    },
    config=config,
    controller_client=controller_client,
)

# Build FastAPI application
fastapi_app = app.build()

Architecture

The package mirrors the structure of kagent-adk but uses LangGraph instead of Google's ADK:

  • LangGraphAgentExecutor: Executes LangGraph workflows within A2A protocol
  • KAgentApp: FastAPI application builder with A2A integration
  • Task Management: Automatic A2A task persistence through one shared authenticated gRPC channel

Configuration

Set both endpoints when running locally. A2A and MCP use KAGENT_GATEWAY_URL, while control-plane calls use KAGENT_API_URL.

export KAGENT_API_URL=http://localhost:8083
export KAGENT_GATEWAY_URL=http://localhost:8083
export KAGENT_NAME=my-agent
export KAGENT_NAMESPACE=default

Deployment

Use the same deployment pattern as kagent-adk samples with Docker and Kubernetes.

Release files for kagent-langgraph 1.0.0a3

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

Source distribution (sdist)

Source distribution for kagent-langgraph 1.0.0a3
File Size Uploaded
kagent_langgraph-1.0.0a3.tar.gz 11.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kagent-langgraph 1.0.0a3
File Interpreter ABI Platform
kagent_langgraph-1.0.0a3-py3-none-any.whl Python 3 none any Details

Total release size: 22.8 kB

Release files / kagent_langgraph-1.0.0a3.tar.gz

Download URL kagent_langgraph-1.0.0a3.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d67576bba78c75b7cd4c8d108e67177f22eea1ae24b0efd0fb828102acbd1c24
BLAKE2b-256 checksum
How to use checksums
80fc48b4a48a32a45ea0c8550033de8d1dfc0c4279253d8dc2825c9182829110
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / kagent_langgraph-1.0.0a3-py3-none-any.whl

Download URL kagent_langgraph-1.0.0a3-py3-none-any.whl
Size 11.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0beff257da21b023f6ac4d6805e0c540e2f31420ec718686e8819cbb8dc605a9
BLAKE2b-256 checksum
How to use checksums
494b962945a7f8bce49c7db1d8c87698b86b8ab79a4eb7bd0169cf819311809c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

1.0.0a3 This release

2 release files

0.10.2

2 release files

0.9.12

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.3

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.6

2 release files

0.8.5

2 release files

0.8.4

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.19

2 release files

0.7.18

2 release files

0.7.17

2 release files

0.7.16

2 release files

0.7.15

2 release files

0.7.14

2 release files

0.7.12

2 release files

0.7.11

2 release files

0.7.10

2 release files

0.7.9

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.21

2 release files

0.6.20

2 release files

0.6.17

2 release files

0.6.16

2 release files

0.6.15

2 release files

0.6.14

2 release files

0.6.12

2 release files

0.6.11

2 release files

0.6.9

2 release files

0.6.8

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