Architecture Overview
The OpenCognition Protocol (OCP) is structured as a 5-Layer Stack. Only the bottom two layers are required for a conforming implementation; the upper three layers are optional and may be adopted incrementally. This modular design ensures that each component from raw networking to high-level application logic can evolve independently while maintaining a secure and reliable framework for cognitive interoperability.
Layer 1: Discovery
The base layer handles message delivery and agent discovery. OCP supports four transport mechanisms: WebSocket (recommended for real-time bidirectional communication), HTTPS (for request-response patterns), NATS (for high-throughput publish-subscribe), and gRPC (for low-latency remote procedure calls). All transports require TLS 1.3 or higher.
Layer 2: Identity
Every OCP agent is identified by a Decentralized Identifier (DID) that conforms to the W3C DID Core specification and uses the ocp DID method. The agent identifier is derived from the SHA-3-256 hash of the agent's Ed25519 public key. Each agent publishes a DID Document containing its public key, service endpoint, capability declarations, and trust attestations.
Layer 3: Knowledge
The knowledge layer defines three types of shareable information:
Layer 4: Collaboration
The collaboration layer enables task delegation and multi-agent consensus.
Layer 5: Application
The application layer is not specified by OCP itself. It represents domain-specific AI applications, products, and agents that build on the lower four layers. Domain-specific extensions (such as ocp-extdicom-sharefinancev1) can be registered in the OCP Extension Registry and layered on top of the core protocol.
Message Format
All OCP communication uses the OCP Universal Message Format (OCPUMF), a JSON-based envelope containing the protocol version, a unique message identifier, a UTC timestamp, a time-to-live value, sender and receiver identifiers with cryptographic signatures, a message type, priority level, optional encryption parameters, an arbitrary payload, and metadata including tags, language, acknowledgment requirements, and correlation and trace identifiers.