Context and Memory

How RA-H automatically provides context to AI agents

One-liner: RA-H automatically gives agents your 10 most-connected nodes as background context, plus Agent mode has persistent memory across sessions.

How It Works

When you chat with RA-H, the AI doesn't start from scratch. It automatically receives:

  1. Base context - Understanding of nodes, edges, dimensions, and tools
  2. Auto-context - Your 10 most-connected knowledge hubs
  3. Focused node - Whatever you're currently looking at
  4. Agent memory - (Agent mode only) Persistent memory from past sessions

Auto-Context System

What It Does

Auto-context provides your top 10 most-connected nodes as background awareness to every conversation. These are your knowledge hubs—nodes with the most edge connections to other content.

Why Connections Matter

Nodes with many edges are typically:

  • Core concepts that relate to many things
  • Active projects you've linked extensively
  • Important frameworks that inform your thinking
  • Key people or resources referenced across your work

By using edge count, RA-H automatically surfaces what's actually important in your graph without you having to curate anything.

What Agents See

=== BACKGROUND CONTEXT ===
Top 10 most-connected nodes (important knowledge hubs)

[NODE:123:"Your Core Project"] (edges: 47)
[NODE:456:"Key Framework"] (edges: 32)
[NODE:789:"Important Concept"] (edges: 28)
...

Agents see just the ID and title—enough to know what's important. If they need more detail, they use queryNodes or getNodesById to retrieve full content.

Toggle Auto-Context

You can enable/disable auto-context in Settings → Context.

When enabled (default), every conversation includes your top connected nodes automatically.

Agent Memory (Agent Mode Only)

Agent mode maintains persistent memory across sessions in a local file:

Location: ~/Library/Application Support/RA-H/agent-memory.md

What Gets Remembered

The agent decides what's worth remembering, typically:

  • Your preferences and working patterns
  • Project context and goals
  • Important findings and insights
  • Key decisions and their rationale

Memory Tools

ToolPurpose
readMemoryRead current memory contents
updateMemoryAppend new information to memory

Viewing Memory

Open Settings → Memory to view the current contents of your agent's memory.

Context Flow

┌─────────────────────────────────────────────────┐
│                  Your Message                   │
└──────────────────────┬──────────────────────────┘
┌─────────────────────────────────────────────────┐
│              Context Assembly                    │
│  ┌─────────────┐  ┌─────────────┐  ┌──────────┐ │
│  │Base Context │  │Auto-Context │  │ Focused  │ │
│  │(how RA-H    │  │(top 10 by   │  │  Node    │ │
│  │  works)     │  │edge count)  │  │          │ │
│  └─────────────┘  └─────────────┘  └──────────┘ │
│                    ┌──────────────┐              │
│                    │Agent Memory  │ (Agent only) │
│                    └──────────────┘              │
└──────────────────────┬──────────────────────────┘
┌─────────────────────────────────────────────────┐
│                  AI Agent                        │
│  Has context + can use tools for more detail    │
└─────────────────────────────────────────────────┘

Growing Your Context Automatically

The beauty of auto-context is that as you use RA-H, your context naturally improves:

  1. Create nodes about important concepts
  2. Create edges connecting related ideas
  3. The most-connected nodes automatically surface as context

There's nothing to configure or maintain. The nodes that matter most naturally rise to the top.

Privacy

Everything is local. Context assembly happens entirely on your machine. Your nodes, edges, memory, and conversation history never leave your device unless you explicitly share them.