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

[BUG] LightRag - LLM call error #569

Closed
eddprogrammer opened this issue Dec 15, 2024 · 2 comments · Fixed by #572
Closed

[BUG] LightRag - LLM call error #569

eddprogrammer opened this issue Dec 15, 2024 · 2 comments · Fixed by #572
Labels
bug Something isn't working

Comments

@eddprogrammer
Copy link
Contributor

Description

Hi,
I am getting error when adding documents to LightRag index, it is a large file and gets broken down into 250 chunks of 1200 token each. However LLM call returned an error when handling Entity/Relationship extraction at chunk 197. Because of that, the indexing fail and I had to reindex, then it failed again at chunk 155. See error below.

Indexing [1/1]: document sample.txt
=> Converting document sample.txt to text
=> Converted document sample.txt to text
=> [document sample.txt] Processed 1 chunks
=> Finished indexing document sample.txt
[GraphRAG] Creating index... This can take a long time.
[GraphRAG] Indexed 0 / 1 documents.
Error: Error code: 500 - {'type': 'error', 'error': {'type': 'api_error', 'message': 'Internal server error'}}

Log info

Extracting entities from chunks: 80%|█████████████████████████████████▋ | 197/246 [1:17:33<19:17, 23.62s/chunk]
INFO:lightrag:Writing graph with 0 nodes, 0 edges

I have seen the exact same issue when using LightRag directly, and the solution was to add retry in front of the llm_model_func.

@retry(
    stop=stop_after_attempt(3),
    wait=wait_exponential(multiplier=1, min=4, max=10),
    retry=retry_if_exception_type((RateLimitError, APIConnectionError, Timeout, APIError)),
)

Can this retry be added to the Kotaemon? I am wasting a lot of Anthropic tokens on retrying indexing the same documents :)

Reproduction steps

1. Go to 'Files'
2. Click on 'LightRag'
3. Upload a large documents.

Screenshots

![DESCRIPTION](LINK.png)

Logs

Extracting entities from chunks:  80%|█████████████████████████████████▋        | 197/246 [1:17:33<19:17, 23.62s/chunk]
INFO:lightrag:Writing graph with 0 nodes, 0 edges

Browsers

No response

OS

No response

Additional information

No response

@eddprogrammer eddprogrammer added the bug Something isn't working label Dec 15, 2024
@taprosoft
Copy link
Collaborator

Hi, thanks for the report this seem to be a valid problem. Can you help to create a PR to include this fix?

@eddprogrammer
Copy link
Contributor Author

eddprogrammer commented Dec 16, 2024

All right. I created the PR #572

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

Successfully merging a pull request may close this issue.

2 participants