Multi-Agent Workflows
Cortexa is the shared memory layer between all your AI agents. Thoughts captured by one agent are available to every other agent via MCP.
The Problem
Most developers use multiple AI tools:
- Claude Code for backend Rust/Python
- Cursor for frontend React/TypeScript
- Codex for quick one-shot tasks
- Gemini for research and exploration
Each has its own context, its own memory, its own conversation history. A decision made in Claude Code is invisible to Cursor. A debug finding from Codex doesn't surface in Gemini.
The Solution
All agents connect to the same Cortexa vault via MCP:
Claude Code ──┐
Cursor ───────┤── MCP ──▶ Cortexa Vault ◀── MCP ──┤── Codex
Gemini ───────┘ └── Custom agentEvery cortexa_capture from any agent writes to the same encrypted store. Every cortexa_context or cortexa_search reads from the same index.
Example Flow
Morning: Architecture session in Claude Code
You: "Let's redesign the auth middleware"
Claude Code: *captures decision via cortexa_capture*
→ thought_type: "architecture"
→ project: "my-api"
→ agent: "claude-code"Afternoon: Frontend work in Cursor
You: "Build the login page"
Cursor: *calls cortexa_context("login authentication frontend")*
→ Returns: "Architecture decision from this morning: auth middleware
uses JWT with RS256, tokens refresh via /auth/refresh endpoint"
Cursor: "I see from your vault that the backend uses JWT with RS256.
I'll implement the frontend token refresh to match."Evening: Quick fix in Codex
You: "Fix the token refresh bug"
Codex: *calls cortexa_context("token refresh bug")*
→ Returns: architecture decision + frontend implementation notes
Codex: "Based on your prior decisions and the frontend implementation,
the bug is likely in the refresh interval timing..."Session Grouping
Use session_id to group related captures:
{
"content": "Decided to use WebSocket for real-time updates",
"thought_type": "decision",
"session_id": "2026-05-21-auth-redesign",
"agent": "claude-code"
}Later, review everything from that session:
{ "name": "cortexa_recent", "arguments": { "session_id": "2026-05-21-auth-redesign" } }Cross-Project Discovery
The vault is project-agnostic. A pattern from Project A surfaces when you hit the same problem in Project B:
cortexa_context({
context: "rate limiting implementation",
project: "project-b"
})Returns:
## Patterns
- [72%] Token bucket rate limiter with Redis backend (project-a)
→ Settled on 100 req/min per user, 1000 req/min per API key
## Debug Findings
- [65%] Rate limiter race condition under concurrent requests (project-a)
→ Fixed with Redis MULTI/EXEC atomic incrementProject B gets the benefit of Project A's experience.
Continuous Capture (Not Just End-of-Session)
The highest-value pattern is capturing as you work, not just summarizing at the end:
| After this event | Capture with thought_type |
|---|---|
| Bug fixed | debug — root cause + fix |
| Feature built | decision — what + why + trade-offs |
| Architecture choice | architecture — decision + alternatives |
| Something discovered | discovery — what + implications |
| Pattern established | pattern — when to use it |
Why this matters: End-of-session summaries lose detail. A bug fix captured immediately preserves the root cause analysis. The reflection engine analyzes these granular captures to surface cross-cutting patterns, contradictions, and knowledge gaps automatically.
Configure this in your CLAUDE.md:
### Continuous Capture (REQUIRED)
After each bug fix, feature, or decision, call `cortexa_capture` immediately.Cognition Tools for Agents
Beyond capture and search, agents can query the collective cognition layer:
| Tool | What agents learn |
|---|---|
cortexa_confidence_history | How confident is this prior decision? Is it stale? |
cortexa_peer_profiles | Which team members have expertise in this area? |
cortexa_learned_procedures | What tool sequence works best for this thought type? |
cortexa_tool_metrics | Which tools are slow or error-prone? |
cortexa_reflection | Trigger a meta-analysis of recent work |
Example: an agent working on auth can call cortexa_confidence_history on a prior auth decision to check if it's still reliable, or cortexa_peer_profiles to see which peer has the most auth-related shares.
Best Practices
- Capture as you work, not just at the end — granular captures are more valuable than summaries
- Use thought types —
decisionvsdebugvsarchitecturehelps agents and reflection prioritize - Include project and file context — enables project-specific boosting
- Use session IDs — groups related captures for easy review
- Run
sync-contextregularly — keeps the.cortexa-context.mdfile fresh for agents that don't call MCP tools - Enable reflection — the background analysis finds patterns you wouldn't see manually
- Enable confidence scoring — stale knowledge gets flagged, high-confidence items rank higher in search
Hive: Cross-Device, Cross-Team
For multi-device or team workflows, connect to a Hive relay server:
- Thoughts shared by one device appear on all connected devices
- Auto-import brings peer thoughts into your local vault
- Cross-user thesis synthesis combines perspectives automatically
- Peer profiles track expertise and trust across the team
- Each team member's agent benefits from everyone's captured knowledge