zenbrain

The digital brain behind ZenAI · explained interactively

🧒 Simple 🔬 Technical

🌐 The whole system at a glance

Every block is a real part of ZenAI. Click one to learn what it does — or press “Play” below and follow, step by step, how a question travels through the whole brain.

▸ Under the hood: Express · TypeScript · PostgreSQL + pgvector (4 contexts: operations / finance / people / strategy) · BullMQ + Redis · provider routing Claude / Mistral / Ollama · 60+ tools via MCP + A2A · 7-layer memory (HiMeS) with sleep consolidation & reconsolidation.

↔ Swipe the diagram sideways
request flows knowledge / context being stored answer returns sleep consolidates
Example question: “Summarise my spending this month” “What did we discuss about Project X last week?” “Research AI trends and write me a note”
Step 0 / 0

Turn on / off

Turn a part off and watch the question simulation to see what the system then lacks. You can also tap the ● switch on a block directly in the diagram.

👆 Tip
Click a block on the left for its explanation, use the switches to turn parts on and off — or play through a question below. New here? Start the short tour in the top right.

💡 Memory-based, not stateless

Most AI assistants are stateless: they forget after every conversation, learn nothing, and cannot act on their own. A memory-based approach is fundamentally different — here side by side:

Aspect
Stateless AI
Memory-based

📅 A day of everything working together

What that feels like day to day — an example day from morning to evening where many parts work together. Click a scene or play the day through.

🧠 The 7-layer memory (HiMeS)

A person doesn’t have one memory but many ways of remembering. ZenAI likewise — seven layers, from “what am I thinking about right now” to “what consolidates overnight”. Click a layer.

👈 Pick a layer
Each layer has its own job. Together they form a memory that remembers, forgets, retrieves and consolidates over time — just like ours.

🔁 How a memory travels

Something new first lands in working and short-term memory. If it matters, it is stored as an episode, later distilled into lasting knowledge. What is used often becomes routine, the most important is firmly pinned — and the predictive brain decides what gets protected, refreshed or forgotten.

Working → Short-term → Episode → Knowledge → Routine → Core → Fore­sight

⚡ The neuro-brain: why ZenAI behaves like a brain

Real brains use neurotransmitters, consolidate during sleep and protect important memories. ZenAI mirrors that (PMA — Predictive Memory Architecture). Drag the sliders and see what happens.

🎚️ Effect on behaviour — drag the sliders above and watch

🔍 Curiosity
🎯 Focus
🧘 Stability
📚 Learning speed

ZenAI is working in balance.

🧊 Triple copy of a memory

Every memory is stored three times — a fast, a medium and a deep copy. The fast one fades quickly, the deep one stays. Press “Time passes”.

Fast copy
Medium copy
Deep copy

Tip: “Recall again” refreshes the copies — just like you do when you think back to something.

🌙 Sleep & consolidation

When idle, ZenAI “sleeps”: it replays the most important experiences, consolidates them, links related ideas and lets unimportant things fade. Just like we do at night.

🌙
System is awake — gathering experiences …

sleep-compute.ts · BullMQ-Worker · consolidation & replay when idle

♻️ Reconsolidation — recalling changes the memory

As soon as a memory is recalled it briefly becomes “soft” and can be updated before it re-consolidates. That keeps knowledge current without relearning everything. A protective layer (stability guard) prevents especially important memories from being overwritten by accident — and every change can be undone.

reconsolidation-engine.ts · stability-protector.ts · priority-map.ts · stc-rescue.ts

🌱 How ZenAI learns & improves itself

Most AI assistants wait passively for questions. ZenAI is different: it is curious, thinks ahead, reflects on its own thinking and gets better with every use. Click a capability — or play through the learning loop.

🔁 The learning loop

↻ … and then the loop starts over — continuously, also in the background.
👇 Six steps that repeat continuously
Click a step or press play through. That is how experience gradually becomes consolidated knowledge — and ZenAI makes fewer mistakes next time.

