llmware-ai / llmware-ai/llmware

array out of bounds error in retrieval

Open
#453 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
14.8k
Forks
2.9k
PR merge metrics
No merged PRs in 30d

Description

When making a RAG request to of a semantic query I experienced the following stack trace. I am able to reproduce this.

File "/llmware/llmware/retrieval.py", line 670, in semantic_query
results_dict = self._cursor_to_qr(query, qr_raw, result_count=result_count)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/llmware/llmware/retrieval.py", line 578, in _cursor_to_qr
matches_found = self.locate_query_match(query, raw_qr["text"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/llmware/llmware/retrieval.py", line 1375, in locate_query_match
if core_text[x].lower() == key_term[0].lower():
~~~~~~~~^^^
IndexError: string index out of range

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the RAG semantic query, then inspect llmware/retrieval.py around semantic_query, _cursor_to_qr, and locate_query_match at line 1375. Trace how key_term is produced for the failing input and verify the completed change no longer raises IndexError for this reproducible case, with regression coverage if the project’s test structure identifies a suitable location.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
ai, search
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
46/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.