Skip to content

Local-first 🧠 memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.

TypeScript
735 B
Raw Blame
/**
 * Test helper: the text of every Markdown page under a vault's `Brain/`,
 * for assertions that must hold on whatever page a write produced (no page
 * records a digest of a withheld source), not only on the page named in
 * the result.
 */

import { readFileSync, readdirSync } from "node:fs";
import { join } from "node:path";

/** Every Markdown page under `<root>/Brain/`, as text. */
export function brainPageTexts(root: string): string[] {
  const out: string[] = [];
  for (const entry of readdirSync(join(root, "Brain"), { recursive: true, withFileTypes: true })) {
    if (entry.isFile() && entry.name.endsWith(".md")) {
      out.push(readFileSync(join(entry.parentPath, entry.name), "utf8"));
    }
  }
  return out;
}