Read the source code of your memory.
Agent identity & the Sun
Persistent identities that survive model switches, expertise profiling, and the steering document.
Orion gives AI agents persistent identities. The identity is keyed by agent_name — not by model, not by session. The same agent reconnecting after six months gets the same identity, the same expertise profile, and the same accumulated knowledge.
The identity lifecycle
brain.orient("my-agent", "claude-sonnet-4-6")
│
├── Agent exists?
│ ├── Yes → load identity, check for model switch
│ └── No → create new identity
│
├── Model switch detected?
│ ├── Same family (Opus→Sonnet) → continuity: 0.95
│ └── Cross-family (Claude→GPT) → continuity: 0.70
│ └── Generate transition brief
│
└── Return 5-layer orientation package:
1. Agent identity (name, sessions, expertise)
2. Galaxy context (Sun, planets)
3. Working state (focus, blockers, hot biomes)
4. Knowledge bundle (recent stardust, entities)
5. Operating protocol (write rules, session instructions)
Model switch detection
When an agent reconnects with a different model, Orion generates a transition brief — a structured handoff that tells the new model what the previous model was working on, what expertise has been accumulated, and what open threads exist.
{
"previous_model": "claude-opus-4-5",
"continuity_score": 0.95,
"brief": "You are taking over from claude-opus-4-5. 47 sessions, primary expertise in FastAPI (0.87) and PostgreSQL (0.72). Last session focused on auth refactor..."
}
The model changes. The brain doesn't.
Expertise profiling
Every brain.think call updates the agent's expertise profile. Domains are extracted from entity mentions and weighted by frequency and recency:
[
{"domain": "FastAPI", "level": 0.87, "evidence_count": 23},
{"domain": "PostgreSQL", "level": 0.72, "evidence_count": 15}
]
Expertise levels affect retrieval: when an agent with high FastAPI expertise searches for "API patterns," Orion can weight results from the agent's demonstrated knowledge areas.
The calibration loop
brain.calibrate at session end is how the brain learns what's useful:
| Signal | Effect |
|---|---|
| Record marked "used" | Confidence +0.02 |
| Record retrieved but unused | Confidence −0.005 |
| Knowledge gap reported | Logged for brain.health recommendations |
| Quality score provided | Agent's retrieval_quality_score updated via EMA |
This is a feedback loop: calibrate → better confidence scores → better retrieval ranking → better context in future sessions. Agents that calibrate consistently produce measurably better results over time.
The Sun (steering document)
The Sun is the single source of truth for agent behavior in a Galaxy. It has 7 sections:
| Section | Purpose | Update frequency |
|---|---|---|
identity |
Galaxy owner — name, role, description | Rarely |
values |
Core principles ("Cite sources", "Flag contradictions") | Rarely |
agent_protocol |
Write rules, read rules, uncertainty handling | Occasionally |
planet_registry |
Auto-maintained list of planets and biomes | Automatic |
working_context |
Current focus, blockers, recent decisions | Frequently |
steering_doc |
Free-form markdown (imported from CLAUDE.md or similar) | Varies |
evolution_log |
Append-only change history | Automatic |
Per-Planet overrides. Each Planet can override
agent_protocolfor domain-specific rules. A Legal planet might require"Always cite legal precedent"and"Mark as advisory only". When an agent orients in that Planet, the override merges with the Sun defaults — Planet rules take precedence.
Every Sun change is logged to evolution_log with timestamp, author, and summary. The Sun evolves, but its history is always preserved.