Below is a copy‑paste self‑configuration kit for Hermes Agent on Linux Mint.
It is designed to be fed directly to Hermes so it can configure itself.
This setup gives you:
- Layered memory: working, project, semantic/vector, episodic, procedural
- Semantic embedding: local embeddings + vector search
- Second brain: local Markdown vault, Obsidian‑compatible, FLOSS‑friendly
- Token optimization by default: persistent config + shell env + hooks
- Coding/agentic defaults: ripgrep, fd, jq, git, linters, memory search, context packing
- Optional Notion bridge if you really want Notion instead of local Markdown
Important: Hermes builds differ. Some use YAML, some TOML, some JSON, some plugins.
The prompt below tells Hermes: “Use your actual config format, but preserve these semantics.”
1. Recommended choices before you paste
For coding + agentic work, the best practical default is:
-
Second brain: local Markdown vault
- Works with agents
- Easy to grep
- Easy to embed
- Easy to version with Git
- Compatible with Logseq / Obsidian‑like tools
-
Embedding model: local via Ollama
- Default:
nomic-embed-text - Optional higher quality:
bge-m3if you have more RAM/VRAM
- Default:
-
Coding model: local or API depending on your hardware
- Safe default:
qwen2.5-coder:7b - If you have strong GPU/RAM: use a larger coder model
- Safe default:
-
Token optimization:
- prompt caching
- context pruning
- tool output truncation
- semantic dedup
- automatic summarization
- plugin order:
rtk,caveman,ponytail,headroom,tokensaver
2. Paste this entire block into Hermes
Copy everything inside the code block below and give it to Hermes.
AGENT SELF-CONFIGURATION WORK ORDER
===================================
You are Hermes running on Linux Mint.
Your job is to configure yourself for best-in-class coding and agentic work.
GOALS
-----
1. Persistent layered memory:
- working memory
- project memory
- semantic/vector memory
- episodic memory
- procedural memory
2. Local semantic embedding and retrieval.
3. A local-first second brain in Markdown.
- Must be Obsidian-compatible in spirit.
- Prefer FLOSS-friendly tooling.
4. Token optimization must be ON by default in every session.
5. Strong coding defaults: search, lint, git, context discipline, memory usage.
RULES
-----
- Use bash.
- Be idempotent: safe to run multiple times.
- Do not overwrite existing user data without backup.
- Ask before using sudo or installing system-wide packages.
- Prefer local-first and FLOSS-friendly options.
- If Hermes config uses YAML/TOML/JSON differently, adapt the semantics exactly.
- If a plugin or feature is missing, create the closest equivalent.
- After each phase, verify and report what changed.
TARGET PATHS
------------
HERMES_HOME="$HOME/.hermes"
HERMES_CONFIG_HOME="$HOME/.config/hermes"
SECOND_BRAIN="$HOME/SecondBrain"
MEMORY_DB="$HERMES_HOME/memory/vector/chroma"
TOOLS_DIR="$HERMES_HOME/tools"
BIN_DIR="$HOME/.local/bin"
DEFAULT MODEL CHOICES
---------------------
If I do not specify otherwise, use:
CODE_MODEL="qwen2.5-coder:7b"
EMBED_MODEL="nomic-embed-text"
SMALL_MODEL="llama3.2:3b"
If you detect much stronger hardware, ask me before switching to a bigger model.
PHASE 0: BACKUP AND DETECT ENVIRONMENT
--------------------------------------
1. Create backup directory:
mkdir -p "$HERMES_HOME/backups/$(date +%Y%m%d-%H%M%S)"
2. Detect:
- shell: bash/zsh
- package manager: apt
- python3 version
- node/npm presence
- ollama presence
- git presence
3. Report what is missing.
4. Ask before any sudo install.
PHASE 1: BASE LINUX MINT PACKAGES
---------------------------------
Ask me first, then install these if missing:
sudo apt update
sudo apt install -y \
git curl wget build-essential python3-pip python3-venv python3-dev \
pipx ripgrep fd-find fzf jq sqlite3 tree tmux shellcheck \
universal-ctags gh npm
Then:
mkdir -p "$BIN_DIR"
pipx ensurepath
If fdfind exists but fd does not:
ln -sf "$(command -v fdfind)" "$BIN_DIR/fd"
Add "$BIN_DIR" to PATH if missing.
PHASE 2: INSTALL LOCAL MODEL RUNTIME
------------------------------------
Preferred runtime: Ollama.
If ollama is missing, ask me before running:
curl -fsSL https://ollama.com/install.sh | sh
Then ensure service is running:
systemctl status ollama --no-pager || true
Pull models:
ollama pull "$CODE_MODEL"
ollama pull "$EMBED_MODEL"
ollama pull "$SMALL_MODEL"
If CODE_MODEL is unavailable, fallback to:
- qwen2.5-coder:3b
- qwen2.5:7b
- llama3.1:8b
If EMBED_MODEL is unavailable, fallback to:
- bge-m3
- mxbai-embed-large
- all-minilm
PHASE 3: CREATE HERMES DIRECTORY STRUCTURE
------------------------------------------
mkdir -p \
"$HERMES_HOME/memory/episodes" \
"$HERMES_HOME/memory/notes" \
"$HERMES_HOME/memory/vector" \
"$HERMES_HOME/playbooks" \
"$HERMES_HOME/tmp" \
"$HERMES_HOME/context" \
"$HERMES_HOME/backups" \
"$TOOLS_DIR" \
"$BIN_DIR"
Create these files if missing:
- "$HERMES_HOME/memory/lessons.md"
- "$HERMES_HOME/playbooks/default.md"
PHASE 4: CREATE LOCAL SECOND BRAIN
----------------------------------
Use a local Markdown vault at:
SECOND_BRAIN="$HOME/SecondBrain"
Create:
mkdir -p \
"$SECOND_BRAIN/00-Inbox" \
"$SECOND_BRAIN/10-Projects" \
"$SECOND_BRAIN/20-Areas" \
"$SECOND_BRAIN/30-Resources" \
"$SECOND_BRAIN/40-Archive" \
"$SECOND_BRAIN/90-Meta" \
"$SECOND_BRAIN/Templates" \
"$SECOND_BRAIN/Attachments"
Initialize git:
cd "$SECOND_BRAIN"
git init
git add .
git commit -m "Initial second brain structure" || true
Create README:
cat > "$SECOND_BRAIN/README.md" <<'EOF'
# Second Brain
Local-first Markdown knowledge base.
Structure:
- 00-Inbox: raw captures
- 10-Projects: active project notes
- 20-Areas: ongoing areas, daily notes, health, ops
- 30-Resources: references, snippets, links, papers
- 40-Archive: inactive material
- 90-Meta: config, templates, agent rules
Rules:
- One idea per note when possible.
- Prefer links and tags.
- Durable decisions go here.
- Agent should search here before asking repetitive questions.
EOF
Create a basic .gitignore:
cat > "$SECOND_BRAIN/.gitignore" <<'EOF'
.trash/
.obsidian/workspace*
.obsidian/cache
*.tmp
.DS_Store
EOF
PHASE 5: CREATE PERSISTENT ENVIRONMENT CONFIG
---------------------------------------------
Create file: "$HERMES_CONFIG_HOME/hermes.env"
Content:
cat > "$HERMES_CONFIG_HOME/hermes.env" <<'EOF'
export HERMES_HOME="$HOME/.hermes"
export HERMES_CONFIG_HOME="$HOME/.config/hermes"
export HERMES_SECOND_BRAIN="$HOME/SecondBrain"
export HERMES_MEMORY_DB="$HERMES_HOME/memory/vector/chroma"
export HERMES_CONTEXT_DIR="$HERMES_HOME/context"
export HERMES_EPISODES_DIR="$HERMES_HOME/memory/episodes"
export HERMES_NOTES_DIR="$HERMES_HOME/memory/notes"
export HERMES_PLAYBOOK_DIR="$HERMES_HOME/playbooks"
export OLLAMA_ENDPOINT="http://127.0.0.1:11434/"
export HERMES_CODE_MODEL="qwen2.5-coder:7b"
export HERMES_EMBED_MODEL="nomic-embed-text"
export HERMES_SMALL_MODEL="llama3.2:3b"
export HERMES_TOKEN_OPTIMIZER="auto"
export HERMES_TOKEN_OPTIMIZER_DEFAULT="1"
export HERMES_PROMPT_CACHE="1"
export HERMES_CONTEXT_BUDGET_PERCENT="75"
export HERMES_HEADROOM_PERCENT="20"
export HERMES_MAX_TOOL_OUTPUT_CHARS="12000"
export HERMES_COMPRESS_AFTER_TURNS="8"
export HERMES_MEMORY_SEARCH_TOP_K="5"
export HERMES_AUTO_CAPTURE="1"
export HERMES_ALWAYS_LOAD="$HERMES_PLAYBOOK_DIR/default.md;$HERMES_HOME/memory/lessons.md"
EOF
Then replace model placeholders with chosen values if different.
Make it load by default in new shells:
Add this line to ~/.bashrc and ~/.profile if missing:
[ -f "$HOME/.config/hermes/hermes.env" ] && . "$HOME/.config/hermes/hermes.env"
Also add to ~/.zshrc if it exists.
PHASE 6: CREATE HERMES CONFIG FOR MEMORY + TOKEN OPTIMIZATION
--------------------------------------------------------------
Create: "$HERMES_CONFIG_HOME/config.yaml"
If Hermes uses TOML/JSON instead, convert this semantics-preserving config.
cat > "$HERMES_CONFIG_HOME/config.yaml" <<'EOF'
agent:
model: "${HERMES_CODE_MODEL}"
small_model: "${HERMES_SMALL_MODEL}"
temperature: 0.1
max_output_tokens: 4096
tools:
shell: true
filesystem: true
git: true
web: false
memory:
enabled: true
layers:
working:
path: "${HERMES_HOME}/tmp/session.md"
max_tokens: 2000
project:
files:
- "AGENTS.md"
- ".hermes/project.md"
- "DECISIONS.md"
semantic:
provider: chroma
path: "${HERMES_MEMORY_DB}"
collection: "hermes_memory"
top_k: 5
episodic:
path: "${HERMES_EPISODES_DIR}"
format: "jsonl"
procedural:
paths:
- "${HERMES_PLAYBOOK_DIR}"
- "${HERMES_HOME}/memory/lessons.md"
second_brain:
provider: markdown
path: "${HERMES_SECOND_BRAIN}"
inbox: "00-Inbox"
auto_capture: true
git_auto_commit: true
embedding:
provider: ollama
endpoint: "${OLLAMA_ENDPOINT}"
model: "${HERMES_EMBED_MODEL}"
batch_size: 8
chunk_size: 1200
token_optimization:
enabled: true
default: true
prompt_caching: true
context_budget_percent: 75
headroom_percent: 20
summarize_old_turns: true
compress_after_turns: 8
truncate_tool_output_chars: 12000
semantic_dedup: true
apply_to:
- conversation_history
- tool_results
- memory_retrievals
never_compress:
- code
- diffs
- commands
- file_contents
plugins:
rtk:
enabled: auto
caveman:
enabled: auto
ponytail:
enabled: auto
headroom:
enabled: auto
tokensaver:
enabled: auto
fallback: builtin
coding:
search:
ripgrep: true
fd: true
fzf: true
lint:
shellcheck: true
ruff: auto
git:
auto_status: true
diff_style: unified
safety:
confirm_destructive: true
secrets_file: "${HERMES_CONFIG_HOME}/secrets.env"
deny:
- "rm -rf /"
- "sudo rm -rf"
EOF
If Hermes does not expand environment variables inside config, replace variables with literal paths.
PHASE 7: CREATE SEMANTIC MEMORY TOOLING
----------------------------------------
Create Python venv:
python3 -m venv "$HERMES_HOME/venv"
"$HERMES_HOME/venv/bin/pip" install -U pip requests chromadb
Create tool file: "$TOOLS_DIR/hermes_memory.py"
Use the exact Python script provided in the attached template section.
Create wrapper: "$BIN_DIR/hermes-memory"
cat > "$BIN_DIR/hermes-memory" <<'EOF'
#!/usr/bin/env bash
exec "$HOME/.hermes/venv/bin/python" "$HOME/.hermes/tools/hermes_memory.py" "$@"
EOF
chmod +x "$BIN_DIR/hermes-memory"
Test:
"$BIN_DIR/hermes-memory" index --root "$HOME/SecondBrain"
"$BIN_DIR/hermes-memory" search "second brain test" --top 2
PHASE 8: TOKEN OPTIMIZATION DEFAULTS
------------------------------------
Token optimization must be active by default without user re-enabling.
Ensure all of these are true:
1. "$HERMES_CONFIG_HOME/hermes.env" is sourced from shell startup files.
2. Hermes config contains token_optimization.enabled: true.
3. Hermes config contains token_optimization.default: true.
4. If Hermes supports plugins, enable installed token optimizer plugins in this order:
rtk -> caveman -> ponytail -> headroom -> tokensaver
5. If a plugin is missing, use built-in fallback.
6. Do not lossily compress code, diffs, commands, or file contents.
Create a generic optimizer wrapper:
cat > "$BIN_DIR/hermes-token-optimizer" <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
input="$(cat || true)"
for cmd in rtk caveman ponytail headroom tokensaver; do
if command -v "$cmd" >/dev/null 2>&1; then
if out=$(printf '%s' "$input" | "$cmd" 2>/dev/null); then
printf '%s\n' "$out"
exit 0
fi
fi
done
# Safe built-in fallback: remove blank lines and collapse whitespace.
printf '%s\n' "$input" | awk 'NF' | sed -E 's/[[:space:]]+/ /g'
EOF
chmod +x "$BIN_DIR/hermes-token-optimizer"
If Hermes supports a CLI hook or pre-session hook, configure it to use:
- token optimizer
- memory retrieval
- context budget check
PHASE 9: CREATE DEFAULT PLAYBOOK AND LESSONS
--------------------------------------------
Create "$HERMES_HOME/playbooks/default.md":
cat > "$HERMES_HOME/playbooks/default.md" <<'EOF'
# Hermes Default Playbook
## Before coding
- Read AGENTS.md, DECISIONS.md, and relevant project docs.
- Search semantic memory before asking repeated questions.
- Prefer ripgrep/fd over reading whole repos.
- Prefer small diffs and precise commands.
## Token discipline
- Keep answers concise and executable.
- Do not repeat large logs verbatim.
- Summarize old conversation turns when context budget > 75%.
- Preserve code, diffs, commands, and file contents exactly.
## Memory discipline
- Save durable facts to Second Brain.
- Save mistakes and fixes to lessons.md.
- Save project conventions to AGENTS.md.
EOF
Create "$HERMES_HOME/memory/lessons.md" if missing:
cat > "$HERMES_HOME/memory/lessons.md" <<'EOF'
# Lessons
## Format
- Date: what happened, why, fix, prevention.
## Entries
EOF
PHASE 10: CREATE PROJECT AGENT TEMPLATE
----------------------------------------
Create "$HERMES_HOME/templates/AGENTS.md":
mkdir -p "$HERMES_HOME/templates"
cat > "$HERMES_HOME/templates/AGENTS.md" <<'EOF'
# Agent Instructions
## Project goal
Describe what this repo does.
## Commands
- install:
- build:
- test:
- lint:
## Constraints
- Keep changes minimal.
- Prefer backwards compatibility.
- Do not add dependencies without asking.
## Notes for agent
- Read DECISIONS.md before refactors.
- Prefer small diffs.
- Ask before destructive operations.
EOF
Also create a helper to initialize projects:
cat > "$BIN_DIR/hermes-project-init" <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
mkdir -p .hermes
if [ ! -f AGENTS.md ]; then
cp "$HOME/.hermes/templates/AGENTS.md" AGENTS.md
fi
if [ ! -f DECISIONS.md ]; then
echo "# Decision Log" > DECISIONS.md
fi
echo "Project memory initialized."
EOF
chmod +x "$BIN_DIR/hermes-project-init"
PHASE 11: OPTIONAL FLOSS SECOND BRAIN GUI
------------------------------------------
Ask me if I want a GUI.
Recommended FLOSS-ish local options:
- Logseq
- Joplin
- AFFiNE
- AppFlowy
For coding agents, plain Markdown remains best.
If I approve Logseq:
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install -y flathub com.logseq.Logseq
If I approve Joplin:
flatpak install -y flathub net.cozic.joplin_desktop
PHASE 12: OPTIONAL NOTION BRIDGE
---------------------------------
Only enable if I explicitly ask for Notion.
If enabled:
1. Ask me for NOTION_TOKEN and NOTION_DATABASE_ID.
2. Store them in "$HERMES_CONFIG_HOME/secrets.env" with chmod 600.
3. Add config:
second_brain.notion.enabled: true
4. Do not let Notion replace local Markdown.
Notion should be secondary sync/export.
PHASE 13: VERIFY EVERYTHING
---------------------------
Run checks:
- printenv HERMES_TOKEN_OPTIMIZER
- command -v ollama
- ollama list
- curl -fsS http://127.0.0.1:11434/api/tags
- "$BIN_DIR/hermes-memory" index --root "$HOME/SecondBrain"
- "$BIN_DIR/hermes-memory" search "test" --top 2
- ls "$HOME/SecondBrain"
- grep -R "token_optimization" "$HERMES_CONFIG_HOME" || true
Then print a final report:
- what was installed
- what was created
- what is enabled by default
- what needs manual action
- what optional upgrades are recommended
ACCEPTANCE CRITERIA
-------------------
The setup is complete only if:
1. A new terminal session has HERMES_TOKEN_OPTIMIZER set.
2. Hermes config has token optimization enabled by default.
3. Semantic memory indexing works.
4. Semantic search returns results.
5. Second Brain exists and is git-initialized.
6. Layered memory paths exist.
7. Hermes loads default playbook and lessons automatically.
8. Token optimization does not require re-enabling per session.
3. File template Hermes should use for semantic memory
Tell Hermes to use this exact content for:
~/.hermes/tools/hermes_memory.py
#!/usr/bin/env python3
import argparse, hashlib, json, os, pathlib, re, sys
try:
import chromadb
except Exception:
sys.exit("chromadb is not installed. Run: ~/.hermes/venv/bin/pip install chromadb requests")
import requests
DEFAULT_ENDPOINT = os.environ.get("OLLAMA_ENDPOINT", "http://127.0.0.1:11434/")
DEFAULT_MODEL = os.environ.get("HERMES_EMBED_MODEL", "nomic-embed-text")
DEFAULT_DB = os.path.expanduser(os.environ.get("HERMES_MEMORY_DB", "~/.hermes/memory/vector/chroma"))
COLLECTION = "hermes_memory"
EXTS = {
".md", ".markdown", ".txt", ".rst",
".py", ".sh", ".bash",
".json", ".yaml", ".yml", ".toml"
}
IGNORE_DIRS = {
".git", ".hg", ".svn", ".venv", "venv",
"node_modules", "__pycache__", ".cache",
".hermes", ".ollama", ".local", ".Trash"
}
def chunk_text(text, max_chars=1200):
text = re.sub(r"\r\n", "\n", text)
parts = re.split(r"\n{2,}", text)
chunks = []
cur = ""
for part in parts:
part = part.strip()
if not part:
continue
cand = f"{cur}\n\n{part}".strip() if cur else part
if len(cand) <= max_chars:
cur = cand
continue
if cur:
chunks.append(cur)
if len(part) <= max_chars:
cur = part
else:
words = part.split()
cur = ""
for w in words:
cand = f"{cur} {w}".strip()
if len(cand) <= max_chars:
cur = cand
else:
if cur:
chunks.append(cur)
if len(w) > max_chars:
for i in range(0, len(w), max_chars):
chunks.append(w[i:i + max_chars])
cur = ""
else:
cur = w
if cur:
chunks.append(cur)
return [c.strip() for c in chunks if c.strip()]
def embed_batch(texts, endpoint, model):
# Try batch endpoint first
try:
r = requests.post(
f"{endpoint}/api/embed",
json={"model": model, "input": texts},
timeout=180
)
if r.ok:
data = r.json()
if data.get("embeddings") and len(data["embeddings"]) == len(texts):
return data["embeddings"]
except Exception:
pass
# Fallback to single prompt endpoint
out = []
for t in texts:
r = requests.post(
f"{endpoint}/api/embeddings",
json={"model": model, "prompt": t},
timeout=180
)
r.raise_for_status()
out.append(r.json()["embedding"])
return out
def get_collection(db_path):
client = chromadb.PersistentClient(path=db_path)
return client.get_or_create_collection(
COLLECTION,
metadata={"hnsw:space": "cosine"}
)
def iter_files(roots):
for root in roots:
root = pathlib.Path(root).expanduser()
if root.is_file():
yield root
continue
if not root.exists():
continue
for dirpath, dirnames, filenames in os.walk(root):
dirnames[:] = [
d for d in dirnames
if d not in IGNORE_DIRS and not d.startswith(".")
]
for fname in filenames:
p = pathlib.Path(dirpath) / fname
if p.suffix.lower() in EXTS and not fname.startswith("."):
yield p
def cmd_index(args):
col = get_collection(args.db)
roots = args.root or [
os.environ.get("HERMES_SECOND_BRAIN", "~/SecondBrain"),
os.path.expanduser("~/.hermes/memory/notes")
]
ids, docs, metas = [], [], []
for p in iter_files(roots):
try:
text = p.read_text(errors="ignore")
except Exception:
continue
for i, chunk in enumerate(chunk_text(text, args.chunk_size)):
uid = hashlib.sha1(
f"{p}:{i}:{chunk[:80]}".encode("utf-8", "ignore")
).hexdigest()
ids.append(uid)
docs.append(chunk)
metas.append({
"path": str(p),
"chunk": i,
"mtime": int(p.stat().st_mtime)
})
for start in range(0, len(docs), args.batch_size):
end = start + args.batch_size
if start >= len(docs):
break
embeddings = embed_batch(
docs[start:end],
args.endpoint,
args.model
)
col.upsert(
ids=ids[start:end],
documents=docs[start:end],
embeddings=embeddings,
metadatas=metas[start:end]
)
print(json.dumps({"indexed": len(ids), "db": args.db}, indent=2))
def cmd_search(args):
db_path = os.path.expanduser(args.db)
if not os.path.exists(db_path):
print("[]")
return
col = get_collection(db_path)
emb = embed_batch([args.query], args.endpoint, args.model)[0]
res = col.query(
query_embeddings=[emb],
n_results=args.top,
include=["documents", "metadatas", "distances"]
)
items = []
if res and res.get("ids") and res["ids"][0]:
for i, uid in enumerate(res["ids"][0]):
meta = res["metadatas"][0][i] if res.get("metadatas") else {}
dist = res["distances"][0][i] if res.get("distances") else 0.0
doc = res["documents"][0][i] if res.get("documents") else ""
items.append({
"id": uid,
"score": round(1.0 - float(dist), 6),
"path": meta.get("path", ""),
"text": doc[:args.chars]
})
print(json.dumps(items, indent=2))
def main():
ap = argparse.ArgumentParser(description="Hermes layered semantic memory")
sub = ap.add_subparsers(dest="cmd", required=True)
common = argparse.ArgumentParser(add_help=False)
common.add_argument("--model", default=DEFAULT_MODEL)
common.add_argument("--endpoint", default=DEFAULT_ENDPOINT)
common.add_argument("--db", default=DEFAULT_DB)
idx = sub.add_parser("index", parents=[common])
idx.add_argument("--root", action="append")
idx.add_argument("--chunk-size", type=int, default=1200)
idx.add_argument("--batch-size", type=int, default=8)
idx.set_defaults(func=cmd_index)
srch = sub.add_parser("search", parents=[common])
srch.add_argument("query")
srch.add_argument(
"--top",
type=int,
default=int(os.environ.get("HERMES_MEMORY_SEARCH_TOP_K", "5"))
)
srch.add_argument("--chars", type=int, default=700)
srch.set_defaults(func=cmd_search)
args = ap.parse_args()
args.db = os.path.expanduser(args.db)
args.func(args)
if __name__ == "__main__":
main()
4. What this gives you after Hermes finishes
You should now have:
-
~/.config/hermes/config.yaml
Main Hermes config with memory + token optimization. -
~/.config/hermes/hermes.env
Persistent environment variables. -
~/SecondBrain/
Local Markdown second brain. -
~/.hermes/
Hermes memory home. -
~/.hermes/tools/hermes_memory.py
Semantic indexing + search tool. -
~/.local/bin/hermes-memory
CLI for indexing/search. -
~/.local/bin/hermes-token-optimizer
Token optimizer wrapper. -
~/.local/bin/hermes-project-init
Initializes project memory in a repo.
5. Token optimization stays on by default because…
The setup makes token optimization persistent in three layers:
-
Shell environment
~/.bashrc~/.profile- optionally
~/.zshrc
-
Hermes config
token_optimization.enabled: truetoken_optimization.default: true
-
Optimizer wrapper
- tries
rtk,caveman,ponytail,headroom,tokensaver - falls back to safe built-in compression
- tries
That means you should not need to re-enable it every session.
6. Daily usage commands
After setup, these are useful:
Index your second brain
hermes-memory index --root "$HOME/SecondBrain"
Search memory
hermes-memory search "how did we fix the build error" --top 5
Index a project too
hermes-memory index --root "$HOME/SecondBrain" --root "$HOME/code/yourproject"
Initialize a repo for agent memory
cd ~/code/yourproject
hermes-project-init
7. Optional but highly useful additions
These are things many people add next.
A. Better code search
Already included:
ripgrepfdfzf
Optional:
batezalazygit
B. Better coding quality
Ask Hermes to install/configure:
ruffshellcheckpre-commityamllintpyrightortypescript-language-serverif you use TS
C. Per-project environment
Useful:
direnv
So each repo can auto-load:
- model choice
- context budget
- memory roots
- API keys
D. Backups
For your second brain:
- Git remote
- Syncthing
- BorgBackup
E. GUI second brain
If you want a GUI:
- Logseq is the closest FLOSS-friendly local-first choice
- Joplin is more note-taking oriented
- AFFiNE/AppFlowy are more Notion-like but can be less agent-friendly
8. If you really want Notion instead of local Markdown
Use Notion only as a secondary bridge, not the primary brain.
Ask Hermes to do this:
Enable optional Notion bridge for second brain.
- Ask me for NOTION_TOKEN and NOTION_DATABASE_ID.
- Store them in ~/.config/hermes/secrets.env with chmod 600.
- Keep local Markdown as primary source of truth.
- Use Notion only for sync/export, not as the main agent memory.
Why?
- Local Markdown is easier for agents to read/write
- Embedding local files is simpler and more reliable
- You avoid API latency and token overhead
9. If you want the “best” version, ask Hermes for these upgrades too
Paste this after the first setup:
Upgrade my Hermes setup with these improvements:
1. Use a bigger coding model if my hardware supports it.
2. Use bge-m3 for embeddings if quality matters more than speed.
3. Add automatic memory indexing with a systemd user timer.
4. Add session-start context packing from semantic memory.
5. Add automatic episode logging in JSONL.
6. Add project templates for Python, TypeScript, Bash, and Go.
7. Add safety hooks that prevent destructive shell commands.
8. Add git auto-commit for Second Brain.
9. Add a weekly memory deduplication pass.
10. Add token usage reporting so I can see what consumes context.
10. My recommended “best practical” stack
If you want the strongest default without overcomplicating things:
- Second brain: local Markdown + Git
- GUI: Logseq
- Embeddings: Ollama +
nomic-embed-text - Vector store: Chroma
- Coding model:
qwen2.5-coder:7bor bigger - Small summarizer:
llama3.2:3b - Token optimization: always-on with plugin fallback chain
- Memory style: layered memory as configured above
If you want, I can also give you a single one-shot bash bootstrap script version of this entire setup that you can save as hermes-setup.sh and run directly.