bootstrap, provider configuration, and runtime integration. The following implementation uses Hermes v0.14's native markdown provider, abstracted through a TypeScript configuration layer for production readiness.
Step 1: Environment Bootstrap
Install the agent framework and initialize the post-install hooks. The framework supports multiple package managers and shell environments.
# Node/TypeScript ecosystem
npm install -g hermes-agent && hermes postinstall
# Bash/Unix environments
curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash
# PowerShell/Windows environments
irm https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.ps1 | iex
Step 2: Provider Configuration
Instead of hardcoding CLI flags, define a configuration module that maps the memory provider to a local directory. This approach enables environment-specific overrides and keeps secrets out of version control.
// memory.config.ts
import { defineMemoryProvider } from 'hermes-agent/config';
export const vaultMemory = defineMemoryProvider({
provider: 'obsidian',
rootPath: process.env.AGENT_VAULT_PATH || './workspace/agent-memory',
syncStrategy: 'onWrite',
indexing: {
enabled: true,
fileExtensions: ['.md', '.txt', '.json'],
maxFileSizeMB: 2,
},
runtime: {
restEndpoint: 'http://localhost:27123',
mcpTools: true,
},
});
Initialize the provider using the configuration file:
hermes memory init --config ./memory.config.ts
hermes memory verify --path ./workspace/agent-memory
Step 3: Runtime Integration
Agents interact with the vault through explicit file references. The framework automatically serializes agent outputs into markdown documents and deserializes them during context assembly.
// agent-runtime.ts
import { HermesAgent } from 'hermes-agent/core';
import { vaultMemory } from './memory.config';
const agent = new HermesAgent({
model: 'nous-portal/llama-3.1-70b',
memory: vaultMemory,
tools: ['file_read', 'file_write', 'search_vault'],
contextWindow: 128000,
});
// Example: Agent writes structured session notes
await agent.execute({
prompt: 'Summarize the deployment pipeline changes and save to memory.',
outputFormat: 'markdown',
targetFile: 'logs/deployment-2026-05-20.md',
});
// Example: Agent loads previous state deterministically
const previousState = await agent.memory.read('logs/deployment-2026-05-20.md');
console.log(previousState.content);
Architecture Decisions and Rationale
Why markdown over vectors? Vector embeddings compress semantic meaning into numerical representations, which introduces approximation error and requires continuous index maintenance. Markdown files preserve exact text, support native diffing, and require zero transformation pipelines. For agent memory, exact recall is almost always preferable to fuzzy matching.
Why Hermes v0.14's native provider? The framework ships with 68 built-in agent tools, 400+ model endpoints, and a local OpenAI-compatible proxy (hermes proxy) that handles OAuth-only providers transparently. The native markdown provider eliminates the need for third-party RAG orchestrators, reducing the attack surface and deployment footprint.
Why expose REST and MCP endpoints? The Obsidian Local REST API plugin (defaulting to localhost:27123) enables real-time read/write operations during agent execution, not just at boot. Coupled with the Obsidian MCP server, the vault becomes a shared tool surface for any MCP-compatible client. This design supports multi-agent collaboration without centralizing memory in a single service.
Pitfall Guide
Production deployments of file-based agent memory consistently encounter the same structural failures. The following pitfalls and fixes are derived from real-world agent orchestration.
| Pitfall | Explanation | Fix |
|---|
| Unstructured Dumping | Agents write raw outputs without naming conventions or directory hierarchy, causing retrieval collisions. | Enforce a strict schema: category/date/topic.md. Use a pre-write validation hook that rejects files missing metadata headers. |
| Concurrent Write Collisions | Parallel agent threads attempt to modify the same markdown file simultaneously, causing data corruption. | Implement file-level locking via flock or use a write queue that serializes vault mutations. Hermes v0.14 supports atomic append operations; prefer them over full file overwrites. |
| Context Window Bleed | Agents load entire vault contents instead of targeted files, exhausting the context window. | Configure explicit file routing in the prompt template. Use targetFile parameters and disable wildcard loading. Monitor token usage with hermes memory stats. |
| Ignoring Version Control | Markdown vaults are treated as ephemeral, losing historical state and audit trails. | Initialize the vault directory as a Git repository. Commit after every agent session using a lightweight hook: git add -A && git commit -m "agent-state: $(date +%F)". |
| Mixing Transient and Persistent Data | Session logs, temporary calculations, and long-term knowledge are stored in the same directory. | Partition the vault: ./vault/transient/ for ephemeral data, ./vault/persistent/ for curated knowledge. Configure the memory provider to exclude transient paths from context assembly. |
| Over-Reliance on Fuzzy Search | Developers enable semantic search on the vault, reintroducing vector-like uncertainty. | Disable fuzzy search by default. Rely on exact file paths and explicit search_vault tool calls. Reserve semantic search only for unstructured archival retrieval. |
| Neglecting Sync Latency | Agents assume instant vault availability, causing timeouts when the REST API or MCP server is unresponsive. | Implement exponential backoff for vault I/O operations. Cache frequently accessed files in memory and invalidate on write events. Use hermes memory status in health checks. |
Production Bundle
Action Checklist
Decision Matrix
| Scenario | Recommended Approach | Why | Cost Impact |
|---|
| Single-agent workflow with deterministic state | Markdown Vault (Obsidian) | Exact recall, zero embedding costs, human-editable | Near-zero infrastructure cost |
| Multi-agent collaboration across teams | Markdown Vault + MCP Server | Shared tool surface, version-controlled state, no central DB | Minimal (local I/O + network sync) |
| High-frequency real-time data ingestion | Vector Database RAG | Handles streaming embeddings, scales to millions of documents | High (GPU inference, storage, pipeline maintenance) |
| Enterprise compliance & audit requirements | Markdown Vault + Git + Signed Commits | Immutable history, human-readable diffs, cryptographic verification | Low (storage + CI/CD pipeline) |
| Cross-platform OAuth-only model routing | Hermes Proxy + Markdown Vault | Local OpenAI-compatible endpoint, unified memory layer | Low (proxy overhead only) |
Configuration Template
Copy this template into your project root. Adjust paths and environment variables to match your deployment environment.
# hermes.memory.yaml
provider: obsidian
root_path: ${AGENT_VAULT_PATH:-./workspace/agent-memory}
sync_strategy: on_write
indexing:
enabled: true
file_extensions:
- .md
- .txt
- .json
max_file_size_mb: 2
exclude_patterns:
- "transient/**"
- ".git/**"
runtime:
rest_api:
enabled: true
host: localhost
port: 27123
mcp_tools: true
concurrency:
max_writes: 3
lock_timeout_ms: 5000
context_assembly:
strategy: explicit_paths
max_files_per_prompt: 5
token_budget_percent: 4
Quick Start Guide
- Install the framework: Run
npm install -g hermes-agent && hermes postinstall (or use the shell-specific installer for your OS).
- Create the vault:
mkdir -p ./workspace/agent-memory && cd ./workspace/agent-memory && git init
- Initialize the provider: Execute
hermes memory init --config ./memory.config.ts and verify with hermes memory verify --path ./workspace/agent-memory
- Launch the agent: Start your runtime with
hermes run --config ./memory.config.ts --model nous-portal/llama-3.1-70b
- Validate memory persistence: Send a test prompt, confirm the output appears in the vault directory, and restart the agent to verify deterministic recall.
The architecture shifts agent memory from a probabilistic retrieval problem to a deterministic file system operation. By treating markdown as the primary state layer, developers eliminate embedding pipeline overhead, restore human editability, and reduce token waste. Hermes v0.14's native provider, combined with REST and MCP integration points, provides a production-ready foundation for agents that require continuity, auditability, and cross-platform compatibility.