Memory Engine  ·  API :8086  ·  UI :3010

AgentBrain

// remember everything. learn from every run.

A three-layer memory system built for AI agents. Working memory for live sessions, episodic storage for long-term history, and a lesson graduation engine that makes your agents genuinely smarter over time.

Open Dashboard → View API Docs ↓
API Port
:8086
Frontend
:3010
Layers
3
Auth
JWT
Three layers of
agent memory
Layer 01 · Working Memory

Live Context

Short-lived entries for the current session — active task state, in-progress results, temporary notes. Automatically expires so your agent never acts on stale data.

24h TTL · auto-expire
Layer 02 · Episodic Memory

Session History

Timestamped events from every run — what happened, what changed, what the outcome was. Searchable across all sessions by semantic meaning or keyword.

permanent · searchable
Layer 03 · Lessons

Learned Rules

Staged lessons reviewed and graduated to permanent rules. Your agents accumulate domain knowledge that automatically shapes future behavior — no manual retraining.

staged → accepted · permanent

Everything your agents
need to learn
🔍
Unified Semantic Search
Search across all three memory layers simultaneously. One query surfaces working notes, episodic events, and lessons in a single ranked result set.
🎓
Lesson Graduation
Lessons start staged for review. Promote them to accepted with one API call — they become permanent rules automatically loaded at session start.
Session Start Context
Call /context at the start of any agent run to load all relevant episodes and accepted lessons in a single request.
🤖
MCP Server
Native MCP tools for Claude and any MCP-compatible agent. Add memory to your AI workflow without writing API calls.
🔐
JWT Authentication
NexusLayer SSO token — the same Bearer token you already have grants full access. No separate signup, no separate credential management.
📊
Activity Dashboard
Visualize memory growth, lesson accumulation, and working memory churn. Track which lessons get applied most frequently across agent runs.

API Reference
MethodEndpointAuthDescription
GET /api/v1/memory/context Bearer Load session context — returns relevant episodes + accepted lessons
POST /api/v1/memory/working Bearer Save a working memory entry with 24h TTL
POST /api/v1/memory/episodes Bearer Record an episodic event (session event, finding, observation)
GET /api/v1/memory/search Bearer Semantic search across all memory layers (?q=...&limit=10)
GET /api/v1/memory/lessons Bearer List all lessons — staged and accepted
POST /api/v1/memory/lessons Bearer Create a new staged lesson for review
POST /api/v1/memory/lessons/{id}/graduate Bearer Promote a staged lesson to accepted (permanent)
Base URL: https://api.agentbrain.nexuslayer.eu  ·  Header: Authorization: Bearer <token>  ·  Format: application/json

SDK Examples
import httpx

class AgentBrainClient:
    def __init__(self, base_url: str, token: str):
        self.base = base_url
        self.headers = {"Authorization": f"Bearer {token}"}

    def start_session(self, keywords: str):
        # Load relevant context for the current task
        return httpx.get(
            f"{self.base}/api/v1/memory/context",
            headers=self.headers, params={"q": keywords}
        ).json()

    def remember(self, content: str, tags=None):
        # Save an episode from the current session
        return httpx.post(
            f"{self.base}/api/v1/memory/episodes",
            headers=self.headers,
            json={"content": content, "tags": tags or []}
        ).json()

    def search(self, query: str, limit: int = 10):
        # Search across all memory layers
        return httpx.get(
            f"{self.base}/api/v1/memory/search",
            headers=self.headers, params={"q": query, "limit": limit}
        ).json()

# ── Session lifecycle ──────────────────────────────
brain = AgentBrainClient("https://api.agentbrain.nexuslayer.eu", token)

ctx = brain.start_session("payment processing billing")
# ctx["episodes"] — relevant history
# ctx["lessons"]  — accepted rules to apply

brain.remember("Stripe webhook requires idempotency key", ["billing", "stripe"])
# Install the brain CLI (ships with AgentBrain)
# ~/.local/bin/brain

# Load context at session start
brain context "payment processing billing"

# Push an episode during the session
brain push "Stripe webhook needs idempotency key — causes duplicate charges without it" "billing,stripe"

# Search all memory layers
brain search "billing webhook"

# List all accepted lessons
brain lessons

# End-of-session summary
brain summary "SESSION: Fixed Stripe webhook handler. Added idempotency key. Next: test with live events." "billing,session"