Skip to content

Self-hosted MCP server + dashboard giving Claude Code, Cursor & Hermes agents shared long-term memory over a git-backed markdown vault. Agent-native, Obsidian-compatible second brain — markdown RAG, no vector DB.

1.7 KB
Raw Blame
export interface NoteMeta {
  /** Relative POSIX path from the vault root, e.g. "decisions/foo-2026-07-09.md". */
  path: string;
  /** Filename without the .md extension (used for wikilink resolution). */
  slug: string;
  title: string;
  /** Top-level folder, or "root" for a file at the vault root. */
  folder: string;
  type?: string;
  tags: string[];
  /** Alternate names/synonyms for this note, from `aliases:`. Indexed like the title. */
  aliases: string[];
  status?: string;
  created?: string;
  updated?: string;
  /** From `valid_until:` — epoch ms, inclusive through end of that day. Past it, the note is stale. */
  validUntil?: number;
  /** From `superseded_by:` — the stem of the note that replaced this one. Marks this note retired. */
  supersededBy?: string;
  frontmatter: Record<string, unknown>;
  /**
   * Set when the note opens with `---` but its YAML could not be parsed. The frontmatter is
   * then entirely lost — status, tags, title — so the note silently loses its authority.
   */
  frontmatterError?: string;
  mtimeMs: number;
}

export interface Note extends NoteMeta {
  /** Markdown body without frontmatter. */
  body: string;
  /** Full file content including frontmatter. */
  raw: string;
}

export interface RawLink {
  target: string;
  alias?: string;
  source: "body" | "related";
}

export interface GraphNode {
  id: string; // path
  label: string;
  folder: string;
  type?: string;
  degree: number;
}
export interface GraphEdge {
  source: string;
  target: string;
}
export interface Graph {
  nodes: GraphNode[];
  edges: GraphEdge[];
}

export interface TreeNode {
  name: string;
  path: string;
  type: "dir" | "file";
  title?: string;
  children?: TreeNode[];
}