Skip to content

feat: add LlamaIndex retrievers#350

Open
raoabinav wants to merge 4 commits into
StarTrail-org:mainfrom
raoabinav:codex/p1-llamaindex-review
Open

feat: add LlamaIndex retrievers#350
raoabinav wants to merge 4 commits into
StarTrail-org:mainfrom
raoabinav:codex/p1-llamaindex-review

Conversation

@raoabinav
Copy link
Copy Markdown
Contributor

Summary

  • add optional LlamaIndex retrievers backed by existing LEANN indexes
  • support pure vector retrieval and hybrid dense-vector plus BM25 retrieval
  • convert LEANN SearchResult values into LlamaIndex TextNode / NodeWithScore objects while preserving IDs, text, scores, and metadata
  • document usage and add focused unit tests for scoring, weighting, query validation, async retrieval, and lazy integration imports

Review note

This overlaps with existing external PR #274 for issue #217. This PR is opened as a smaller adapter-focused implementation with tests/docs so maintainers can compare the approaches directly.

Tests

  • PYTHONPATH=/Users/abinavrao/LEANN/.worktrees/p1-llamaindex-review/packages/leann-core/src:/Users/abinavrao/LEANN/.worktrees/p1-llamaindex-review/packages/leann-backend-hnsw /Users/abinavrao/LEANN/.worktrees/cid-migrate/.venv/bin/python -m pytest tests/test_llamaindex_integration.py -q
  • /Users/abinavrao/LEANN/.worktrees/cid-migrate/.venv/bin/ruff check packages/leann-core/src/leann/integrations tests/test_llamaindex_integration.py
  • /Users/abinavrao/LEANN/.worktrees/cid-migrate/.venv/bin/ruff format --check packages/leann-core/src/leann/integrations tests/test_llamaindex_integration.py
  • git diff --check upstream/main...HEAD

Addresses #217.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant