Skip to content

Product Overview

What Is Cognition Engines?

Cognition Engines is the intelligence layer for AI agent decision-making. It extends the agent-decisions project with three core pillars:

PillarPurpose
AcceleratorsCross-agent learning through semantic decision querying, hybrid retrieval, and pattern detection
Bridge DefinitionsDual-indexing of decisions by structure (form) and function (purpose)
Related DecisionsAuto-linked predecessors from pre-decision queries (lightweight graph edges)
DeliberationFull chain-of-thought capture with step-by-step reasoning traces
GuardrailsPolicy enforcement that prevents violations before they occur
MCP TransportNative integration with any MCP-compliant agent via Model Context Protocol

Inspired by Cisco Outshift's Internet of Cognition architecture, Cognition Engines provides a shared cognitive substrate for multi-agent systems.


Core Value Proposition

1. Semantic Decision Memory

Every decision made by any agent is embedded as a high-dimensional vector (via Google Gemini text-embedding-004) and stored in ChromaDB. Any agent can later query the collective memory:

"Has anyone made a similar decision before?"
"What happened last time we chose PostgreSQL for agent memory?"

2. Policy Enforcement at Decision Time

YAML-defined guardrails are evaluated before an agent commits to a decision. Rules can block, warn, or log:

yaml
- id: no-high-stakes-low-confidence
  description: High-stakes decisions need minimum confidence
  condition_stakes: high
  condition_confidence: "< 0.5"
  action: block
  message: High-stakes decisions require ≥50% confidence

3. Confidence Calibration & Feedback Loop

The system tracks predicted confidence vs. actual outcomes over time, computing Brier scores per agent, per category, and per confidence bucket. This reveals whether agents are over-confident, under-confident, or well-calibrated.

The feedback loop (v0.8.0) enables agents to record decisions, review outcomes, retrieve calibration statistics, and auto-attribute outcomes — closing the cycle between prediction and actuality. Rolling calibration windows (v0.9.0) with drift alerts detect when decision quality degrades over time.

4. Cross-Agent Federation (CSTP)

The Cognition State Transfer Protocol (CSTP v0.9.0) exposes all capabilities via a JSON-RPC 2.0 API over HTTP, allowing remote agents to query, record, and review decisions across organizational boundaries.

5. MCP Integration (Model Context Protocol)

Since v0.9.0, Cognition Engines exposes all decision intelligence capabilities as MCP tools, enabling native integration with Claude Desktop, Claude Code, OpenClaw, and any MCP-compliant client. Two transports are supported:

  • Streamable HTTPPOST/GET to /mcp on the existing CSTP server (port 9991)
  • stdiopython -m a2a.mcp_server for local or Docker-based access

The MCP layer is a zero-duplication bridge — each MCP tool maps 1:1 to an existing CSTP service method.


Key Features

FeatureStatusVersion
Semantic Decision Index✅ Shippedv0.5.0
Pattern Detection Engine✅ Shippedv0.6.0
Enhanced Guardrails + Audit Trail✅ Shippedv0.6.0
Cross-Agent Federation (CSTP)✅ Shippedv0.7.0
Decision Recording (cstp.recordDecision)✅ Shippedv0.7.1
Project Context & Attribution✅ Shippedv0.7.2
Web Dashboard✅ Shippedv0.7.4
Feedback Loop (recordDecision, reviewDecision, getCalibration, attributeOutcomes)✅ Shippedv0.8.0
Rolling Calibration & Drift Alerts✅ Shippedv0.9.0
Confidence Variance Detection✅ Shippedv0.9.0
Hybrid Retrieval (BM25 + Semantic)✅ Shippedv0.9.0
MCP Server (7 tools, stdio + Streamable HTTP)✅ Shippedv0.9.0
Bridge-Definitions (F024)✅ Shippedv0.9.1
Related Decisions (F025)✅ Shippedv0.9.4
Deliberation Traces (F023)✅ Shippedv0.9.1
Shared Intent Protocol📋 Future
Context Graphs📋 Future
Multi-Agent Cognition Network📋 Future

Framework Compatibility

Cognition Engines is agent-framework agnostic — it is pure Python + ChromaDB and works with:

  • LangChain / LangGraph — Add as a tool or pre-decision hook
  • AutoGen — Integrate into agent decision steps
  • CrewAI — Expose as a custom tool
  • Claude Desktop / Claude Code — Connect via MCP (stdio or Streamable HTTP)
  • OpenClaw — Connect via MCP or direct HTTP
  • Any MCP client — Native tool discovery and invocation
  • Any Python agent — Import directly or call via HTTP/CLI

Technology Stack

LayerTechnology
LanguagePython 3.11+
API FrameworkFastAPI (async, JSON-RPC 2.0)
MCP Transportmcp SDK — Streamable HTTP + stdio
Vector DatabaseChromaDB (semantic search)
Keyword SearchBM25 via rank-bm25
EmbeddingsGoogle Gemini text-embedding-004 (768-dim)
DashboardFlask + Jinja2
AuthenticationBearer token (constant-time comparison)
ContainerizationDocker (multi-stage build)
Build SystemHatchling (pyproject.toml)
Testingpytest + pytest-asyncio + pytest-cov
Lintingruff + mypy (strict)

Decision Lifecycle

mermaid
flowchart LR
    A["1. Record\nAgent submits\ndecision"] --> B["2. Evaluate\nGuardrails\npass/fail"]
    B --> C["3. Store & Index\nChromaDB + YAML\npersisted"]
    C --> D["4. Review\nOutcomes\nBrier scores"]
    D --> E["5. Calibrate\nDrift detection\n& alerts"]
    E -->|"feedback loop"| A
  1. Record — An agent records a decision with confidence, category, stakes, reasons, and optional project context.
  2. Evaluate — Guardrails are evaluated against the decision context. Violations block or warn.
  3. Store — The decision is written to a YAML file and indexed into ChromaDB with Gemini embeddings.
  4. Review — After outcomes are known, the decision is reviewed (success/failure/partial/abandoned).
  5. Calibrate — Brier scores and calibration buckets are computed. Rolling windows and drift detection compare recent vs. historical accuracy.

Released under the Apache 2.0 License.