-
Notifications
You must be signed in to change notification settings - Fork 5k
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
fix(ragKnowledge): Ensure scoped IDs are properly used to check for existing knowledge #2690
fix(ragKnowledge): Ensure scoped IDs are properly used to check for existing knowledge #2690
Conversation
…or existing knowledge
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…or existing knowledge (elizaOS#2690) Co-authored-by: Odilitime <[email protected]> Co-authored-by: Sayo <[email protected]>
fix(ragKnowledge): Ensure scoped IDs are properly used to check for existing knowledge
The problem is in how knowledge IDs are handled between checking for existence and creation.
processCharacterRAGKnowledge
, you generate the ID using:RAGKnowledgeManager.processFile
, you generate the ID using:The mismatch is here - when you check for existing knowledge using
getKnowledge
, you're using the first ID generation method (just based on file path), but when you actually create the knowledge, you're using the second method (which includes the scope prefix).This means:
stringToUuid("shared/warringstates/zhibo.md")
stringToUuid("shared-shared/warringstates/zhibo.md")
The fix would be to use the same ID generation method in both places. You should modify
processCharacterRAGKnowledge
to usegenerateScopedId
when checking for existence:Fixes #2689