Skip to content

Comments

Don't expose reasoning traces in demo app search tool#30

Merged
johnymontana merged 2 commits intomainfrom
bugfix-reasoning-trace-search
Jan 25, 2026
Merged

Don't expose reasoning traces in demo app search tool#30
johnymontana merged 2 commits intomainfrom
bugfix-reasoning-trace-search

Conversation

@johnymontana
Copy link
Collaborator

Fix #28

@vercel
Copy link

vercel bot commented Jan 25, 2026

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

Project Deployment Review Updated (UTC)
agent-memory Ready Ready Preview, Comment Jan 25, 2026 5:36pm

@johnymontana johnymontana marked this pull request as ready for review January 25, 2026 17:20
@johnymontana johnymontana requested a review from Copilot January 25, 2026 17:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses issue #28 by preventing reasoning traces and chat messages from appearing in podcast search results. The fix adds metadata and session ID filtering to ensure that domain search tools only return podcast content.

Changes:

  • Added metadata_filters={"source": "lenny_podcast"} to search_podcast_content to filter vector search results
  • Added session ID prefix filtering (WHERE c.session_id STARTS WITH 'lenny-podcast-') to three Cypher queries in get_entity_context, find_related_entities, and get_most_mentioned_entities
  • Added comprehensive unit and integration tests to verify the filtering behavior

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
examples/lennys-memory/backend/src/agent/tools.py Added metadata and session filters to 4 functions to prevent non-podcast content from being returned
examples/lennys-memory/backend/tests/test_tools.py Added comprehensive unit tests verifying filter implementation for all modified tools
examples/lennys-memory/backend/tests/test_integration.py Added integration tests validating end-to-end filtering behavior with real database
examples/lennys-memory/backend/tests/conftest.py Added test fixtures including mock message factory, mock agent context, and real memory client for integration tests
examples/lennys-memory/backend/tests/init.py Added test package initialization
examples/lennys-memory/backend/pyproject.toml Added pytest dependencies and configuration including integration test markers

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI commented Jan 25, 2026

@johnymontana I've opened a new pull request, #31, to work on those changes. Once the pull request is ready, I'll request review from you.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@johnymontana johnymontana merged commit 77899ed into main Jan 25, 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.

Bug: Reasoning traces exposed in domain search tools

2 participants