all in
This commit is contained in:
@@ -0,0 +1,103 @@
|
||||
<h2>Architecture Overview</h2>
|
||||
<p class="subtitle">Layered Protocol Model — Obsidian RAG Plugin for OpenClaw</p>
|
||||
|
||||
<div class="section">
|
||||
<h3>System Boundary Diagram</h3>
|
||||
<div class="mockup">
|
||||
<div class="mockup-header">Architecture: Obsidian RAG Plugin</div>
|
||||
<div class="mockup-body" style="font-family: monospace; font-size: 13px; line-height: 1.6; padding: 20px;">
|
||||
<div style="display: flex; gap: 20px; flex-wrap: wrap;">
|
||||
<!-- User Layer -->
|
||||
<div style="flex: 1; min-width: 200px;">
|
||||
<div style="background: #1a1a2e; border: 2px solid #e94560; border-radius: 8px; padding: 12px; margin-bottom: 10px;">
|
||||
<div style="color: #e94560; font-weight: bold; margin-bottom: 6px;">USER LAYER</div>
|
||||
<div style="color: #eee;">Natural Language Query</div>
|
||||
<div style="color: #888; font-size: 11px;">"How was my mental health in 2024?"</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- OpenClaw Agent -->
|
||||
<div style="flex: 1; min-width: 220px;">
|
||||
<div style="background: #1a1a2e; border: 2px solid #0f3460; border-radius: 8px; padding: 12px; margin-bottom: 10px;">
|
||||
<div style="color: #53a8b6; font-weight: bold; margin-bottom: 6px;">OPENCLAW AGENT</div>
|
||||
<div style="color: #eee;">Tool Router</div>
|
||||
<div style="color: #888; font-size: 11px;">Selects plugin tools based on intent</div>
|
||||
<div style="color: #eee; margin-top: 4px;">Session Manager</div>
|
||||
<div style="color: #888; font-size: 11px;">Tracks plugin health state</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin: 16px 0; text-align: center; color: #666; font-size: 20px;">↕ Tool Calls & Results</div>
|
||||
|
||||
<!-- Plugin Layer -->
|
||||
<div style="background: #16213e; border: 2px solid #53a8b6; border-radius: 8px; padding: 12px; margin-bottom: 10px;">
|
||||
<div style="color: #53a8b6; font-weight: bold; margin-bottom: 8px;">PLUGIN LAYER (TypeScript)</div>
|
||||
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
|
||||
<div style="background: #1a1a2e; border: 1px solid #53a8b6; border-radius: 6px; padding: 8px; flex: 1; min-width: 120px;">
|
||||
<div style="color: #53a8b6; font-size: 11px;">TRANSPORT</div>
|
||||
<div style="color: #eee; font-size: 12px;">Tool Registry</div>
|
||||
<div style="color: #eee; font-size: 12px;">Error Normalizer</div>
|
||||
</div>
|
||||
<div style="background: #1a1a2e; border: 1px solid #53a8b6; border-radius: 6px; padding: 8px; flex: 1; min-width: 120px;">
|
||||
<div style="color: #53a8b6; font-size: 11px;">SESSION</div>
|
||||
<div style="color: #eee; font-size: 12px;">Vault Watcher</div>
|
||||
<div style="color: #eee; font-size: 12px;">Sync Scheduler</div>
|
||||
</div>
|
||||
<div style="background: #1a1a2e; border: 1px solid #53a8b6; border-radius: 6px; padding: 8px; flex: 1; min-width: 120px;">
|
||||
<div style="color: #53a8b6; font-size: 11px;">TOOL</div>
|
||||
<div style="color: #eee; font-size: 12px;">search</div>
|
||||
<div style="color: #eee; font-size: 12px;">index / status</div>
|
||||
<div style="color: #eee; font-size: 12px;">memory_store</div>
|
||||
</div>
|
||||
<div style="background: #1a1a2e; border: 1px solid #53a8b6; border-radius: 6px; padding: 8px; flex: 1; min-width: 120px;">
|
||||
<div style="color: #53a8b6; font-size: 11px;">DATA</div>
|
||||
<div style="color: #eee; font-size: 12px;">LanceDB Client</div>
|
||||
<div style="color: #eee; font-size: 12px;">Indexer Bridge</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="margin: 16px 0; text-align: center; color: #666; font-size: 20px;">↕ CLI & Filesystem</div>
|
||||
|
||||
<!-- Data Layer -->
|
||||
<div style="display: flex; gap: 10px; flex-wrap: wrap;">
|
||||
<div style="background: #1a1a2e; border: 2px solid #e94560; border-radius: 8px; padding: 12px; flex: 1; min-width: 180px;">
|
||||
<div style="color: #e94560; font-weight: bold; margin-bottom: 4px;">DATA LAYER</div>
|
||||
<div style="color: #eee;">LanceDB <span style="color: #888;">(vectors.lance)</span></div>
|
||||
<div style="color: #eee;">Ollama <span style="color: #888;">(localhost:11434)</span></div>
|
||||
<div style="color: #eee;">Obsidian Vault <span style="color: #888;">(filesystem)</span></div>
|
||||
</div>
|
||||
<div style="background: #1a1a2e; border: 2px solid #f0a500; border-radius: 8px; padding: 12px; flex: 1; min-width: 180px;">
|
||||
<div style="color: #f0a500; font-weight: bold; margin-bottom: 4px;">INDEXER (Python CLI)</div>
|
||||
<div style="color: #eee;">obsidian-rag index</div>
|
||||
<div style="color: #eee;">obsidian-rag sync</div>
|
||||
<div style="color: #eee;">obsidian-rag reindex</div>
|
||||
<div style="color: #eee;">obsidian-rag status</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="section" style="margin-top: 20px;">
|
||||
<h3>Key Design Decisions</h3>
|
||||
<div class="pros-cons">
|
||||
<div class="pros"><h4>Chosen</h4>
|
||||
<ul>
|
||||
<li>Layered protocol: Transport → Session → Tool → Data</li>
|
||||
<li>Plugin is thin TS wrapper; heavy lifting in Python</li>
|
||||
<li>LanceDB embedded — no server process</li>
|
||||
<li>Vault watcher auto-syncs on file changes</li>
|
||||
<li>Graceful degradation on dependency failures</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="cons"><h4>Rejected</h4>
|
||||
<ul>
|
||||
<li>Event bus (over-engineered for single plugin)</li>
|
||||
<li>Minimal spec (no protocol contract = ad-hoc)</li>
|
||||
<li>Server-based vector DB (unnecessary complexity)</li>
|
||||
<li>On-demand-only sync (user chose auto-sync)</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user