Repository navigation
feat: add interactive architecture diagrams tab - #3
Conversation
Add a new How It Works tab with comprehensive visual documentation: - Neural Memory pipeline diagram (learning + query phases) - RAG pipeline diagram (storage + retrieval phases) - LLM integration explanation with exact system prompts - Side-by-side comparison of what each system sends to LLM - Technical architecture details for both approaches Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
There was a problem hiding this comment.
Gates Passed
4 Quality Gates Passed
See analysis details in CodeScene
Quality Gate Profile: Clean Code Collective
Want more control? Customize Code Health rules or catch issues early with our IDE extension and CLI tool.
There was a problem hiding this comment.
Pull request overview
This pull request adds a new "How It Works" tab to the Gradio interface, providing comprehensive visual documentation of the Neural Memory and RAG architectures. The addition helps users understand the technical differences between test-time training and traditional retrieval-augmented generation approaches through interactive diagrams and side-by-side comparisons.
Key Changes:
- New interactive architecture diagrams showing Neural Memory and RAG pipelines with learning and query phases
- Detailed LLM integration explanation with exact system prompts used by each approach
- Side-by-side comparison table highlighting what context each system provides to the LLM
- Technical implementation details including network architecture and parameter specifications
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| │ │ LayerNorm(1024) │ │ | ||
| │ │ Linear(1024 → 256) │ │ | ||
| │ └─────────────────────────────────────────┘ │ | ||
| │ Total: ~262K parameters │ |
There was a problem hiding this comment.
The parameter count shown as "~262K parameters" is inaccurate. The actual implementation with dim=256 has approximately 593K parameters (memory_net: ~528K + target_proj: ~66K). This should be updated to match the actual count.
| │ Total: ~262K parameters │ | |
| │ Total: ~593K parameters (memory_net + target_proj) │ |
|
|
||
| | Aspect | Neural Memory | RAG | | ||
| |--------|---------------|-----| | ||
| | **Storage** | Fixed neural weights (~250K params) | Growing document store | |
There was a problem hiding this comment.
The parameter count shown as "~250K params" is inaccurate. The actual implementation with dim=256 has approximately 593K parameters. This should be updated to match the actual count for consistency with the technical documentation.
| | **Storage** | Fixed neural weights (~250K params) | Growing document store | | |
| | **Storage** | Fixed neural weights (~593K params) | Growing document store | |
| <div style="background: linear-gradient(135deg, #805ad5 0%, #553c9a 100%); padding: 15px 20px; border-radius: 8px; text-align: center; min-width: 140px; border: 3px solid #d6bcfa;"> | ||
| <div style="font-size: 24px;">🤖</div> | ||
| <div style="font-weight: bold; color: #fff;">LLM</div> | ||
| <div style="font-size: 11px; color: #e9d8fd;">SmolLM3-3B<br/>(HuggingFace)</div> |
There was a problem hiding this comment.
The brand name should be "Hugging Face" (two words) rather than "HuggingFace" (one word) to match the official company branding. While "HuggingFace" is commonly used in technical contexts and URLs, user-facing documentation should use the correct brand name.
| <div style="font-size: 11px; color: #e9d8fd;">SmolLM3-3B<br/>(HuggingFace)</div> | |
| <div style="font-size: 11px; color: #e9d8fd;">SmolLM3-3B<br/>(Hugging Face)</div> |
|
|
||
| ## How Each System Connects to the LLM | ||
|
|
||
| Both systems use the **exact same LLM** (HuggingFace SmolLM3-3B). The difference is **what context they provide**. |
There was a problem hiding this comment.
The brand name should be "Hugging Face" (two words) rather than "HuggingFace" (one word) to match the official company branding. While "HuggingFace" is commonly used in technical contexts and URLs, user-facing documentation should use the correct brand name.
| Both systems use the **exact same LLM** (HuggingFace SmolLM3-3B). The difference is **what context they provide**. | |
| Both systems use the **exact same LLM** (Hugging Face SmolLM3-3B). The difference is **what context they provide**. |
| <div style="background: #2f855a; padding: 15px 20px; border-radius: 8px; text-align: center; min-width: 140px;"> | ||
| <div style="font-size: 24px;">🧠</div> | ||
| <div style="font-weight: bold; color: #fff;">memory_net(x)</div> | ||
| <div style="font-size: 11px; color: #9ae6b4;">2-layer MLP<br/>~250K params</div> |
There was a problem hiding this comment.
The parameter count shown as "~250K params" is inaccurate. With dim=256, the memory_net contains:
- Linear(256 -> 1024): 263,168 params
- LayerNorm(1024): 2,048 params
- Linear(1024 -> 256): 262,400 params
- Plus target_proj (65,792 params)
Total is approximately 593K parameters, not 250K. This should be updated to "~590K params" or "~593K params" to match the actual implementation.
| <div style="font-size: 11px; color: #9ae6b4;">2-layer MLP<br/>~250K params</div> | |
| <div style="font-size: 11px; color: #9ae6b4;">2-layer MLP<br/>~590K params</div> |
Summary
This PR adds comprehensive documentation with interactive diagrams to help reviewers understand the Neural Memory architecture.
Changes
Removed:
Added:
Tab 2: How It Works
Tab 3: Key Concepts (NEW)
Tab 4: Integration & Docker (ENHANCED)
Incremental diagrams showing:
Each step shows exactly what gets sent to the LLM, making it clear how neural memory provides richer context.
Tab Structure (New)
Test plan
🤖 Generated with Claude Code