-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add back fp and fn to memory #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Coverage report
Test suite run success3 tests passing in 3 suites. Report generated by 🧪jest coverage report action from 6397075 |
There was a problem hiding this 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 adds support for tracking false positives and false negatives in the memory system by introducing an isMatchToAgent
field to user operations. The system now distinguishes between cases where the agent and user disagree on matches, enabling better memory management and agent learning.
Key changes:
- Adds
isMatchToAgent
boolean parameter to track agent vs. user match decisions - Implements false positive/negative memory storage and retrieval functionality
- Updates UI components to handle undefined match states during transitions
Reviewed Changes
Copilot reviewed 11 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
File | Description |
---|---|
app/dashboard/rightpanel.tsx |
Updates isMatch prop type to allow undefined values |
app/dashboard/page.tsx |
Passes isMatch parameter to dashboard operations hook |
app/dashboard/hooks/useDashboardOperations.tsx |
Adds isMatch parameter and includes it in user operations |
app/dashboard/components/explanation/useSchemaExplanations.tsx |
Changes initial isMatch state from false to undefined |
app/dashboard/components/explanation/SchemaExplanation.tsx |
Updates isMatch prop type to allow undefined |
app/dashboard/components/explanation/CombinedView.tsx |
Updates isMatch prop type to allow undefined |
api/matching_task.py |
Adds is_match_to_agent parameter to UserOperation class |
api/langchain/memory.py |
Implements false positive/negative storage and search functionality |
api/langchain/agent.py |
Adds methods for handling user operations and memory management |
api/index.py |
Updates API endpoints to handle isMatchToAgent parameter |
README.md |
Minor title correction from "LLM-Supported" to "LLM-Powered" |
Comments suppressed due to low confidence (1)
api/langchain/memory.py:133
- [nitpick] The namespace key 'false_positives' uses underscores while other namespaces use underscores consistently, but the comment on line 114 uses spaces in 'false_positives'. Consider using consistent naming throughout - either 'false_positives' everywhere or 'falsePositives' to match the frontend camelCase convention.
"false_positives": 0,
operation: str, | ||
candidate: Dict[str, Any], | ||
references: List[Dict[str, Any]], | ||
is_match_to_agent: Optional[bool] = None, |
Copilot
AI
Aug 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The parameter is_match_to_agent
should be required rather than optional with None default. When tracking false positives/negatives, this information is essential for proper memory categorization. Consider making this a required boolean parameter.
is_match_to_agent: Optional[bool] = None, | |
is_match_to_agent: bool, |
Copilot uses AI. Check for mistakes.
api/index.py
Outdated
operation = operation_obj["operation"] | ||
candidate = operation_obj["candidate"] | ||
references = operation_obj["references"] | ||
is_match_to_agent = operation_obj["isMatchToAgent"] |
Copilot
AI
Aug 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct dictionary access without validation could cause KeyError if 'isMatchToAgent' is missing from the request. Use operation_obj.get("isMatchToAgent")
or add proper validation to handle cases where this field might be absent.
is_match_to_agent = operation_obj["isMatchToAgent"] | |
is_match_to_agent = operation_obj.get("isMatchToAgent") |
Copilot uses AI. Check for mistakes.
api/index.py
Outdated
|
||
operation_type = operation["operation"] | ||
candidate = operation["candidate"] | ||
is_match_to_agent = operation["isMatchToAgent"] |
Copilot
AI
Aug 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct dictionary access without validation could cause KeyError if 'isMatchToAgent' is missing from the operation. Use operation.get("isMatchToAgent")
or add proper validation to handle cases where this field might be absent in historical operations.
is_match_to_agent = operation["isMatchToAgent"] | |
is_match_to_agent = operation.get("isMatchToAgent") |
Copilot uses AI. Check for mistakes.
api/index.py
Outdated
|
||
operation_type = operation["operation"] | ||
candidate = operation["candidate"] | ||
is_match_to_agent = operation["isMatchToAgent"] |
Copilot
AI
Aug 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Direct dictionary access without validation could cause KeyError if 'isMatchToAgent' is missing from the operation. Use operation.get("isMatchToAgent")
or add proper validation to handle cases where this field might be absent in historical operations.
is_match_to_agent = operation["isMatchToAgent"] | |
is_match_to_agent = operation.get("isMatchToAgent") |
Copilot uses AI. Check for mistakes.
No description provided.