Skip to content

Comments

lennys memory improvements: UI/UX overhaul with inline tool result cards#43

Merged
johnymontana merged 19 commits intomainfrom
lennys-memory-improvements
Feb 2, 2026
Merged

lennys memory improvements: UI/UX overhaul with inline tool result cards#43
johnymontana merged 19 commits intomainfrom
lennys-memory-improvements

Conversation

@johnymontana
Copy link
Collaborator

@johnymontana johnymontana commented Jan 31, 2026

This PR brings significant improvements to the Lenny's Memory example application and the core neo4j-agent-memory library, focusing on enhanced graph visualization, relationship extraction, entity enrichment, and a major frontend UI/UX overhaul with rich tool result cards.

Changes Overview

18 commits | 55 files changed | +12,823 / -610 lines


🎨 Frontend Improvements

Rich Tool Result Cards (New)

Added a complete card system for displaying tool call results inline in chat:

  • EntityCard - Wikipedia-style knowledge panels for enriched entities with images, descriptions, and mentions
  • MapCard - Inline Leaflet maps for location tools, expandable to fullscreen
  • GraphCard - Inline NVL graph visualizations, expandable to fullscreen
  • DataCard - Responsive tables with auto-detected columns
  • StatsCard - Grid of color-coded metrics
  • RawJsonCard - Collapsible JSON fallback for debugging
  • toolCardRegistry.ts - Smart tool-to-card mapping with entity/location detection

Graph Visualization Enhancements

  • Episode data integration: Automatically includes full conversations and entities from podcast episodes referenced in tool call results
  • Reasoning memory visualization: Displays ReasoningTrace → ReasoningStep → ToolCall → Tool relationships
  • Guest name to session ID conversion: Maps guest names from tool results to episode session IDs

Memory Context Panel

  • Thread-scoped entities: Sidebar now shows only entities mentioned in the current conversation (not global search)
  • Prioritizes enriched entities with Wikipedia data

UI/UX Polish

  • WelcomeModal - First-time user onboarding with memory type explanations
  • Footer component - Neo4j Labs branding with repo/community links
  • Custom theme - Labs Purple accent, custom typography (Syne, Public Sans, JetBrains Mono)

🔧 Backend & Core Library

Centralized Cypher Queries

  • Moved all hardcoded Cypher queries to src/neo4j_agent_memory/graph/queries.py
  • Query constants for all CRUD operations (CREATE_MESSAGE, GET_ENTITY, etc.)
  • Query builder functions for dynamic DDL (indexes, constraints)
  • Improved maintainability and consistency

Relationship Extraction

  • Enhanced GLiREL relationship extraction with automatic RELATED_TO storage
  • New backfill_relationships.py script for existing databases
  • Supports relation types: WORKS_AT, FOUNDED_BY, LIVES_IN, LOCATED_IN, etc.

Entity Enrichment

  • New enrich_entities.py script with progress bars and rate limiting
  • Enrichment status checking and resume capability
  • Coalesced enriched properties for consistent entity access

API Improvements

  • /api/memory/graph now accepts episode_session_ids parameter
  • /api/memory/context filters entities by current thread
  • Fixed entity_typeentity_types parameter naming
  • APOC fallback for databases without APOC plugin

📝 Documentation

  • CLAUDE.md: Added implementation details Fix incorrect GitHub URLs in documentation #24-27 covering:
    • Graph visualization with episode session IDs
    • Sidebar entity filtering by thread
    • Guest name to session ID conversion
    • Neo4j relationship property access patterns
  • lennys-memory README: Updated graph view and memory context panel docs
  • Fixed doc test examples for correct API usage

🧪 Testing

  • test_queries.py - Unit tests for centralized query module
  • test_queries_neo4j.py - Integration tests for queries against Neo4j
  • test_relation_storage.py - Unit tests for relationship storage in short-term memory
  • Fixed import sorting (ruff I001) in test files
  • Updated doc tests for correct API patterns

🛠 Scripts (New)

Script Purpose
backfill_embeddings.py Add embeddings to existing entities/messages
backfill_relationships.py Extract and store RELATED_TO relationships for existing data
enrich_entities.py Wikipedia enrichment with progress tracking

Breaking Changes

None - all changes are backwards compatible.


Testing Checklist

  • make test-unit passes
  • make test-integration passes
  • make test-docs passes
  • Frontend builds without errors
  • Graph visualization shows episode data from tool results
  • Sidebar entities are scoped to current thread
  • Tool result cards render correctly for all tool types

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agent-memory Ready Ready Preview, Comment Feb 2, 2026 2:41am

@johnymontana johnymontana marked this pull request as ready for review February 2, 2026 02:45
@johnymontana johnymontana merged commit 600a03d into main Feb 2, 2026
20 checks passed
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.

1 participant