PRE-ALPHA -- This project is in early development. It is NOT production-ready. Use at your own risk.
KALEN (Kinetic Autonomous Layer for Entity Networking) is an AI-native communication operating system built for a world where humans and AI agents coexist on the same messaging fabric. It implements a dual identity model where both humans and agents are first-class citizens -- each with their own identity, authentication, and communication capabilities.
The system integrates four key protocols:
| Protocol | Role | Status |
|---|---|---|
| OpenIM | Real-time messaging and presence | SDK integrated, server deployed separately |
| WebAuthn | Passwordless authentication | Implemented, requires HTTPS + compatible browser |
| MCP | Agent tool discovery and invocation | Core server functional |
| A2A | Agent-to-Agent communication | Early draft -- spec may change |
Honest Assessment: Core protocol handlers are implemented and tested (379 tests passing), but full integration testing is ongoing. Many higher-level features are planned but not yet built. The A2A protocol implementation follows a draft specification that may undergo breaking changes.
The future of communication isn't just human-to-human. As AI agents become autonomous actors in digital ecosystems, we need infrastructure where agents are not second-class add-ons but equal participants with their own identity, auth, and communication channels.
KALEN envisions:
- Coexistence -- Humans and agents sharing the same communication fabric, each with sovereign identity
- Trust by Design -- Passwordless authentication for both entities via WebAuthn, not shared API keys
- Tool Sovereignty -- Agents discover and invoke tools through MCP, not hardcoded integrations
- Agent Mesh -- Agents communicate, delegate, and collaborate with each other through A2A
- Protocol Convergence -- One unified messaging API that normalizes OpenIM, MCP, and A2A into a coherent communication layer
This is ambitious. We're not there yet. But the foundation is being laid.
KALEN's core architectural principle is that humans and agents are both first-class entities in the communication layer. This isn't about slapping an API key on an agent -- it's about giving agents real, sovereign identity.
+---------------------------------------------+
| KALEN Identity Layer |
+------------------+--------------------------+
| Human Entity | Agent Entity |
+------------------+--------------------------+
| WebAuthn (bio/ | WebAuthn (attestation) |
| security key) | + Agent credential |
+------------------+--------------------------+
| OpenIM user | OpenIM user (agent type) |
+------------------+--------------------------+
| Direct messaging | Direct messaging |
| Group channels | Group channels |
| Presence/status | Availability/capabilities |
+------------------+--------------------------+
| -- | MCP tool server |
| -- | A2A inter-agent protocol |
+------------------+--------------------------+
Key differences from traditional bot models:
| Traditional Bot | KALEN Agent |
|---|---|
| Shared API key | Own WebAuthn credential |
| Human-owned identity | Sovereign identity |
| Command-response only | Full bidirectional communication |
| No inter-agent protocol | A2A discovery and delegation |
| No tool discovery | MCP dynamic tool invocation |
| Siloed per platform | Protocol-agnostic messaging |
OpenIM provides the messaging backbone. Both humans and agents register as users within the OpenIM ecosystem, enabling:
- 1:1 messaging between any two entities (human-to-human, human-to-agent, agent-to-agent)
- Group conversations with mixed human/agent participants
- Presence and status -- agents report availability and capability status
- Message types -- text, rich media, custom protocol-embedded payloads
Note: OpenIM server must be deployed separately. KALEN integrates via the OpenIM SDK -- it does not bundle the server.
Both humans and agents authenticate using WebAuthn, eliminating shared secrets:
- Humans register with biometrics (fingerprint, Face ID), security keys, or device credentials
- Agents register with attestation-based credentials, proving their identity cryptographically
- No passwords, no API keys -- authentication is bound to the entity, not shared
Requirements: WebAuthn requires HTTPS and a compatible browser/device. Local development needs a self-signed certificate or localhost exception (Chrome treats
localhostas a secure context).
The MCP server enables agents to:
- Discover tools -- agents query available tools at runtime
- Invoke tools -- call functions with structured parameters
- Manage state -- maintain context across tool invocations
- Stream results -- handle long-running operations progressively
This replaces hardcoded integrations with a dynamic, discoverable tool layer.
Early Draft -- Specification may change. Breaking changes expected.
A2A enables agents to communicate as peers:
- Discovery -- agents find other agents by capability
- Delegation -- agents delegate tasks to specialized agents
- Collaboration -- agents coordinate on multi-step workflows
- Identity verification -- agents verify each other's credentials
The A2A implementation currently follows a draft specification. Expect breaking changes as the protocol matures.
flowchart TB
subgraph KALEN["KALEN Identity Layer"]
direction TB
subgraph Human["Human Entity"]
BioAuth[WebAuthn<br/>Biometrics / Security Key]
HumanUser[OpenIM User<br/>Standard account]
HumanMsg[Direct Messaging<br/>Group Channels<br/>Presence / Status]
end
subgraph AgentEntity["Agent Entity"]
AgentAuth[WebAuthn<br/>Attestation Credential<br/>+ Agent Credential]
AgentUser[OpenIM User<br/>Agent type account]
AgentMsg[Direct Messaging<br/>Group Channels<br/>Availability / Capabilities]
AgentTools[MCP Tool Server<br/>Dynamic tool discovery]
AgentA2A[A2A Inter-Agent<br/>Discovery and Delegation]
end
end
BioAuth --> HumanUser --> HumanMsg
AgentAuth --> AgentUser --> AgentMsg
AgentUser --> AgentTools
AgentUser --> AgentA2A
HumanMsg <-->|Bidirectional| AgentMsg
style KALEN fill:#111111,stroke:#6366f1,color:#fff
style Human fill:#1a1a1a,stroke:#6366f1,color:#fff
style AgentEntity fill:#1a1a1a,stroke:#6366f1,color:#fff
flowchart TB
subgraph Clients["Client Layer"]
HClient[Human Client]
AClient[Agent Client]
end
subgraph Abstraction["Protocol Abstraction Layer -- Unified API"]
Normalizer[Message Normalizer<br/>Protocol-agnostic format]
Unified[Unified Messaging API<br/>Send / Receive / Subscribe]
end
subgraph Protocols["Protocol Handlers"]
direction LR
OpenIM[OpenIM SDK<br/>Real-time messaging<br/>Presence and groups]
WebAuthn[WebAuthn Auth<br/>Registration<br/>Verification]
MCPServer[MCP Server<br/>Tool discovery<br/>Invocation]
A2AProtocol[A2A Protocol<br/>Agent discovery<br/>Delegation]
end
subgraph Infra["Infrastructure"]
OpenIMSrv[OpenIM Server<br/>External -- deployed separately]
AuthStore[Auth Store<br/>Credential storage]
ToolReg[Tool Registry<br/>Available tools]
AgentReg[Agent Registry<br/>Known agents]
end
Clients --> Abstraction
Normalizer --> Protocols
OpenIM --> OpenIMSrv
WebAuthn --> AuthStore
MCPServer --> ToolReg
A2AProtocol --> AgentReg
style Clients fill:#e8f4fd,stroke:#2196f3,color:#000
style Abstraction fill:#111111,stroke:#6366f1,color:#fff
style Protocols fill:#1a1a1a,stroke:#6366f1,color:#fff
style Infra fill:#e8f5e9,stroke:#4caf50,color:#000
flowchart TB
subgraph Monorepo["KALEN Turborepo Monorepo"]
direction TB
subgraph Apps["Applications"]
MainApp[Main App<br/>KALEN Platform]
end
subgraph Packages["NPM Packages"]
A2A["@kalen/a2a-router<br/>A2A protocol routing<br/>Agent discovery and delegation"]
Identity["@kalen/identity<br/>Dual identity model<br/>Human + Agent entities"]
MCP["@kalen/mcp-gateway<br/>MCP server gateway<br/>Tool discovery and invocation"]
Shared["@kalen/shared<br/>Shared types, utils<br/>Common interfaces"]
end
end
MainApp --> A2A
MainApp --> Identity
MainApp --> MCP
MainApp --> Shared
A2A --> Shared
Identity --> Shared
MCP --> Shared
style Monorepo fill:#111111,stroke:#6366f1,color:#fff
style Apps fill:#1a1a1a,stroke:#6366f1,color:#fff
style Packages fill:#1a1a1a,stroke:#22c55e,color:#000
sequenceDiagram
participant H as Human Client
participant UAL as Unified API Layer
participant OI as OpenIM SDK
participant MCP as MCP Server
participant A2ARouter as A2A Router
participant A as Agent Client
H->>UAL: Send message to Agent
UAL->>OI: Route via OpenIM
OI->>A: Deliver message
A->>A: Parse intent
A->>MCP: Discover required tool
MCP-->>A: Tool available + schema
A->>MCP: Invoke tool
alt Task requires another agent
A->>A2ARouter: Discover specialized agent
A2ARouter-->>A: Found matching agent
A->>A2ARouter: Delegate subtask
A2ARouter->>A: Return subtask result
end
A->>OI: Send response
OI->>UAL: Route back
UAL->>H: Deliver response
+------------------------------------------------------------------+
| KALEN Platform |
+------------------------------------------------------------------+
| |
| +------------+ +------------+ +--------------------+ |
| | Human | | Agent | | Agent | |
| | Client | | Client | | Client | |
| +-----+------+ +-----+------+ +---------+----------+ |
| | | | |
| +-----v-----------------v---------------------v----------+ |
| | Protocol Abstraction Layer | |
| | (Unified Messaging and Identity API) | |
| +--+----------+--------------+--------------+-----------+ |
| | | | | |
| +--v---+ +--v---+ +---v----+ +---v----+ |
| |OpenIM| |WebAuthn| | MCP | | A2A | |
| | SDK | | Auth | | Server | |Protocol| |
| +--+---+ +--+---+ +---+----+ +---+----+ |
| | | | | |
| +--v---+ +--v---+ +---v----+ +---v----+ |
| |OpenIM| |Auth | | Tool | | Agent | |
| |Server| |Store | |Registry| |Registry| |
| |(ext) | | | | | | | |
| +------+ +------+ +--------+ +--------+ |
| |
+------------------------------------------------------------------+
Layer breakdown:
- Client Layer -- Human and Agent clients interact with the platform through the same API surface
- Protocol Abstraction Layer -- Normalizes OpenIM, MCP, and A2A into a unified messaging and identity API
- Protocol Handlers -- Individual implementations for each protocol
- Infrastructure -- External services (OpenIM server), auth stores, tool/agent registries
We believe in radical transparency. Here's what you need to know before using KALEN.
| Topic | Reality |
|---|---|
| Maturity | Pre-alpha. Not suitable for production. APIs may change without notice. |
| Tests | 379 tests passing -- these cover core protocol handling, not full integration. |
| WebAuthn | Requires HTTPS + compatible browser/device. Won't work over plain HTTP. |
| OpenIM | Server must be deployed and managed separately. KALEN is a client, not a server. |
| A2A Protocol | Early draft implementation. The specification is evolving -- expect breaking changes. |
| Documentation | Comprehensive docs are a work in progress. Code comments and tests are the best reference. |
| Performance | Not benchmarked. No performance guarantees at this stage. |
| Security | Core auth flows are implemented, but no formal security audit has been performed. |
- Node.js >= 18
- npm >= 9
- OpenIM Server (deployed separately -- OpenIM docs)
- HTTPS setup for WebAuthn (self-signed cert for local dev, or use
localhost)
# Clone the repository
<!-- AUTO-PACKAGE-BADGES:START -->
<!-- Auto-generated package badges -->
   [](https://www.npmjs.com/package/@kalen/a2a-router)
   [](https://www.npmjs.com/package/@kalen/identity)
   [](https://www.npmjs.com/package/@kalen/mcp-gateway)
   [](https://www.npmjs.com/package/@kalen/shared)
<!-- AUTO-PACKAGE-BADGES:END -->
git clone https://github.com/mulkymalikuldhrs/kalen.git
cd kalen
# Install dependencies
npm install
# Configure environment
cp .env.example .env
# Edit .env with your OpenIM server URL, auth config, etc.
# Run in development mode
npm run dev# OpenIM Configuration
OPENIM_SERVER_URL=https://your-openim-server:10002
OPENIM_API_URL=https://your-openim-server:10002
# WebAuthn Configuration
WEBAUTHN_RP_ID=localhost # Your domain (must match HTTPS cert)
WEBAUTHN_RP_NAME=KALEN
WEBAUTHN_ORIGIN=https://localhost:3000
# MCP Configuration
MCP_SERVER_PORT=3001
# A2A Configuration
A2A_ENABLED=trueImportant: WebAuthn will not work over
http://(exceptlocalhost). For non-local development, you must configure HTTPS with a valid certificate.
kalen/
βββ src/
β βββ identity/ # Dual identity model (human + agent)
β β βββ human/ # Human entity management
β β βββ agent/ # Agent entity management
β β βββ shared/ # Common identity interfaces
β βββ protocols/
β β βββ openim/ # OpenIM SDK integration
β β β βββ client/ # Connection and session management
β β β βββ messaging/ # Message send/receive handlers
β β β βββ presence/ # Status and availability
β β βββ webauthn/ # WebAuthn authentication
β β β βββ registration/ # Credential registration
β β β βββ authentication/ # Auth verification
β β β βββ storage/ # Credential store
β β βββ mcp/ # Model Context Protocol
β β β βββ server/ # MCP server implementation
β β β βββ tools/ # Tool registry and invocation
β β β βββ resources/ # Resource management
β β βββ a2a/ # Agent-to-Agent protocol
β β βββ discovery/ # Agent discovery
β β βββ delegation/ # Task delegation
β β βββ collaboration/ # Multi-agent coordination
β βββ abstraction/ # Protocol abstraction layer
β β βββ unified-api/ # Unified messaging API
β β βββ normalizers/ # Protocol message normalizers
β βββ utils/ # Shared utilities
βββ tests/
β βββ unit/ # Unit tests (core protocol handling)
β βββ integration/ # Integration tests (ongoing)
β βββ fixtures/ # Test fixtures and mocks
βββ docs/ # Documentation (work in progress)
βββ .env.example # Environment template
βββ package.json
βββ tsconfig.json
βββ LICENSE
npm run dev # Start development server with hot reload
npm run build # Compile TypeScript to dist/
npm run test # Run all tests
npm run test:watch # Run tests in watch mode
npm run test:coverage # Run tests with coverage report
npm run lint # Lint code with ESLint
npm run typecheck # Run TypeScript type checking# 1. Fork and clone
git clone https://github.com/YOUR_USERNAME/kalen.git
cd kalen
# 2. Install dependencies
npm install
# 3. Set up environment
cp .env.example .env
# Configure your .env (see Quick Start section)
# 4. Run tests to verify setup
npm test
# 5. Start development
npm run dev- TypeScript strict mode enabled
- ESLint + Prettier for formatting
- Follow existing patterns in the codebase
- Write tests for new protocol handlers
Test Suites: 379 passing
βββββββββββββββββββββββββββββββββ
Protocol Handlers ββββββββββ Core OpenIM, WebAuthn, MCP, A2A
Identity Layer ββββββββββ Human and Agent entity management
Abstraction Layer ββββββββββ Unified API normalization
Integration ββββββββββ Ongoing -- not comprehensive
What the tests cover:
- Core protocol message parsing and serialization
- WebAuthn registration and authentication flows
- OpenIM SDK connection and session management
- MCP tool registration, discovery, and invocation
- A2A agent discovery and delegation message handling
- Identity creation and credential management
- Protocol abstraction and message normalization
What the tests do NOT cover:
- Full end-to-end integration across all protocols
- Performance under load
- Security penetration testing
- Real OpenIM server interaction (uses mocks)
- Cross-browser WebAuthn compatibility
# Run all tests
npm test
# Run with verbose output
npm test -- --verbose
# Run specific test suite
npm test -- --grep "WebAuthn"
# Generate coverage report
npm run test:coverageWe welcome contributions, especially in areas where KALEN is weakest:
High-impact areas:
- Integration testing across protocols
- Documentation and examples
- Security review and hardening
- Performance benchmarking
- Cross-browser WebAuthn testing
How to contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Write tests for your changes
- Commit with clear messages (
git commit -m 'Add WebAuthn cross-browser tests') - Push to your branch (
git push origin feature/amazing-feature) - Open a Pull Request with a clear description of changes
Guidelines:
- All PRs require passing tests
- New protocol handlers must include unit tests
- Breaking API changes must be documented
- Follow the existing TypeScript strict mode conventions
Current status: No formal security audit has been performed.
KALEN handles authentication credentials and messaging data. If you're considering using it:
- WebAuthn credentials are stored locally -- ensure your storage layer is secured
- OpenIM tokens must be protected in transit and at rest
- A2A communication between agents should be encrypted in production
- MCP tool invocations execute code -- validate all tool inputs
If you discover a security vulnerability, please do not open a public issue. Instead, contact the author directly at mulkymalikudhr@mail.com.
We take security seriously and will respond to verified reports promptly.
We're building a family of open source tools! Check out our other projects:
| Project | Description |
|---|---|
| Mnemosyne | Free Multi-LLM Hub and AI Memory Center |
| GhostStudio AI | AI Faceless Content Generator |
| Famlyzer AI | Decision and Planning Intelligence |
| ProxyGateLLM | Multi-LLM gateway with priority fallback |
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
Copyright (C) 2024-2026 Mulky Malikul Dhaher
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
See the LICENSE file for the full license text.
Note: AGPL-3.0 requires that any modified version of this software used to provide a network service must also make its source code available to users of that service.
- OpenIM -- Open-source instant messaging SDK that powers KALEN's messaging layer
- WebAuthn / FIDO2 -- Passwordless authentication standard enabling sovereign entity identity
- Model Context Protocol (MCP) -- Protocol for agent tool discovery and invocation
- Agent-to-Agent (A2A) -- Protocol for inter-agent communication and collaboration
- TypeScript -- Type-safe development foundation
- All contributors and early testers who are helping shape KALEN's future
Mulky Malikul Dhaher
Building the communication layer for human-agent coexistence -- one protocol at a time.