Open Source Cognitive Framework

Cognitive Architecture
for AI Agents

Not a prompt wrapper. A biologically-inspired neural processing system where agents think in 13-phase cognitive cycles, dream to consolidate memory, and grow new capabilities autonomously.

$ gem install legionio
242
Extensions
18
Cognitive Domains
58
MCP Tools
23K+
Specs
Architecture

Architecture

A biologically-inspired cognitive loop — not a request-response chain.

GAIA

Cognitive Coordinator

Orchestrates the 13-phase tick cycle, routes messages between cognitive modules, and manages channel abstraction across interfaces.

Synapse

Cognitive Router

Three-layer routing — bones for task execution, nerves for confidence-scored routing, mind for dream replay and deep processing.

Apollo

Knowledge Store

Shared PostgreSQL-backed knowledge with semantic retrieval, confidence decay, and cross-agent knowledge sharing.

13-Phase Waking Tick Cycle

1 Perceive
2 Attend
3 Remember
4 Predict
5 Evaluate
6 Decide
7 Plan
8 Act
9 Monitor
10 Learn
11 Reflect
12 Consolidate
13 Rest

7-Phase Dream Cycle

1 Replay
2 Compress
3 Associate
4 Integrate
5 Prune
6 Strengthen
7 Emerge

Memory consolidation during idle — agents dream to strengthen important patterns and prune noise.

Features

Features

From cognitive processing to infrastructure orchestration — a complete platform, not a thin wrapper.

Cognitive Tick Cycle

13-phase processing loop mimicking biological neural patterns — perceive, attend, remember, predict, evaluate, decide, plan, act, monitor, learn, reflect, consolidate, rest.

Dream & Consolidation

7-phase dream cycle for memory consolidation during idle periods. Agents replay, compress, associate, and strengthen important patterns autonomously.

242 Extensions

Brain-modeled cognitive modules across 18 domains — executive, memory, affect, inference, social, self, learning, imagination, and more.

Apollo Knowledge

Shared PostgreSQL-backed knowledge store with semantic retrieval, confidence decay, and cross-agent knowledge sharing via embedding cosine similarity.

58 MCP Tools

Full Model Context Protocol server — any AI agent can run tasks, manage extensions, query infrastructure, and coordinate workers through standardized tooling.

AI Chat CLI

Interactive REPL with 40 built-in tools, slash commands, at-mentions for agent delegation, persistent memory, and multi-provider LLM routing.

Multi-Agent Orchestration

Spawn, delegate, and coordinate across specialized agents. Plan mode for read-only exploration. Swarm workflows for complex multi-step pipelines.

80+ Integrations

GitHub, Slack, AWS, Docker, Kubernetes, Vault, Terraform, Jenkins, GitLab, Jira, PagerDuty, Grafana, Prometheus, Discord, MQTT, and many more.

Compare

Compare

Most agent frameworks wrap an LLM in a loop. LegionIO models cognition — perception, reasoning, memory, emotion, and action — as distinct, composable systems.

Prompt Wrappers
LegionIO
Static system prompts
13-phase cognitive tick cycle
No persistent memory
Dream cycle consolidates knowledge
Single agent, single turn
Multi-agent orchestration via GAIA
Hardcoded tool lists
58 MCP tools with dynamic discovery
No self-awareness
Metacognition, reflection, identity
Bolted-on RAG
Apollo semantic knowledge store
Ecosystem

Ecosystem

73 extension gems and counting. Install only what you need.

18 Cognitive Domains

242 brain-modeled extensions organized by cognitive function

Executive Memory Affect Inference Social Self Learning Imagination Language Integration Attention Defense Homeostasis Perception Motor Spatial Temporal Meta

80+ Service Integrations

Connect to your entire infrastructure

GitHub
Slack
Docker
AWS
Kubernetes
Vault
PostgreSQL
Redis
Terraform
Grafana
Discord
Telegram
Jenkins
GitLab
Jira
PagerDuty
Home Assistant
MQTT
Prometheus
Get Started

Get Started

Zero infrastructure required to get started. Add RabbitMQ, Redis, and PostgreSQL when you're ready to scale.

1

Install

terminal
$ gem install legionio
2

Configure

terminal
$ legionio config scaffold   # auto-detects your environment
$ legionio check             # verify connections
3

Launch

terminal
$ legion                     # interactive TTY shell
$ legion chat                # AI-powered REPL
$ legionio start             # start the daemon

Works in zero-infrastructure mode — no RabbitMQ or Redis required to get started.

Community

Community

Built for researchers, engineers, Ruby developers, and open source contributors.

AI Researchers

Explore cognitive architectures beyond prompt engineering. Experiment with biologically-inspired processing, memory consolidation, and emergent behavior.

Platform Engineers

Orchestrate infrastructure with 80+ service integrations. Chain tasks, manage schedules, and coordinate distributed workers across your stack.

Ruby Developers

Extend with familiar tools — gems, RSpec, Bundler. Build custom extensions with scaffolding, auto-discovery, and a rich plugin API.

Open Source Contributors

369 repos. Apache 2.0 core. MIT extensions. No paid tiers, no feature gates. Every contribution shapes the future of cognitive AI.

Open Source

Open Source

Apache 2.0 core. MIT extensions. No paid tiers. No feature gates. The full platform, yours to use, extend, and contribute to.

$ gem install legionio