Skip to main content

CopilotKit Intelligence LangGraph

create_skill_registry_middleware delivers one Learning container's published skills to native asynchronous agents built with langchain.agents.create_agent. It supports LangChain >=1.2.16,<2 and LangGraph >=1.1.10,<2. Arbitrary compiled StateGraph instances are outside this integration.

from copilotkit_intelligence import Intelligence
from copilotkit_intelligence_langgraph import create_skill_registry_middleware
from langchain.agents import create_agent

async with Intelligence(api_key="your-project-key") as intelligence:
    skills = create_skill_registry_middleware(
        client=intelligence,
        container_id="your-learning-container",
    )
    await skills.initialize()
    agent = create_agent(
        "your-provider:your-model",
        system_prompt="Your application instructions.",
        middleware=[skills],
    )
    try:
        result = await agent.ainvoke(
            {"messages": [{"role": "user", "content": "Help with a refund"}]}
        )
    finally:
        await skills.aclose()

Use ainvoke or astream. Synchronous invocation raises LearnedSkillsError with code INVALID_CONFIG and an exception note that directs callers to the async API. Initialization errors are catchable; later initialization can retry. status reports initialized, revision, mode, last_checked_at, stale, and last_error as an immutable value.

The factory accepts client, api_key, api_url, container_id, revision, freshness_window, request_timeout, and debug. Durations use seconds and default to five. Debug defaults to false. Explicit values override CPK_INTELLIGENCE_API_KEY, INTELLIGENCE_API_URL, CPK_INTELLIGENCE_LEARNING_CONTAINER_ID, and CPK_INTELLIGENCE_SKILLS_REVISION. An injected client supplies all connection configuration and stays application-owned. Without one, the middleware creates the canonical client and closes it through aclose().

Each invocation receives an alphabetical catalog and two stable tools: copilotkit_load_skill and copilotkit_read_skill_file. Developer instructions outrank learned skills. The model chooses which skills to use. Tool reads support verified UTF-8 text only; unknown skills, unlisted paths, binary content, and attempts to read outside the snapshot produce native tool errors. The adapter never executes scripts or writes skills to disk.

A private UntrackedValue channel stores an opaque invocation ID. The channel owns the in-memory snapshot holder; parallel tools resolve the same pin through a weak lookup. Checkpoints and final invocation output omit the channel. Values streams may include the serializable ID, but never the holder, snapshot metadata, or lock. Channel cleanup releases the holder. A resumed invocation captures a fresh authorized snapshot, including when it starts at a tool node. Completed tool output remains ordinary message history and can be checkpointed by the host framework; the adapter does not remove that history. Attach middleware explicitly to each agent that needs skills. Subagents follow their framework's propagation behavior and are not discovered or modified automatically.

Latest mode refreshes before an invocation after the freshness window. An explicit revision pins the complete skill set. Warm transient failures retain the previous snapshot indefinitely and mark status stale. Confirmed denial blocks new invocations; existing invocation pins remain unchanged.

The build vendors shared private source into copilotkit_intelligence_langgraph._delivery. There is no separate public core package or shared top-level _delivery namespace. The canonical runtime client dependency must be published with the learned-snapshot operation and per-request deadline support before release. Its existing Runtime dependencies remain part of the installation.

Repository checks run through Nx: intelligence-langgraph-python:test, :test-minimum, :lint, :typecheck, :build, and :verify-distribution. The distribution check rebuilds the sdist outside the checkout and imports its wheel in isolation from editable adapter source. Real delivery API acceptance tests remain a separate release gate.

Metadata

Release files for copilotkit-intelligence-langgraph 0.1.0

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

Source distribution (sdist)

Source distribution for copilotkit-intelligence-langgraph 0.1.0
File Size Uploaded
copilotkit_intelligence_langgraph-0.1.0.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for copilotkit-intelligence-langgraph 0.1.0
File Interpreter ABI Platform
copilotkit_intelligence_langgraph-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 25.1 kB

Release files / copilotkit_intelligence_langgraph-0.1.0.tar.gz

Download URL copilotkit_intelligence_langgraph-0.1.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
48159e2e060f4994abce6b8c4faea7d6fe859804f4a908e28950fc8629bc4ae4
BLAKE2b-256 checksum
How to use checksums
d562e946fc462f19dae5aadb209f694165e80dc49d37818c2b87d05eca10ca78
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.7

Release files / copilotkit_intelligence_langgraph-0.1.0-py3-none-any.whl

Download URL copilotkit_intelligence_langgraph-0.1.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6dc040c54bd3d038fc5872c86ce2afcbf7e3629032ead2bc3ee8868b612921cf
BLAKE2b-256 checksum
How to use checksums
cf29948f187d1656453ad4abffa4f25575b06e2366626ac10b96669523b0e0a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.9.7

Release history Release notifications | RSS feed

This release

0.1.0 This release

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