llmware-ai / llmware-ai/llmware
array out of bounds error in retrieval
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
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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