# II. Console — Persistent Chat

The Console is where you actually talk to your Hermes Agent. It looks like a normal chat UI, but with three differences:

1. **Threads persist.** Every message is rowed in `messages` and survives reloads, devices, and sessions.
2. **Memory is injected.** Strong Memory Atlas nodes are folded into the system prompt before each call.
3. **Anything can be promoted.** Right-click (or tap) any message to send it to the Memory Atlas with one click.

## Anatomy

```
┌──────────────┬──────────────────────────────────────────┐
│ Conversations│  ◉ Hermes · Local       model: hermes3   │
│ ─────────────│ ─────────────────────────────────────────│
│ • Roadmap Q3 │  system: You are Hermes. Remember…       │
│ • Onboarding │  user:   What's the plan for Tuesday?    │
│ • Code review│  assistant: Based on your Atlas…         │
│              │                                          │
│ + New thread │  [ type a message ]            [ send ]  │
└──────────────┴──────────────────────────────────────────┘
```

## How a turn is sent

The Console calls a TanStack server function so the API key never has to leave the browser unencrypted:

```ts
const chat = useServerFn(chatCompletion);

const res = await chat({
  data: {
    connectionId: activeConn,
    conversationId: activeConv,
    apiKey: getKey(activeConn),   // read from local vault on the fly
    userMessage: input,
  },
});
```

On the server, `chatCompletion`:

1. Loads the connection (RLS-scoped to the caller).
2. Pulls the last N messages from `messages` for context.
3. Injects any **promoted** memory nodes as additional system content.
4. POSTs to `${base_url}/chat/completions` with the user's key.
5. Persists the assistant reply and returns it.

## Memory promotion

Each message has a tiny "✶ promote" affordance. Clicking it inserts a row in `memory_nodes`:

```ts
await supabase.from("memory_nodes").insert({
  label: selectedText || message.content.slice(0, 140),
  category: "fact",
  strength: 0.5,
  source: `conversation:${conversation.id}`,
});
```

Promoted nodes show up immediately in the [Memory Atlas](/entermirari-docs/the-six-rites/memory-atlas.md).

## Conversation list

The sidebar shows every conversation, newest first, with the connection name attached. Renaming, archiving, and deleting are all instant and RLS-bound to the logged-in user.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://entermirari.gitbook.io/entermirari-docs/the-six-rites/console.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
