LangGraph integration for KAgent with A2A server support
Project description
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:8080",
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kagent_langgraph-0.7.2.tar.gz.
File metadata
- Download URL: kagent_langgraph-0.7.2.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7b9a878c5ee92ed3c6d5bf4b7dfd3ced024ba2418c15cacc1f7d53c59ccfc96
|
|
| MD5 |
b172dc262f97e228e14e7facf4894378
|
|
| BLAKE2b-256 |
ff89d49ade05f089788a93000e2bc616462c0d71b5c66a5323e498261f308127
|
File details
Details for the file kagent_langgraph-0.7.2-py3-none-any.whl.
File metadata
- Download URL: kagent_langgraph-0.7.2-py3-none-any.whl
- Upload date:
- Size: 15.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a3118af0ed6b49bce4d172c63edb40bd05d49a12bd7321929550ddf1e94c10f
|
|
| MD5 |
0fb1e65044c12f5e98bc6f43a2fc8282
|
|
| BLAKE2b-256 |
87330587ff7718ef5777e0284cf943a7dd6b7769196851538de33cf881413a49
|