Executable contracts for multi-agent systems - deterministic coordination across frameworks and languages
Project description
AssertLang
Executable contracts for multi-agent systems. Define agent behavior once in AL, agents from different frameworks (CrewAI, LangGraph, AutoGen) execute identical logic. Deterministic coordination guaranteed.
Website • Quick Start • Why I Built This • Examples • Contribute
👋 Hey there!
I'm David, and I built AssertLang. Full disclosure: I'm not a "real" software engineer. I'm a broadcast tech from Hamilton who saw a problem and decided to try building a solution.
The honest truth: I couldn't have built this alone. Claude Code helped massively. But that's kind of the point—if someone like me can build something that actually works, maybe we're onto something useful here.
What I'm hoping for: Genuine feedback. Does this solve a real problem for you? Is it useful? What's broken? What should I add? I'm not trying to build a unicorn startup—I'm trying to see if this idea is actually helpful to developers building multi-agent systems.
Current status: v0.0.3 - Core transpiler works (5 languages!), 134/134 stdlib tests passing, CLI functional. Some integration tests still need work. It's early, but it's real.
⭐ If you find this interesting, please star the repo! It helps me know I'm building something people actually want.
The Problem
Multi-agent AI systems are growing fast ($5.25B → $52.62B by 2030), but agents can't reliably coordinate:
What happens today:
# Agent A (Python/CrewAI) interprets "create user"
def create_user(name, email):
if not name: # Agent A's validation
raise ValueError("Missing name")
# ... creates user
// Agent B (JavaScript/LangGraph) interprets same task differently
function createUser(name, email) {
if (name === "") // Agent B's validation (different!)
throw new Error("Name is required");
// ... creates user (differently)
}
Result: ❌ Different validation, different errors, inconsistent behavior
Existing solutions:
- MCP, A2A, ACP - Handle messaging, NOT semantic contracts
- JSON Schema - Types only, no business logic
- Natural language - Ambiguous, unreliable
- LLM interpretation - Non-deterministic
The Solution: AssertLang Contracts
Define behavior once, execute everywhere:
// user_service.al - Contract defines EXACT behavior
function createUser(name: string, email: string) -> User {
// Deterministic validation (not just types!)
if (str.length(name) < 1) {
return ValidationError("name", "Name cannot be empty");
}
if (!str.contains(email, "@")) {
return ValidationError("email", "Invalid email format");
}
// Deterministic ID generation
let id = str.length(name) + str.length(email);
return User(id, name, email, timestamp());
}
Transpile to Agent A (Python/CrewAI):
asl build user_service.al --lang python -o agent_a.py
Transpile to Agent B (JavaScript/LangGraph):
asl build user_service.al --lang javascript -o agent_b.js
Result: ✅ Both agents execute IDENTICAL logic
Proof: 100% Identical Behavior
Test Case: createUser("Alice Smith", "alice@example.com")
Agent A (Python) Output:
✓ Success: User #28: Alice Smith <alice@example.com>
Agent B (JavaScript) Output:
✓ Success: User #28: Alice Smith <alice@example.com>
Same ID, same format, same validation. See proof
🚀 Quick Start (2 Minutes)
1. Install
pip install assertlang
2. Write a contract
cat > hello_contract.al << 'EOF'
function greet(name: string) -> string {
if (str.length(name) < 1) {
return "Hello, Guest!";
}
return "Hello, " + name + "!";
}
EOF
3. Generate for your framework
# For CrewAI (Python)
asl build hello_contract.al --lang python -o crewai_agent.py
# For LangGraph (JavaScript)
asl build hello_contract.al --lang javascript -o langgraph_agent.js
# For custom agents (Go, Rust, C#)
asl build hello_contract.al --lang go -o agent.go
4. Use in your agent framework
CrewAI example:
from crewai import Agent
from crewai_agent import greet # Uses AL contract
agent = Agent(
role='Greeter',
goal='Greet users consistently',
backstory='I implement the AL greeting contract'
)
# Guaranteed to match other agents implementing same contract
result = greet("Alice") # "Hello, Alice!"
💡 Why I Built This
I've been watching the multi-agent AI space explode. Everyone's building agents with CrewAI, LangGraph, AutoGen—but they can't talk to each other reliably.
When Agent A (Python) and Agent B (JavaScript) are supposed to do the same thing, they interpret it differently. Same task, different validation, different errors, chaos.
I thought: What if agents could share executable contracts? Not just type schemas, but actual behavior. Write it once, transpile to any language, guarantee identical execution.
So I built it. With a lot of help from Claude Code (seriously, this wouldn't exist without it).
Is it useful? That's what I'm trying to figure out. If you're building multi-agent systems and this solves a problem for you, I want to hear about it. If it doesn't, I want to hear that too.
✨ What Actually Works (v0.0.3)
I'm trying to be transparent about what's ready vs. what's still cooking:
✅ Production Ready:
- 5 Language Transpilation: Python, JavaScript, Go, Rust, C# all compile successfully
- Standard Library: 134/134 tests passing (Option, Result, List, Map, Set)
- CLI: Full end-to-end workflow (
pip install→asl build→ working code) - Proof of Concept: Real examples showing 100% identical behavior (not fake!)
- Framework Integration: CrewAI and LangGraph examples working
🚧 In Progress:
- Additional framework integrations (AutoGen, LangChain)
- VS Code extension improvements
- More comprehensive integration tests
- Performance optimizations
📊 Test Results (Verified):
✅ 134/134 stdlib tests passing (100%)
✅ 1457 total tests collected
✅ 5 languages verified working
✅ End-to-end CLI workflow tested
🎯 Use Cases
1. Multi-Framework Coordination
Challenge: CrewAI agent (Python) and LangGraph agent (JavaScript) need to coordinate
Solution:
# Define contract
cat > task_contract.al
# Both agents transpile from same contract
asl build task_contract.al --lang python
asl build task_contract.al --lang javascript
# Guaranteed coordination ✅
2. Framework Migration
Challenge: Migrating from CrewAI to LangGraph without breaking behavior
Solution:
- Extract CrewAI logic to AL contract
- Transpile to LangGraph
- Verify identical behavior
- Migrate incrementally
3. Cross-Team Collaboration
Challenge: Python team and JavaScript team can't share specifications
Solution: AL contracts as shared source of truth
- One contract file
- Each team generates their language
- Behavior guaranteed identical
🌍 Language Support
AL contracts transpile to:
| Language | Status | Use For |
|---|---|---|
| Python | ✅ Production | CrewAI, AutoGen, LangChain |
| JavaScript | ✅ Production | LangGraph, Node.js agents |
| Go | ✅ Production | High-performance agents |
| Rust | ✅ Production | Performance-critical agents |
| C# | ✅ Production | Windows/enterprise agents |
All languages:
- 100% semantic equivalence
- Deterministic behavior
- Full type annotations
- Production-ready code generation
🤝 Contributing
I need your help! Here's the honest truth: this is a solo project (with AI assistance), and I'm figuring things out as I go.
Ways You Can Help:
1. Try it out and tell me what breaks
pip install assertlang
asl build --help
# Then let me know what happened!
2. Open issues for:
- Bugs you find (there are definitely bugs!)
- Features you need (what's missing?)
- Documentation that's confusing (where did you get stuck?)
- Ideas for improvement (what would make this more useful?)
3. Contribute code:
- Fix bugs
- Add framework integrations
- Improve documentation
- Write examples
4. Share feedback:
- Does this solve a real problem for you?
- What frameworks do you use?
- What languages do you need?
- What's your multi-agent coordination pain point?
I Promise:
- Respond to all issues (might take a day or two, but I'll respond)
- Be open to feedback (tell me what's wrong, I won't be offended)
- Give credit (every contributor gets recognized)
- Keep it simple (no corporate BS, just building something useful)
Not sure where to start? Look for issues tagged good-first-issue or just open an issue saying "I want to help!" and I'll find something.
📚 Real-World Example
See complete working example: examples/agent_coordination/
What's included:
- User service contract (validation, creation, formatting)
- CrewAI agent (Python) implementation
- LangGraph agent (JavaScript) implementation
- Proof of identical behavior (100% match on all tests)
- Integration guides
Run it yourself:
cd examples/agent_coordination
python agent_a_crewai.py # Agent A output
node agent_b_langgraph.js # Agent B output
# Compare - they're identical!
📊 How It Works
┌─────────────────────────────────────────────────┐
│ AL Contract (Source of Truth) │
│ function createUser(name, email) -> User │
└─────────────────┬───────────────────────────────┘
│
┌────────┴────────┐
│ AssertLang │
│ Transpiler │
└────────┬────────┘
│
┌─────────────┼─────────────┐
│ │ │
▼ ▼ ▼
┌─────────┐ ┌─────────┐ ┌─────────┐
│ Python │ │JavaScript│ │ Go │
│ (CrewAI)│ │(LangGraph│ │ (Custom)│
└─────────┘ └─────────┘ └─────────┘
All execute IDENTICAL logic
Under the hood:
- Parse AL contract
- Extract semantic requirements
- Generate idiomatic code for each language
- Guarantee behavioral equivalence
💬 Get in Touch
Want to chat about multi-agent systems? I'm always happy to talk!
- GitHub Issues: Open an issue (best way to reach me)
- GitHub Discussions: Start a discussion
- Twitter/X: @davidhustler (DMs open)
- Email: hello@assertlang.dev
I'm especially interested in hearing from you if:
- You're building multi-agent systems and hitting coordination problems
- You've tried AssertLang and have feedback (good or bad!)
- You want to contribute but aren't sure how
- You have ideas for making this more useful
📝 License
MIT © AssertLang Contributors
Built with ❤️ (and lots of Claude Code assistance) for the multi-agent AI community.
🙏 Acknowledgments
Huge thanks to:
- Claude (Anthropic) - for making it possible for non-"real" engineers to build real tools
- The multi-agent AI community - for inspiration and showing the need for this
- Early testers - for trying this out and giving honest feedback (you know who you are!)
- Everyone who's starred the repo - it genuinely motivates me to keep building
🎯 Current Status & Roadmap
v0.0.4 (Current) ✅
- Core transpiler working (5 languages)
- 134/134 stdlib tests passing
- CLI functional end-to-end (fixed critical import bug!)
- CrewAI & LangGraph examples
- Proof of identical behavior verified
v0.1.0 (Next) 🎯
- Fix remaining integration test issues
- Add AutoGen integration
- Improve VS Code extension
- Add more framework examples
- Performance benchmarking
v0.2.0 (Future) 💭
- Contract testing framework
- Additional language targets (Java, PHP)
- Cloud-hosted transpilation service
- Enterprise support options
Want to influence the roadmap? Open an issue and tell me what you need!
Built by one person, trying to solve a real problem.
If this helps you, that makes it all worth it. ⭐
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 assertlang-0.1.6.tar.gz.
File metadata
- Download URL: assertlang-0.1.6.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d44bb1a315cb7d82902878e9296614506916ee2e576259c7bf1c70dfcb378c7
|
|
| MD5 |
33644fb525a8f312cd92fbbc51ed6c12
|
|
| BLAKE2b-256 |
753473b348c557c70a12e6330c2275b816feac91888ff93898908c0b53367472
|
File details
Details for the file assertlang-0.1.6-py3-none-any.whl.
File metadata
- Download URL: assertlang-0.1.6-py3-none-any.whl
- Upload date:
- Size: 1.3 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a458d81f29ca93a18306333b7e54a1ac89315719efe2e0e7e62402d0856078f8
|
|
| MD5 |
08ce4c0b42f59628b3d4132595759dee
|
|
| BLAKE2b-256 |
e4a517cc2cf8b10179fd0bbe5e6aaa9134a5a163a8012daf238090620ec94048
|