Skip to content

[Bug]: 'file_path' Error in Mix Mode Retrieval #1358

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

Open
2 tasks done
LinuxIsCool opened this issue Apr 12, 2025 · 1 comment
Open
2 tasks done

[Bug]: 'file_path' Error in Mix Mode Retrieval #1358

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

Comments

@LinuxIsCool
Copy link

Do you need to file an issue?

  • I have searched the existing issues and this bug is not already filed.
  • I believe this is a legitimate bug, not just a question or feature request.

Describe the bug

Issue Description

When using LightRAG's mix mode for queries, the following error consistently appears in logs:

ERROR: Error in get_vector_context: 'file_path'

Despite this error, the mix mode continues to function and returns results successfully. The error appears to be non-critical but may indicate an underlying issue in the vector context retrieval process.

Environment

  • Python version: 3.10
  • OpenAI API version: 1.72.0
  • LightRAG version: 1.3.1 (lightrag-hku)
  • OS: Linux (Pop_OS)

Steps to Reproduce

  1. Initialize LightRAG with OpenAI embeddings and GPT-4o-mini for completions
  2. Add a document using ainsert()
  3. Query using mix mode with aquery() and QueryParam(mode="mix")

Code Sample

import os
import asyncio
from lightrag import LightRAG, QueryParam
from lightrag.llm.openai import gpt_4o_mini_complete, openai_embed
from lightrag.kg.shared_storage import initialize_pipeline_status

async def main():
    # Initialize
    rag = LightRAG(
        working_dir="./resources/lightrag_test",
        embedding_func=openai_embed,
        llm_model_func=gpt_4o_mini_complete
    )
    
    await rag.initialize_storages()
    await initialize_pipeline_status()
    
    # Add document
    doc_id = await rag.ainsert("Your test document content here")
    
    # Query with mix mode
    result = await rag.aquery(
        "What is in this document?",
        param=QueryParam(mode="mix")
    )
    
    # The error occurs during this query but doesn't prevent results
    
if __name__ == "__main__":
    asyncio.run(main())

Debug Information

The error occurs during the retrieval step in mix mode:

INFO: Process XXX buidling query context...
INFO: Query nodes: [...], top_k: 60, cosine: 0.2
INFO: Query edges: [...], top_k: 60, cosine: 0.2
ERROR: Error in get_vector_context: 'file_path'

The error doesn't appear with other modes (naive, local, global, hybrid) - only with mix mode.

Attempted Solutions

I've tried various parameter adjustments with QueryParam, including:

  • Reducing token limits
  • Adjusting top_k values
  • Providing explicit keywords
  • Modifying context parameters

None of these adjustments resolved the issue.

Impact

While the error doesn't seem to prevent getting results from the mix mode, it may:

  • Indicate missing functionality
  • Affect result quality in ways that aren't immediately obvious
  • Create unnecessary log noise

Additional Notes

  • All storage directories and files appear to be properly initialized
  • The mix mode successfully retrieves and combines information despite the error
  • Debug-level logging shows the error occurs during vector context retrieval

Any assistance in resolving this issue would be appreciated. If additional debug information is needed, please let me know.

Steps to reproduce

No response

Expected Behavior

No response

LightRAG Config Used

Paste your config here

Logs and screenshots

No response

Additional Information

@LinuxIsCool LinuxIsCool added the bug Something isn't working label Apr 12, 2025
@danielaskdd
Copy link
Collaborator

Kindly update to the latest version (1.3.1) and perform a complete reindex of all your files.

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

2 participants