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.
You are brainstorming architectural variants for the following task. Do not write code. Do not write a final design. Only produce variants and a recommendation.
Task
Implement a universal cross-agent query foundation for Open Second Brain as one feature-release-playbook PR.
Primary kanban tasks in scope:
t_51c827e7—[upstream:obsidian-wiki] Cross-agent targeted wiki search via wiki-agent skillt_64dad481—[upstream:obsidian-wiki] Memory bridge: compare wiki knowledge by source agent
Task body excerpts (verbatim):
t_51c827e7
Upstream added /wiki-{claude,codex,hermes,openclaw,copilot} slash commands that query one AI tool's session history from any other tool. Each agent has its own extraction strategy, and a no-query form ingests the last 5 unprocessed sessions. The result is synthesized and returned immediately after ingestion into the shared wiki.
OSB already imports sessions from Claude, Codex, and Hermes, but has no cross-agent query capability. brain_search and brain_query operate on vault content, not on raw agent history with synthesized answers. Adding cross-agent targeted search would let OSB users ask "what did Codex say about X" from within a Hermes session, enriching the multi-agent brain.
Notes: depends on upstream's extraction strategies per agent. Could be implemented as a brain tool that accepts an agent filter parameter on brain_search, or as a new brain_agent_query tool.
t_64dad481
/memory-bridge browses and compares wiki knowledge by source tool. /memory-bridge codex lists all Codex-sourced pages. /memory-bridge diff surfaces what each tool uniquely contributed — the knowledge gaps between AI tools. Supports browse, search, diff, and map modes.
OSB tracks agent identity on every signal, preference, and log entry, but has no tool to compare contributions by source agent. A memory-bridge equivalent would let OSB users see which agent (Claude vs Hermes vs Codex) contributed which preferences, or identify knowledge gaps where one agent found patterns others missed. This aligns with OSB's multi-agent brain architecture.
Notes: could be implemented as brain_agent_diff or an additional mode on brain_digest that groups by agent. The idempotency-key for cross-agent search (t_51c827e7) is a prerequisite — comparison needs the query layer first.
Project context
Project: Open Second Brain. TypeScript + Bun. Obsidian-native memory layer for AI agents.
Recent commits: ffde4ac chore(release): v0.14.1 (#40) bc97b38 refactor: add validation toolchain and normalize project formatting (#39) b76199a v0.14.0 - Semantic Brain Health and Self-Maintenance (#38) 2147640 v0.13.0 - Hybrid Search and Recall Quality (#37) 84886d1 v0.12.0 - Brain Integrity Suite (#36)
Related files:
src/core/brain/sessions/import.tssrc/core/brain/sessions/types.tssrc/core/brain/sessions/registry.tssrc/core/brain/sessions/claude.tssrc/core/brain/sessions/codex.tssrc/core/brain/sessions/hermes.tssrc/cli/brain/verbs/import-session.tssrc/cli/brain/help-text.tssrc/mcp/brain-tools.tssrc/mcp/search-tools.tstests/e2e/brain-capture-and-fields.test.tstests/core/brain.sessions.*tests/mcp/*.test.ts
Observed current constraints from code:
SessionAdapterIdis a closed union:"claude" | "codex" | "hermes".agentLabelForTurn()hardcodes those three adapter ids.- CLI
brain import-session --formatonly acceptsauto|claude|codex|hermes. - Current session import replays signals from transcript markers and
brain_feedbacktool calls, but there is no cross-agent query layer over session history. brain_queryandbrain_searchare vault-centric read surfaces today.
Conventions:
- Prefer deterministic, additive surfaces over opaque LLM-only behavior.
- Keep public outputs structured and machine-readable.
- TDD-first. Every atomic unit must start with failing tests.
- No new external dependencies.
- User-facing text should stay in English; do not hardcode language-specific phrases or agent-name matrices into the business logic.
- Existing README positions OSB as “one vault, every agent.” The design should reinforce that rather than optimizing only for today's agents.
Critical design constraint from the operator:
- Only Claude Code and Codex are extra agents available right now, but the solution must remain universal for future agents.
- Do NOT design a hardcoded current-agent matrix. Future agents should require new adapters / registrations, not a rewrite of the query layer.
- Treat this as a universal
agent-source query foundation + first comparison surface, not a one-off feature for current agents only.
Additional constraints:
- SOLID, KISS, DRY.
- No Python. TypeScript with Bun runtime.
- Keep the implementation suitable for one feature-release-playbook PR with roughly 50-70 files changed if it is the right scope, but project value matters more than exact file count.
- The PR will run through full playbook phases later (brainstorm, design-doc, TDD implementation, self-review, QA, PR, release).
Required output format
Produce exactly 3 distinct architectural variants. For each variant:
Variant N:
- Approach: 2-3 sentences describing the variant.
- Trade-offs: bullet list of pros and cons.
- Complexity: small | medium | large
- Risk: low | medium | high
After the three variants, add exactly one recommendation:
Recommended: Variant N
Rationale: 2-3 sentences explaining why this variant over the others, considering the project context and constraints above.
Output nothing outside of these sections.