The 315-case language-neutral corpus was only ever *validated* in TypeScript. `sdk-python/tests/test_intelligence.py` and `IntelligenceClientTests.cs` read it solely to extract the canonical error-code enums, so every declarative assertion was unenforced outside TypeScript. Measured: 112 of the corpus's negative cases are accepted by a vanilla Draft 2020-12 validator and are enforceable only through `x-copilotkit-equal-properties` and `x-copilotkit-assertions`, which existed in TypeScript alone. Adds portable validators to both SDKs, peers of `packages/intelligence/src/portable-validator.ts`, covering the Draft 2020-12 subset the corpus uses plus both custom keywords and all fifteen assertion operations (compare, compare-values, unique, all-equal, strictly-increasing, contiguous, values-in-range, references, disjoint, ordered-ranges, lookup-equal, lookup-references, count, utf8-byte-length, bounded-json) with their `caseFold`/`unicode` normalization, `where` predicates, and bounds. Both consume the same corpus JSON with no per-language restatement of any rule, and both reuse their language's single case-folding definition site. Two properties keep the three implementations honest: - Unknown schema keywords and unknown assertion operations are hard errors, not ignored annotations, so a future corpus keyword fails loudly instead of silently under-enforcing. - ECMAScript `pattern` values are translated into each host dialect explicitly. Untranslated, `$` would also match before a trailing newline and `\d` would match non-ASCII digits in both Python and .NET, accepting strings the TypeScript reference validator rejects. All 315 cases now pass in all three languages, each suite independently re-measures the 112 figure as a regression guard, and the Python suite asserts that every corpus assertion operation decides at least one case.
CopilotKit Python SDK
The official Python SDK for CopilotKit - build AI copilots and agents into your applications.
Features
- 🚀 Easy integration with LangGraph and LangChain
- 🔄 Built-in support for stateful conversations
- 🛠 Extensible agent framework
- 🔌 FastAPI-ready endpoints
- 🤝 Optional CrewAI integration
- 🧠 Verified sync and async Intelligence skill registry clients
Installation
pip install copilotkit
With CrewAI support:
pip install "copilotkit[crewai]"
Quick Start
from copilotkit import Copilot
# Initialize a copilot
copilot = Copilot()
# Add your tools and configure the copilot
copilot.add_tool(my_custom_tool)
# Run the copilot
response = copilot.run("Your task description here")
Intelligence skill registry
Fetch and atomically cache the current verified skill set for a learning container:
from copilotkit import CopilotKitIntelligence
intelligence = CopilotKitIntelligence(
api_key="...",
project_namespace="my-project",
)
skill_set = intelligence.skills.get("55555555-5555-4555-8555-555555555555")
for skill in skill_set.skills:
print(skill.skill_id, skill.path)
For framework integrations, skill_set.skill_descriptors provides an ordered,
immutable projection of each installed skill's identity, display metadata,
verified directory, and artifact manifest. Its frozen descriptor records include
the manifest SHA-256 plus every file's path, role, media type, byte length, and
raw SHA-256. The client exposes these descriptors only after projection identity,
manifest, bundle, per-file digest and size, and atomic install verification all
succeed.
Use AsyncCopilotKitIntelligence and await intelligence.skills.get(...) in an
async application. get() always contacts the registry and never silently falls
back after an outage. To explicitly use a fully verified local copy, call
get_cached() (or await it on the async client); its result has
freshness == "cached". Learning container IDs must be canonical UUIDs. Registry
requests use the canonical /v1/learning-containers/{id}/skills endpoint.
Documentation
For detailed documentation and examples, visit copilotkit.ai
Contributing
We welcome contributions! Please see our Contributing Guidelines for details.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
Built with ❤️ by the CopilotKit team