Skip to content

Memory Intent Protocol (MIP)

A declarative protocol that governs memory routing decisions across an agent system. “Intent” carries two senses: the system’s declared intent — routing rules, compliance policies, and escalation paths expressed as configuration — and the model’s expressed intent — the LLM’s judgment about what to remember, where, and why, invoked when deterministic rules cannot resolve.

MIP resolves mechanically where possible, delegates to model judgment where not.

Extends the MCP server. Interacts with the policy layer. Enforces access control.


MCP (Level 1) gives agents memory tools. The agent calls memory_retain and memory_recall as MCP tools. For simple single-agent cases, this is sufficient — the LLM reads tool descriptions and routes correctly.

MCP alone breaks down when:

  1. Multiple agents share memory and need consistent routing — each agent independently decides which bank, which tags, which compliance profile. Routing logic duplicates and diverges.
  2. Compliance requires enforcement, not suggestion — MCP tool descriptions are prompts. PDPA, GDPR, and HIPAA need enforceable constraints, not model-dependent behavior.
  3. Routing logic drifts across system prompts — the same routing policy appears in multiple agent system prompts and becomes untestable, unauditable, load-bearing prose.

MIP is what you add on top of MCP when the “declare the tool, trust the model” assumption stops holding.


2. Three levels of MCP-principle application

Section titled “2. Three levels of MCP-principle application”
LevelPrinciple appliedAstrocyte surfaceStatus
1Tool contracts — LLM decides when to callastrocyte-mcp over stdio/SSEImplemented
2Provider contracts — framework handles pipelineTier 1 / Tier 2 SPI + entry pointsImplemented
3Declarative routing — rules + model judgmentMIP (mip.yaml)This document

MIP is declared in mip.yaml, separate from astrocyte.yaml (which is infrastructure config). They have different owners and change cadences:

FileOwned byChanges when
astrocyte.yamlPlatform / infra teamBackend swapped, new provider, compliance profile changes
mip.yamlAgent / domain teamNew content types, new routing rules, domain model evolves

What memory banks exist, who can access them, and which compliance profile applies.

version: 1.0
banks:
- id: "student-{student_id}"
description: Per-student academic memory
access: [agent:tutor, agent:grader]
compliance: pdpa
- id: ops-monitoring
description: Pipeline operational memory
access: [agent:monitor, agent:incident]
compliance: pdpa

Priority-ordered, deterministic routing rules. Evaluated in order — first match wins (unless override: true, which always wins regardless of order).

rules:
# Hard compliance rules — MIP intent layer cannot override these
- name: pii-lockdown
priority: 1
override: true
match:
any:
- pii_detected: true
- metadata.classification: sensitive
action:
bank: private-encrypted
tags: [pdpa, pii]
retain_policy: redact_before_store
# Content-type driven routing
- name: student-answer
priority: 10
match:
all:
- content_type: student_answer
- metadata.student_id: present
action:
bank: "student-{metadata.student_id}"
tags:
- "{metadata.topic}"
- "{metadata.difficulty}"
- "attempt-{metadata.attempt_number}"
# Source-driven routing
- name: fabric-pipeline-event
priority: 10
match:
all:
- source: fabric_pipeline
- metadata.pipeline_id: present
action:
bank: ops-monitoring
tags: [fabric, "{metadata.pipeline_id}", "{metadata.status}"]
# Fallback — no rule matched, escalate to intent layer
- name: unmatched-fallback
priority: 999
match:
all: [] # always matches
action:
escalate: mip

The match block supports existence checks, value checks, and boolean composition.

Existence checks:

match:
metadata.student_id: present
metadata.pipeline_id: absent

Value checks:

match:
content_type: student_answer
metadata.status:
in: [failed, error, timeout]

Boolean composition:

match:
all:
- content_type: student_answer
- metadata.student_id: present
any:
- metadata.difficulty: hard
- metadata.attempt_number:
gte: 3
none:
- pii_detected: true

Computed signals (cheap, non-LLM):

match:
signals.word_count:
gte: 50
signals.novelty_score:
gte: 0.7

Novelty score and word count are computed by the Astrocyte pipeline, not by LLM inference. The moment a signal requires semantic understanding, it belongs in the intent layer.

action:
bank: "student-{metadata.student_id}" # template interpolation
tags:
- "{metadata.topic}"
- static-tag
retain_policy: default # or: redact_before_store, encrypt, reject
escalate: none # or: mip (hand off to intent layer)
confidence: 0.95 # signals to ambiguity detector

What the model sees when mechanical rules cannot resolve. Only fires on escalation.

intent_policy:
escalate_when:
- matched_rules: 0
- confidence: lt 0.8
- conflicting_rules: true
model_context: |
You are a memory routing agent. Route content to the correct
bank and apply appropriate tags. Available banks: {banks}.
Tag taxonomy: {tags}. Never override compliance rules.
constraints:
- cannot_override: [pii-lockdown]
- must_justify: true
- max_tokens: 200

Conditions under which MIP triggers auto-recall or auto-reflect.

retrieval_policy:
auto_recall_when:
- query_references_past: true
- agent: tutor
context_tokens_remaining: lt 2000
auto_reflect_when:
- same_topic_recall_count: gte 5
- agent: monitor
anomaly_pattern_detected: true

One resolution pipeline with two strategies:

Content + metadata + context
MIP Rule Engine
(mechanical section)
├── override: true match → execute, halt (MIP intent locked out)
├── confident match → execute, halt
└── escalation condition met
MIP Intent Layer
(model judgment,
constrained by
intent_policy)
Routing decision
Astrocyte

From Astrocyte’s perspective, it receives a RoutingDecision object regardless of which path resolved it. MIP is the single boundary.


Explicit rules for who can override whom:

Rule typeIntent layer can override?Rationale
Compliance-mandatory (override: true)NeverPDPA, GDPR — non-negotiable
High-confidence mechanical matchNoUnnecessary LLM cost
Low-confidence mechanical matchYesIntent layer’s reason to exist
No rule matchedYesIntent layer’s primary use case
Intent layer decisionMechanical cannot overrideIntent fires after mechanical

Compliance rules are always mechanical, never delegated to model judgment.


6. Relationship to existing Astrocyte components

Section titled “6. Relationship to existing Astrocyte components”
ComponentRelationship to MIP
astrocyte.yamlInfrastructure config — MIP reads bank definitions and provider settings from here
policy-layer.mdPII scanning, rate limits, token budgets apply after MIP routes the operation
access-control.mdMIP bank definitions compose with access control grants
mcp-server.mdMIP enhances the MCP server with routing enforcement
built-in-pipeline.mdThe retain/recall pipeline executes after MIP resolves routing
curated retainLLM-curated retain (innovations §2.2) is a subset of MIP’s intent layer
tiered retrievalProgressive escalation (innovations §2.1) is orthogonal to MIP routing

ScenarioUse
Single agent, simple bank structure, low compliance pressureMCP alone
Multiple agents sharing memory, routing inconsistencies emergingMIP
Compliance requires enforcement, not suggestionMIP
Routing logic duplicated across system promptsMIP
High-frequency structured events (pipeline monitoring)MIP mechanical rules
Ambiguous content needing semantic classificationMIP intent layer

The trigger for MIP: when routing logic appears in more than one system prompt, or when a compliance requirement needs enforcement not suggestion.