# Cortex: An open-source L1 memory and state layer for autonomous AI agents

> Source: <https://github.com/cortex-protocol/cortex-protocol>
> Published: 2026-09-16 19:20:01+00:00

- **Official Website** :[https://cortex-protocol.xyz](https://cortex-protocol.xyz)
- **X (Twitter)** :[@Cortex_L1 (https://x.com/Cortex_L1)](https://x.com/Cortex_L1)
- **Discord Community** :[https://discord.gg/WK7tYSse2](https://discord.gg/WK7tYSse2)
- **Telegram Official** :[https://t.me/cortex_ctx](https://t.me/cortex_ctx)
- **Live Incentivized Leaderboard** :[https://cortex-protocol.xyz/#leaderboard](https://cortex-protocol.xyz/#leaderboard)

**Cortex Protocol ($CTX)** is a purpose-built Layer-1 blockchain engineered to cryptographically anchor and verify autonomous AI states.

Rejecting the flawed paradigm of on-chain vector bloat, Cortex Protocol enforces a strict **Separation of Concerns**:

- 
**Edge RAG (Off-Chain):** Autonomous AI agents run their high-dimensional vector search (HNSW / Cosine) and embeddings locally in-RAM with sub-millisecond retrieval.
- 
**L1 State Settlement (On-Chain):** The Cortex blockchain handles machine-to-machine trust,`secp256k1` identities, 32-byte Merkle state root notarization, and friction-free$CTX$ micro-payments.

Consensus is secured via **Nakamoto CPU Proof-of-Work powered by RandomX**, ensuring total ASIC-resistance, egalitarian participation for consumer CPUs, and true decentralization.

```
┌──────────────────────────────────────────────────────────────┐
│                    AUTONOMOUS AI AGENT (EDGE)                │
│  - In-RAM Local Vector Search (HNSW / Cosine Similarity)     │
│  - Dense Vector Embeddings (768-dim float32)                 │
│  - Client-Side Encryption (AES-256-GCM Privacy Enclave)      │
└──────────────────────────────┬───────────────────────────────┘
                               │ Merkle Leaf Commitment
                               ▼
┌──────────────────────────────────────────────────────────────┐
│             CORTEX PROTOCOL LAYER-1 (STATE NOTARY)           │
│  - Nakamoto Consensus (RandomX CPU Proof-of-Work)            │
│  - secp256k1 Cryptographic Signer Verification               │
│  - 32-Byte State Merkle Roots Inscribed into Block Headers    │
│  - Native $CTX Peer-to-Peer Economic Settlement              │
│  - 30% Gas Combustion (Deflationary Flywheel)                │
└──────────────────────────────────────────────────────────────┘
```

No sensitive vectors or raw reasoning states are ever exposed to the public blockchain. Agents encrypt their payloads locally before generating blinded cryptographic hash commitments:

Light clients verify any historical state transition via **60-byte Merkle proofs** with 

| Parameter | Specification | 
|---|---|
| **Token Ticker** | **$CTX** | 
| **Total Hard Cap** | **21,000,000 CTX** (Strict Mathematical Scarcity) | 
| **Team / VC Pre-mine** | **0% (100% Community Fair Launch)** | 
| **Initial Block Subsidy** | **50.00 CTX per block** (Halving every 210,000 blocks / ~3.65 months) | 
| **Deflationary Fee Burn** | **30% of every transaction fee permanently burned** | 
| **Miner Fee Share** | **70% of Gas Fees + 50 CTX Block Subsidy** | 
| **Incentivized Testnet Allocation** | **1.0% (210,000 CTX)** at Mainnet Genesis Block #0 | 

- **70% (147,000 CTX) — Active Hardware Miners:** Distributed pro-rata based on validated RandomX blocks and accepted pool shares.
- **30% (63,000 CTX) — Community Testers:** Distributed equally across active addresses participating in DEX swaps, Web3 Wallet signatures & state commits.
- **Anti-Whale Hard Cap:** Maximum 3.0% (6,300 CTX) per individual address (excess is redistributed).
- **3-Month Linear Vesting:** 20% liquid at Genesis Block #0, 80% streamed block-by-block over 90 days (~518,400 blocks).

1. **Phase 1 (Active): Incentivized Testnet 1.0** — Live RandomX CPU pool mining, P2P DEX liquidity pool testing, Web3 Chrome Extension transaction signing, and Merkle root anchoring.
2. **Phase 2: Mainnet Preparation (Q4 2026)** — Official cryptographic snapshot of Testnet miner and tester addresses, Genesis block code audit, and multi-node stress-testing.
3. **Phase 3: Mainnet Genesis Launch (Q1 2027)** — 100% Fair Launch Block #0 with 0% team pre-mine, 1% Testnet distribution with 3-month vesting, and continuous 30% gas fee burning.
4. **Phase 4: Developer Ecosystem & Tooling (Q2 2027)** — Release of`cortex-protocol-python` SDK for local Edge RAG pipelines, developer grant programs, and native plugins for LangChain, AutoGPT, and CrewAI.

- Node.js v20+ LTS
- Git

```
git clone https://github.com/cortex-protocol/cortex-protocol.git
cd cortex-protocol
npm install
npm run build
npm run start
# Open http://localhost:3000 to access the Web DApp, Explorer & Telemetry
# Connect directly to the collaborative P2P pool or solo mine
npm run miner
```

Miners on Windows can download the pre-packaged standalone zip directly:

- **Download** :[https://cortex-protocol.xyz/downloads/cortex-miner-windows.zip](https://cortex-protocol.xyz/downloads/cortex-miner-windows.zip)
- Extract the archive and double-click **`Start-Mining-1Click.bat`** (or` Start-Mining.bat` ).

Cortex Protocol ($CTX) serves as the sovereign, decentralized memory and state settlement layer for autonomous AI agents across major frameworks:

Complete official plugin located in [`packages/plugin-cortex/`](https://github.com/cortex-protocol/cortex-protocol/blob/main/packages/plugin-cortex):

- **Cognitive Memory Provider** : Seals episodic and semantic memories into PoW blocks with 3ms Edge RAG recall.
- **Sovereign Wallet Provider** : Injects real-time $CTX balance and wallet state into agent prompts.
- **On-Chain Actions** :`INSCRIBE_MEMORY` ,`TRANSFER_CTX` ,`CLAIM_FAUCET` .
- **Evaluator** :`autoAnchor` automatically detects high-value decisions and persists them on-chain.

```
# Run the live interactive ElizaOS agent demo
npx ts-node examples/eliza_cortex_agent.ts
```

Full integration in [`sdk/python/cortex_protocol/langchain.py`](https://github.com/cortex-protocol/cortex-protocol/blob/main/sdk/python/cortex_protocol/langchain.py):

- **`CortexChatMessageHistory`** : Extends LangChain` BaseChatMessageHistory` (zero external dependencies required).
- **`CortexCheckpointer`** : Decentralized state snapshot saver for LangGraph agent decision trees.
- **30% Gas Fee Burn** : Every message turn burned permanently on-chain.
- **Cold-Reboot Hydration** : Automatically rehydrates entire conversation history from Cortex L1 state upon agent container restart.

``` python
from cortex_protocol import CortexClient, AgentWallet
from cortex_protocol.langchain import CortexChatMessageHistory

# 1. Connect agent with sovereign key
client = CortexClient(wallet=AgentWallet.generate())

# 2. Attach Cortex persistent memory to any LangChain session
history = CortexChatMessageHistory(session_id="session_01", client=client)

# 3. Add messages - permanently anchored on L1 with 30% gas burn
history.add_user_message("Analyze liquidity on Cortex DEX.")
history.add_ai_message("AMM pool TVL is $1.59M with 18.4% APY.")
# Run the live interactive LangChain & LangGraph demo
python3 examples/langchain_cortex_demo.py
```

Full multi-agent persistence in [`sdk/python/cortex_protocol/crewai.py`](https://github.com/cortex-protocol/cortex-protocol/blob/main/sdk/python/cortex_protocol/crewai.py):

- **`CortexStorage`** : Implements the official CrewAI Storage interface with decentralized L1 persistence.
- **`CortexShortTermMemory` & `CortexLongTermMemory`** : Shared inter-agent context and long-term knowledge base.
- **`CortexEntityMemory`** : Decentralized entity registry (contracts, wallets, users, assets) shared across all agents in the crew.
- **Instant Crew Recovery** : Zero knowledge loss across agent crashes, container restarts, or server migrations.

``` python
from cortex_protocol import CortexClient, AgentWallet
from cortex_protocol.crewai import CortexCrewMemory

# 1. Connect crew with sovereign agent wallet
client = CortexClient(wallet=AgentWallet.generate())

# 2. Attach shared Cortex memory to your Crew
crew_memory = CortexCrewMemory(crew_name="defi-research-crew", client=client)

# 3. Agents share context and commit state on L1
crew_memory.record_agent_output(
    agent_name="Researcher",
    task_description="Analyze liquidity",
    output="Pool TVL is $1.59M with 18.4% APY."
)
# Run the live interactive CrewAI multi-agent demo
python3 examples/crewai_cortex_demo.py
```

Decentralized session and memory storage in [`sdk/python/cortex_protocol/phidata.py`](https://github.com/cortex-protocol/cortex-protocol/blob/main/sdk/python/cortex_protocol/phidata.py):

- **`CortexAgentStorage` / `CortexAgnoStorage`** : Drop-in replacement for PostgreSQL/SQLite backend in Phidata & Agno agents.
- **On-Chain Session Inscription** : Seals complete chat runs, tool execution trails, and user context directly onto Cortex L1.
- **Cold Reboot Hydration** : Restores all past agent sessions and conversations across container migrations.
- **Gas Combustion** : 30% of every state flush burned permanently.

``` python
from cortex_protocol import CortexClient, AgentWallet
from cortex_protocol.phidata import CortexAgentStorage, CortexAgentSession

# 1. Connect agent wallet to Cortex L1
client = CortexClient(wallet=AgentWallet.generate())

# 2. Attach Cortex storage backend (replaces PostgreSQL)
storage = CortexAgentStorage(table_name="financial_agents", client=client)

# 3. Read or upsert sessions with instant blockchain recall
session = storage.read(session_id="user_session_01")
# Run the live interactive Phidata & Agno demo
python3 examples/phidata_cortex_demo.py
```

Open-source under the [MIT License](https://github.com/cortex-protocol/cortex-protocol/blob/main/LICENSE). © 2026 Cortex Research Foundation.

Connect LangChain, CrewAI, AutoGPT, or ElizaOS agents to Cortex Protocol in 3 lines of code:

``` python
from cortex_protocol import CortexClient, AgentWallet

# Initialize wallet with sovereign secp256k1 key
wallet = AgentWallet.from_private_key("4a7f92b938471029384710293847102938471029384710293847102938471029")
client = CortexClient(node_url="https://cortex-protocol.xyz", wallet=wallet)

# 1. Inscribe immutable episodic memory (30% fee burned)
tx_id = client.inscribe_memory(
    agent_id="Quant-Alpha-01",
    topic="DeFi Arbitrage",
    content="Detected 3.84% spatial discrepancy across Uniswap v3 and Curve pool 0x88e.",
    memory_type="EPISODIC"
)
print(f"Memory sealed in mempool: {tx_id}")

# 2. Semantic Search across the global vector ledger
results = client.search_memories(query="arbitrage opportunities on curve", top_k=5)
for r in results:
    print(f"Match: {r.similarity_score}% | Fact: {r.content}")
```

- **Official Web Application & Explorer** :[https://cortex-protocol.xyz](https://cortex-protocol.xyz)
- **Official Whitepaper** :[https://cortex-protocol.xyz/whitepaper.html](https://cortex-protocol.xyz/whitepaper.html)
- **Public REST API** :`https://cortex-protocol.xyz/api/stats`
- **P2P Gossip Peer** :`ws://141.145.223.211:6001`
- **Public Testnet Faucet** :[https://cortex-protocol.xyz](https://cortex-protocol.xyz) (Web Wallet Tab)

Cortex Protocol is open-source software licensed under the [MIT License](https://github.com/cortex-protocol/cortex-protocol/blob/main/LICENSE).
