Engram Architecture

Engram implements a Brain + Spine architecture pattern, separating cognitive reasoning (Brain) from durable execution (Spine), with a persistent memory layer providing long-term knowledge storage.

Engram Platform Architecture

Core Principles

1. Context Engineering over Prompt Engineering

Traditional prompt engineering focuses on crafting individual prompts. Context Engineering takes a holistic view:

Aspect Prompt Engineering Context Engineering
Focus Single prompt Full context lifecycle
State Stateless Stateful across sessions
Memory Limited context window Unlimited via external memory
Security Ad-hoc Built into context schema

2. Brain + Spine Separation

Component Brain (LangGraph) Spine (Temporal)
Purpose Reasoning & decisions Durable execution
Lifecycle Stateless functions Long-running workflows
Failure Retry at LLM level Workflow-level recovery
Scale Horizontal (replicas) Workflow distribution

Architecture Components

🧠 Brain + Spine Pattern

📋 4-Layer Context Schema

🔐 Authentication & Security

Architecture Highlights

Temporal Workflow Execution

Temporal Workflow

Layer 1: Security Context

SecurityContext is the foundation of enterprise security:

  • Identity: user_id, tenant_id, email, display_name
  • Permissions: roles, scopes
  • Enterprise Boundaries: Tenant isolation, project scoping, RBAC

See: Security Context Architecture

Layer 2: Episodic State

Short-term working memory:

  • Rolling window of recent turns
  • Compressed narrative of history
  • Prevents “Lost in the Middle” problem

Layer 3: Semantic Knowledge

Long-term memory pointers:

  • Facts from knowledge graph
  • Entity context and relationships
  • Relevance scoring

Layer 4: Operational State

Workflow & execution state:

  • Temporal workflow IDs
  • Plan steps and tool state
  • Human-in-the-loop support
  • Cost tracking

Next: Learn about Agent Personas or explore Features.


Table of contents