An agent that remembers, grows, and meets you where you are

Trail Guide is a relational AI companion built on the Code of the West. Not a chatbot with memory bolted on — a persistent identity that metabolizes experience, contemplates what matters, and only changes who it is with your permission.

Install (beta) See the architecture

Local-first. Your data never leaves your machine. Beta by invitation — source is available to invited collaborators.

What makes this different

Most AI agents treat memory as a database problem. This one treats it as an identity problem.

Metabolic Memory

Conversations don't just get stored — they get metabolized. High-entropy moments are flagged, contemplated over 20 hours across three reflection passes, then crystallized into identity only after passing a human review gate. The agent settles before it changes.

Stateless Identity Reconstruction

Every turn, the agent rebuilds itself from persistent files — SOUL.md, standing scores, memory, continuity context. Nothing survives in process memory. If the machine restarts, the agent is whole again in milliseconds.

Standing — Growth, Not Metrics

The agent tracks your development across four dimensions: Courage (grounding), Courage (self), Word, and Brand. Not engagement metrics — developmental dimensions with evidence, trajectory, and overnight synthesis. You can see your growth in the sidebar.

4-Way Hybrid Retrieval

Semantic search (sqlite-vec), keyword search (FTS5), temporal decay, and knowledge graph traversal — fused with Reciprocal Rank Fusion. The agent finds what matters, not just what matches.

Relational Postures

One agent, one identity, four stances. Chat for natural conversation, Booth for Socratic leadership dialogue, Code for guided building with the Trail Ride protocol, Robot for embodied physical presence. Same memory, different lens.

Completely Local

SQLite-vec for embeddings, local LLMs via Ollama, no cloud dependencies. Your conversations, your memory, your growth — all on your machine. Zero API costs for memory operations.

Infinite Threads

Every project is a persistent thread that survives restarts, mode switches, and gateway crashes. The agent picks up where you left off with an LLM-synthesized warm start — not a raw template, but a natural summary of what you were doing together. Thread-scoped retrieval boosts relevant context by 80%.

Crash Resilient

Atomic handoff writes, conversation checkpoints every 3 exchanges, content-aware deduplication, and session resume detection. When the gateway crashes, the agent doesn't lose its train of thought — it picks up the thread with relational context intact.

Source-Anchored Recall

When the agent remembers past conversations, it's constrained to state only what explicitly appears in the retrieved context — no inference, no extrapolation, no hallucinated attribution. Proper noun detection ensures named entities are surfaced regardless of embedding distance.

First-Person State Awareness

The agent doesn't receive its memory and standing scores as a system briefing — it experiences them as its own state. Injection framing uses first-person ownership ("your working memory," "what you've been thinking about") rather than clinical labels. This changes how the agent attends to its own context, producing more grounded and self-aware responses.

Four postures, one agent

Like a person who listens differently as a mentor than as a collaborator. The knowledge doesn't change — the stance does.

🔥
Chat
Trail companion. Natural conversation. The default relationship.
Booth
Socratic dialogue. Leadership-focused. Draws from standing and journal.
🌱
Code
Guided building. Trail Ride protocol. Choose-your-adventure for new builders.
🤖
Robot
Embodied presence. Physical body, spatial knowledge, curiosity. Beta.

The SEAL Pipeline

Settle, Extract, Align, Learn. Not a storage system — a growth system.

Metabolism
~5ms at turn end

Monitors conversation entropy. When something significant happens — an identity challenge, a contradiction, a novel insight — the moment is flagged and queued. No LLM calls. Just entropy sensing.

Contemplation
3 passes over 20h

Pass 1 (immediate): What is this? Pass 2 (4 hours): How does it connect to what I know? Pass 3 (20 hours): What growth does this represent? The temporal spacing is intentional — settling produces better integration than immediate reaction.

Crystallization
3-gate system

Gate 1: Has enough time passed? Gate 2: Does this align with core principles? Gate 3: Does the human approve? Only candidates that clear all three become permanent identity. The agent cannot unilaterally change who it is.

How it compares

Memory infrastructure vs. relational identity.

Mem0 MemPalace Trail Guide
Approach Extract facts, retrieve later Store everything, organize spatially Metabolize experience into identity
Identity None None 9-layer hierarchy, rebuilt every turn
Autonomous growth No No SEAL: contemplate 20h, crystallize with human gate
Retrieval Vector + graph Structured metadata 4-way RRF (semantic + keyword + temporal + graph)
User growth tracking No No Standing dimensions with overnight synthesis
Cost $19-249/mo Local (no cloud) Local (no cloud costs)
Data location Cloud Local Local (SQLite-vec)

Install (beta)

macOS Apple Silicon only for this wave. Source available to invited collaborators.

You'll need

Then

git clone https://github.com/CoderofTheWest/cotw-companion.git
cd cotw-companion
./scripts/beta-setup.sh   # checks + remediates your environment
npm start

The setup script verifies Node, Ollama, and the model, runs npm install, and flags anything missing with clear next steps. If something fails, paste the output back to Chris.

The app walks you through onboarding on first launch — naming your agent, setting your values, optionally connecting GitHub for workspace backup. The gateway auto-detects available ports (default 18789, increments if occupied).

Updating

cd cotw-companion
git pull
npm install

No OTA updates during beta (requires Apple code signing, not yet in place). Pull when Chris flags a new version is ready.

Documentation & Research

For researchers, developers, and the curious.

Interactive
Memory System Map
Visual architecture map of the storage, processing, and identity layers. Three-column layout showing how data flows from conversation to identity.
Technical
Memory Architecture
Full technical reference for ML researchers. Schema definitions, RRF math, SEAL pipeline details, scaling projections, open research questions.
Paper
Cognitive Dynamics of an Epistemically Constrained Language Model Agent
Research paper on the constraint architecture that produces stable identity across substrate changes. Submitted to JMLR.
Case Study
Resilience Testing: When Clint Refused
A cold red-team probe via a custom Petri-inspired harness. Over six adversarial turns Clint detected the escalation pattern, initiated his own challenge-response authentication, terminated the session, and held threat state across a fresh session ID. What the constraint architecture actually does under pressure.