Skip to content
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

ragKnowledge blows up prompt by retrieving entire documents. #2914

Open
LinuxIsCool opened this issue Jan 28, 2025 · 1 comment
Open

ragKnowledge blows up prompt by retrieving entire documents. #2914

LinuxIsCool opened this issue Jan 28, 2025 · 1 comment
Labels
bug Something isn't working

Comments

@LinuxIsCool
Copy link
Contributor

Describe the bug

ragKnowledge embeds entire documents and then retrieves them at runtime, blowing up prompts.

To Reproduce

Put a large (>1MB) text file in rag knowledge, and then message your agent with a large portion of that document so that it gets retrieved via ragKnowledge during runtime.

Expected behavior

Either don't embed entire documents or filter them out in runtime.

Additional context

There is some code duplication in ragKnowledge.ts between processFile and createKnowledge. I think those can be cleaned up and we must consdier 1. Do we need entire document embeddings? How to properly filter them out at runtime retrieval especially if they are too big?

I have a temporary fix in sqlite adapter doing this:

        let sql = `SELECT * FROM knowledge WHERE (isMain = 0) AND (agentId = ? OR isShared = 1)`;

I originally commented on this here: #1620 (comment)

@LinuxIsCool LinuxIsCool added the bug Something isn't working label Jan 28, 2025
Copy link
Contributor

Hello @LinuxIsCool! Welcome to the elizaOS community. Thank you for opening your first issue; we appreciate your contribution. You are now an elizaOS contributor!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant