Skip to content

feat: add interactive architecture diagrams tab - #3

Merged
macayaven merged 1 commit into
mainfrom
feature/architecture-diagrams
Jan 9, 2026
Merged

macayaven merged 1 commit into
mainfrom
feature/architecture-diagrams

Conversation

@macayaven

@macayaven macayaven commented Jan 9, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR adds comprehensive documentation with interactive diagrams to help reviewers understand the Neural Memory architecture.

Changes

Removed:

  • Neural Memory Playground tab (confusing without context)

Added:

Tab 2: How It Works

  • 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

Tab 3: Key Concepts (NEW)

  • The Problem: Why LLMs need memory (stateless, no personalization)
  • Two Solutions: RAG vs Neural Memory comparison with strengths/weaknesses
  • The Key Innovation: Test-Time Training (TTT) from Google's Titans paper
  • Summary table of neural memory concepts

Tab 4: Integration & Docker (ENHANCED)

Incremental diagrams showing:

  1. Step 1: Vanilla LLM - the baseline (no memory, generic responses)
  2. Step 2a: Adding RAG - retrieval approach with limitations shown
  3. Step 2b: Adding Neural Memory - learning approach with advantages
  4. Step 3: Docker deployment architecture with MCP protocol

Each step shows exactly what gets sent to the LLM, making it clear how neural memory provides richer context.

Tab Structure (New)

  1. LLM Comparison (main interactive demo)
  2. How It Works (architecture diagrams)
  3. Key Concepts (fundamentals explained)
  4. Integration & Docker (production deployment)
  5. About

Test plan

  • Verify all tabs render correctly
  • Check diagrams display properly on desktop and mobile
  • Confirm incremental integration diagrams tell a clear story
  • Validate key concepts are understandable for reviewers

🤖 Generated with Claude Code

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>
Copilot AI review requested due to automatic review settings January 9, 2026 12:51

@codescene-delta-analysis codescene-delta-analysis Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@macayaven
macayaven merged commit 59df5ee into main Jan 9, 2026
10 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread deploy/huggingface/app.py
│ │ LayerNorm(1024) │ │
│ │ Linear(1024 → 256) │ │
│ └─────────────────────────────────────────┘ │
│ Total: ~262K parameters │

Copilot AI Jan 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
│ Total: ~262K parameters │
│ Total: ~593K parameters (memory_net + target_proj) │

Copilot uses AI. Check for mistakes.
Comment thread deploy/huggingface/app.py

| Aspect | Neural Memory | RAG |
|--------|---------------|-----|
| **Storage** | Fixed neural weights (~250K params) | Growing document store |

Copilot AI Jan 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
| **Storage** | Fixed neural weights (~250K params) | Growing document store |
| **Storage** | Fixed neural weights (~593K params) | Growing document store |

Copilot uses AI. Check for mistakes.
Comment thread deploy/huggingface/app.py
<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>

Copilot AI Jan 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
<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>

Copilot uses AI. Check for mistakes.
Comment thread deploy/huggingface/app.py

## How Each System Connects to the LLM

Both systems use the **exact same LLM** (HuggingFace SmolLM3-3B). The difference is **what context they provide**.

Copilot AI Jan 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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**.

Copilot uses AI. Check for mistakes.
Comment thread deploy/huggingface/app.py
<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>

Copilot AI Jan 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Suggested change
<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>

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants