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.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| kagent_langgraph-1.0.0a1.tar.gz | 12.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kagent_langgraph-1.0.0a1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.0 kB
Release files / kagent_langgraph-1.0.0a1.tar.gz
| Download URL | kagent_langgraph-1.0.0a1.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cc6edebd9c2de0bdda4a8ab87be747e33b975f512c1eeefa208d280afcdebcde
|
|
BLAKE2b-256 checksum How to use checksums |
a8db7bcea5ce583807387a8adedb2b9ade27f8a8c8c90c3619f644edc1068e6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","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.0a1-py3-none-any.whl
| Download URL | kagent_langgraph-1.0.0a1-py3-none-any.whl |
|---|---|
| Size | 12.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4c528e39133891db4aad85acf9b5dc5a42d4ca69c6fa6b1e65eebff409db08c0
|
|
BLAKE2b-256 checksum How to use checksums |
14363db2c1c2e30fbcf20d28474523d03c0cd97b4977187b5ab2ca0dc9993d2c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.16 {"installer":{"name":"uv","version":"0.12.16","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}
|