KAgent LangGraph Integration
This package provides LangGraph integration for KAgent with A2A (Agent-to-Agent) server support. It implements a custom checkpointer that persists LangGraph state to the KAgent REST API, enabling distributed agent execution with session persistence.
Features
- Custom Checkpointer: Persists LangGraph checkpoints to KAgent via REST API
- A2A Server Integration: Compatible with KAgent's Agent-to-Agent protocol
- Session Management: Automatic session creation and state persistence
- Event Streaming: Real-time streaming of graph execution events
- FastAPI Integration: Ready-to-deploy web server for agent execution
Quick Start
from kagent.langgraph import KAgentApp
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"]
# Define your graph
builder = StateGraph(State)
# Add nodes and edges...
# Create KAgent app
app = KAgentApp(
graph_builder=builder,
agent_card={
"name": "my-langgraph-agent",
"description": "A LangGraph agent with KAgent integration",
"version": "0.1.0",
"capabilities": {"streaming": True},
"defaultInputModes": ["text"],
"defaultOutputModes": ["text"]
},
kagent_url="http://localhost:8083",
app_name="my-agent"
)
# Build FastAPI application
fastapi_app = app.build()
Architecture
The package mirrors the structure of kagent-adk but uses LangGraph instead of Google's ADK:
- KAgentCheckpointer: Custom checkpointer that stores graph state in KAgent sessions
- LangGraphAgentExecutor: Executes LangGraph workflows within A2A protocol
- KAgentApp: FastAPI application builder with A2A integration
- Session Management: Automatic session lifecycle management via KAgent REST API
Configuration
The system uses the same REST API endpoints as the ADK integration:
POST /api/sessions- Create new sessionsGET /api/sessions/{id}- Retrieve session and eventsPOST /api/sessions/{id}/events- Append checkpoint eventsPOST /api/tasks- Task management
Deployment
Use the same deployment pattern as kagent-adk samples with Docker and Kubernetes.
Release files for kagent-langgraph 0.10.2
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-0.10.2.tar.gz | 16.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| kagent_langgraph-0.10.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 33.4 kB
Release files / kagent_langgraph-0.10.2.tar.gz
| Download URL | kagent_langgraph-0.10.2.tar.gz |
|---|---|
| Size | 16.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
335d2fa13feb77cc33279619d0ccecce3139d5b5e98d027a4d52c30cc24690d4
|
|
BLAKE2b-256 checksum How to use checksums |
bde2fa285e9588fb3373223e385c7cf8d32987799aef5e20eccf3bae23c0b691
|
| 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-0.10.2-py3-none-any.whl
| Download URL | kagent_langgraph-0.10.2-py3-none-any.whl |
|---|---|
| Size | 16.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
41a294fba6d2a4004cc53846ab1557d373268bd075b7aa1104307aec7ed67d47
|
|
BLAKE2b-256 checksum How to use checksums |
d523d4b7af551be2d64a81aa664ab4e95345c77821c880056bbc7e11b7eb7847
|
| 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}
|