This directory contains standardized dependency templates and utilities for all CopilotKit Python agent examples.
Primary Package Manager: Poetry
Pip Compatibility: Full support via requirements.txt
Version Strategy: Exact pinning for reproducible builds
All examples use these exact versions, synchronized with the main SDK:
| Package | Version | Source |
|---|---|---|
copilotkit |
0.1.49 |
Latest stable |
langchain |
0.3.21 |
Main SDK lock |
langgraph |
0.4.8 |
Exact pin - working version |
langsmith |
0.3.18 |
Main SDK lock |
openai |
^1.68.2 |
Main SDK compatible |
fastapi |
^0.115.5 |
Standard framework |
uvicorn |
^0.29.0 |
ASGI server |
python-dotenv |
^1.0.0 |
Environment management |
crewai=0.118.0(for CrewAI examples)tavily-python=^0.5.1(for research examples)
-
Copy
pyproject-template.tomlto your example directory:cp examples/shared/pyproject-template.toml examples/your-example/agent/pyproject.toml
-
Important: Add packages configuration for your project structure:
[tool.poetry] name = "agent" version = "0.1.0" description = "" authors = ["CopilotKit"] readme = "README.md" packages = [{include = "your_package_name"}] # Add this line
-
Create a basic README.md file:
echo "# Your Agent Name" > README.md
-
Modify for project-specific dependencies:
# Add project-specific deps after the standard ones crewai = "0.118.0" # For CrewAI examples
-
Install dependencies:
cd examples/your-example/agent poetry install
-
Copy
requirements-template.txt:cp examples/shared/requirements-template.txt examples/your-example/agent/requirements.txt
-
Install dependencies:
cd examples/your-example/agent pip install -r requirements.txt
Use the sync script to bulk update all examples:
cd examples/shared/utils
python sync-deps.py --all # Update all examples
python sync-deps.py ../my-agent # Update specific example- ✅ Updates
pyproject.tomlwith canonical versions - ✅ Generates
requirements.txtfor pip compatibility - ✅ Preserves project-specific dependencies
- ✅ Ensures version consistency across all examples
copilotkit,langchain,langgraph,langsmith- Ensures reproducible builds
- Eliminates version drift
openai,fastapi,uvicorn,python-dotenv- Allows bug fixes and compatible updates
- Maintains backward compatibility
- Reproducible Builds - Exact versions for core dependencies
- Pip Compatibility - Works with both Poetry and pip
- Easy Maintenance - Automated sync across all examples
- Version Consistency - No more version conflicts between examples
- Developer Experience - Simple copy-paste setup
To verify your example follows the standard:
# Check Poetry setup
poetry check
poetry show copilotkit langchain langgraph
# Check pip compatibility
pip install -r requirements.txt --dry-run- Never change core dependency versions manually
- Always use the sync script for updates
- Keep
pyproject.tomlandrequirements.txtin sync - Update both files when adding project-specific dependencies
# Reset to canonical versions
cd examples/shared/utils
python sync-deps.py ../your-example/agentrm poetry.lock
poetry install# Regenerate requirements.txt
cd examples/shared/utils
python sync-deps.py ../your-example/agentexamples/shared/
├── README.md # This documentation
├── pyproject-template.toml # Poetry template
├── requirements-template.txt # pip template
└── utils/
└── sync-deps.py # Synchronization script
This standardization ensures all CopilotKit examples work reliably for both Poetry and pip users while maintaining version consistency across the entire project.