# Hindsight Config Options (from source: plugins/memory/hindsight/__init__.py)

All keys go in `~/.hermes/hindsight/config.json`.

## Core Settings

| Key | Default | Description |
|---|---|---|
| `mode` | `"local_embedded"` | Deployment mode. `local_embedded` = daemon on localhost. |
| `bank_id` | `"hermes"` | Memory bank identifier. |
| `recall_budget` | `"mid"` | Results budget: `low`, `mid`, `high`. Controls how many memories are retrieved per recall. |
| `auto_retain` | `true` | Automatically retain conversation turns after each turn via `sync_turn()`. |
| `auto_recall` | `true` | Automatically recall memories before each turn via `queue_prefetch()`. |
| `memory_mode` | `"hybrid"` | Memory retrieval mode. |
| `retain_every_n_turns` | `1` | Retain every Nth turn. Increase to reduce storage volume and duplication. |
| `recall_prefetch_method` | `"recall"` | Auto-prefetch method: `"recall"` (fast, ranked) or `"reflect"` (slow, synthesis). Stick with `recall` for per-turn use. |

## LLM/Embeddings Provider

| Key | Description |
|---|---|
| `llm_provider` | Provider type: `"openai_compatible"` for noris/other OpenAI-API-compatible endpoints. |
| `llm_base_url` | Base URL for LLM (fact extraction). E.g. `https://ai.noris.de/v1`. |
| `llm_model` | LLM model for fact extraction. Must be a TEXT GENERATION model, not an embedding model. |

Embeddings are configured via environment variables in `~/.hindsight/profiles/hermes.env`, not in config.json.

## Environment Variables (~/.hindsight/profiles/hermes.env)

| Variable | Description |
|---|---|
| `HINDSIGHT_API_LLM_PROVIDER` | LLM provider (`openai`). |
| `HINDSIGHT_API_LLM_API_KEY` | API key for LLM. |
| `HINDSIGHT_API_LLM_MODEL` | LLM model name. |
| `HINDSIGHT_API_LLM_BASE_URL` | LLM base URL. |
| `HINDSIGHT_API_LLM_TIMEOUT` | LLM request timeout in seconds (recommend 60). |
| `HINDSIGHT_API_EMBEDDINGS_PROVIDER` | Embeddings provider (`openai`). |
| `HINDSIGHT_API_EMBEDDINGS_OPENAI_BASE_URL` | Embeddings base URL. |
| `HINDSIGHT_API_EMBEDDINGS_OPENAI_MODEL` | Embeddings model name. |
| `HINDSIGHT_API_EMBEDDINGS_OPENAI_API_KEY` | Embeddings API key. |
| `HINDSIGHT_API_LOG_LEVEL` | Log level (`info`, `debug`). |

## Advanced Config Keys (from provider_config schema)

| Key | Description |
|---|---|
| `bank_retain_mission` | Custom extraction prompt for memory retention. Override the default fact-extraction prompt. |
| `recall_max_tokens` | Max tokens for recalled context (default: 4096). |
| `recall_max_input_chars` | Max input chars for recall query (default: 800). |
| `recall_types` | Filter recall by memory types. |
| `recall_tags` | Filter recall by tags. |
| `recall_tags_match` | Tag matching mode (`any`/`all`). |
| `recall_prompt_preamble` | Prepended text to recall queries. |
| `retain_tags` | Tags attached to retained memories. |
| `retain_source` | Source metadata for retained memories. |
| `retain_user_prefix` | Label for user turns in retained transcripts (default: `"User"`). |
| `retain_assistant_prefix` | Label for assistant turns (default: `"Assistant"`). |
| `retain_context` | Context description for retention (default: `"conversation between Hermes Agent and the User"`). |

## Known Issues

- **OpenAI SDK <2.44.0** — Parsing fails with noris API responses containing `extra_fields`. Upgrade in BOTH hermes venv AND UV cache.
- **Embedding model as LLM** — Setting `llm_model` to an embedding model (e.g. `embeddinggemma-300M`) silently breaks fact extraction. Must use a text generation model.
- **Multiple daemon instances** — Zombie processes from failed restarts can hold port 9177. Kill all before starting fresh: `pkill -f hindsight`.