The six learning capabilities

🤖 The agent team

ZenAI is not a single assistant but a team of specialists. A conductor distributes the task, the specialists work together and share a common memory. Click someone.

🎼
The conductor (orchestrator)
recognises what needs doing and calls the right specialists

Core specialists

8 ready-made helpers (run automatically in the background)

👆 Pick an agent
Each agent specialises in one thing. For larger tasks they hand intermediate results to one another — via a shared memory and a protocol that even lets them talk to external AI agents (A2A).
🧠

Shared memory

All agents read and write in the same memory — the researcher finds something, the writer uses it right away.

shared-memory.ts
🛰️

Talking to other agents (A2A)

Via an open protocol, ZenAI can hand tasks to external AI agents and get results back.

a2a-server.ts · agent-card.ts · /.well-known/agent.json

🗄️ Four separate worlds

So nothing gets mixed up, ZenAI lives in four strictly separated areas. What happens in one area stays there — self-contained data spaces. Click an area.

🔒 Strict separation
Each area has its own data schema in the database. A request is first routed to the right area — finance data and team data never mix.

🧰 More than chat: voice, images & tools

Over 60 tools across many categories make ZenAI capable of acting — it can not only talk but also see, hear and act.

🗣️

Voice

Speak with ZenAI and hear the answer — real-time voice dialogue with recognition and speech output.

voice-pipeline.ts · STT/TTS · WebRTC
👁️

Images & vision

Upload photos or screenshots — ZenAI sees, extracts text (OCR) and understands the content.

claude-vision.ts · 8 Vision-Endpunkte
💻

Run code

Writes and runs code safely (Python, Node, Bash) — in an isolated sandbox with strict safety checks.

code-execution · safety-validator.ts · Docker / Judge0
🌐

Web & browser

Searches the web, reads pages and remembers history & bookmarks.

web-search.ts (Brave/DDG) · browser.ts
📄

Documents

Creates PowerPoint, Excel, PDF & Word — and searches your own files.

document generation suite · RAG
🗂️

Everyday tools

Calendar, email, contacts (CRM), finances, maps & route planning.

calendar · email · contacts · finance · maps

✨ Three brains to choose from

ZenAI uses the best model for the job — and, if needed, works completely offline on your own machine.

Claude

The main brain in the cloud — strongest at reasoning and writing.

Primary
🌬️

Mistral

Fast cloud backup brain in case Claude is unavailable.

Cloud backup
🏠

Ollama

Runs locally on your machine — works entirely without the internet, full privacy.

Local / offline

🔌 Open & extensible

ZenAI is not a closed system — it connects to the world and can be extended with your own capabilities.

🔌

MCP protocol

Connect any external tools & servers via the open Model Context Protocol standard.

mcp-client.ts · mcp-registry.ts · mcp-tool-bridge.ts
🛰️

Agent-to-agent

ZenAI can distribute tasks to other AI agents and merge their results.

a2a-server.ts · capability-index.ts
🧩

Extensions

Custom extensions run safely sandboxed.

extension-registry.ts · extension-sandbox.ts

🔐 Secure & GDPR-compliant

Ten consecutive security & privacy sprints (2026) hardened ZenAI to production readiness.

🔐

Encryption

Sensitive data is stored AES-256-encrypted, with regular key rotation.

Field encryption
🛡️

Access protection

Strict separation per area, person and organisation — no one sees others’ data.

Row-level security
🇪🇺

Your GDPR rights

Access, export and deletion of your data at the push of a button. AI answers are labelled per the EU AI Act.

DSAR · EU AI Act
🏠

Self-hosted

Fully operable on your own hardware — your data never leaves your machine.

Self-hosting

🧬 Inspired by neuroscience

ZenBrain doesn’t mimic an arbitrary database but the way human memory works — how it consolidates, forgets, anticipates and protects itself. You can explore these mechanisms in detail in the Memory, Neuro-brain and Learning tabs.

📊 ZenAI in numbers