Skip to main content

trelix-llama-index

LlamaIndex retriever for trelix — semantic code search using Tree-sitter AST parsing, hybrid BM25+vector search, and call-graph expansion.

Install

pip install trelix-llama-index

Usage

from trelix_llama_index import TrelixIndexRetriever

# First index your repo (one-time)
# trelix index /path/to/repo

retriever = TrelixIndexRetriever(repo_path="/path/to/repo", k=10)
nodes = retriever.retrieve("how does authentication work?")

for node in nodes:
    print(node.node.metadata["file"], node.score)
    print(node.node.text[:200])

With LlamaIndex query engine

from llama_index.core import VectorStoreIndex
from llama_index.core.query_engine import RetrieverQueryEngine
from trelix_llama_index import TrelixIndexRetriever

retriever = TrelixIndexRetriever(repo_path="/path/to/repo", k=10)
query_engine = RetrieverQueryEngine.from_args(retriever)
response = query_engine.query("How does the authentication middleware work?")
print(response)

Configuration

Env var Default Description
TRELIX_EMBEDDER_PROVIDER local Embedding provider: local | openai | azure | bedrock-cohere | bedrock-titan
OPENAI_API_KEY Required for openai provider
AZURE_API_KEY Required for azure provider
AWS_ACCESS_KEY_ID Required for Bedrock providers

Provider switching (v0.7.0+)

# Use Bedrock Cohere embeddings (best retrieval, reuses AWS creds)
TRELIX_EMBEDDER_PROVIDER=bedrock-cohere trelix index /path/to/repo

# Use local embeddings (no API key needed)
TRELIX_EMBEDDER_PROVIDER=local trelix index /path/to/repo

Links

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

trelix_llama_index-0.7.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

trelix_llama_index-0.7.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file trelix_llama_index-0.7.1.tar.gz.

File metadata

  • Download URL: trelix_llama_index-0.7.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for trelix_llama_index-0.7.1.tar.gz
Algorithm Hash digest
SHA256 444e28ba208ae63a56fb790c6e95531501ad375210680fa3c5a46cbebd998878
MD5 7384babeca242d45463a813b821aa823
BLAKE2b-256 42800ffdee9eebdf597e88521960faba276cf199ba067fb37036d29be8e0fde1

See more details on using hashes here.

Provenance

The following attestation bundles were made for trelix_llama_index-0.7.1.tar.gz:

Publisher: release.yml on sairam0424/trelix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file trelix_llama_index-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for trelix_llama_index-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c4387e28abf2fbfcf5ecc11ae39ee5dd33db9e399a9ffbf30c0d9143331a1b9
MD5 538a61225fe11ea938f203bfdf6ccbbb
BLAKE2b-256 84642d2c910d2f2698adeab23ea47100323655f35f619ec950a8a26e15a2da1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for trelix_llama_index-0.7.1-py3-none-any.whl:

Publisher: release.yml on sairam0424/trelix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page