Skip to main content

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 sessions
  • GET /api/sessions/{id} - Retrieve session and events
  • POST /api/sessions/{id}/events - Append checkpoint events
  • POST /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

kagent_langgraph-0.9.0b7.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

kagent_langgraph-0.9.0b7-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file kagent_langgraph-0.9.0b7.tar.gz.

File metadata

  • Download URL: kagent_langgraph-0.9.0b7.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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}

File hashes

Hashes for kagent_langgraph-0.9.0b7.tar.gz
Algorithm Hash digest
SHA256 fb4c657a44a422652600c78dc392d22e29f3b11ce0c8fdf0bfa4ed9948e6fb61
MD5 9a4496488dfc2b58d089234bd0053ed6
BLAKE2b-256 f9d9d46c2b1ad933b82e6157171205bf7c61fe5f6f5518e5d721f39364b1d0ef

See more details on using hashes here.

File details

Details for the file kagent_langgraph-0.9.0b7-py3-none-any.whl.

File metadata

  • Download URL: kagent_langgraph-0.9.0b7-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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}

File hashes

Hashes for kagent_langgraph-0.9.0b7-py3-none-any.whl
Algorithm Hash digest
SHA256 fff2eefa0887a0a620729f1be3af81359253e0962ad48e0be2e1d63de10f5797
MD5 849cf04e214ef831479f4e4739521b13
BLAKE2b-256 6dcefb79f8d62300c26f878616ca13227a1e2395792bdb72b2c91f1df78cf6f3

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