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-1.1.0.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-1.1.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trelix_llama_index-1.1.0.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-1.1.0.tar.gz
Algorithm Hash digest
SHA256 23c3204dfaf59a1a18c5ac4626cebc09ff0faf406d020493ed101e384335572c
MD5 d5d191a8aff305d7d983bf70a885d371
BLAKE2b-256 69f4c32cd0c330cf2f61acc72395764d2346878b2ad6b50c91bbacd0188d96f4

See more details on using hashes here.

Provenance

The following attestation bundles were made for trelix_llama_index-1.1.0.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-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for trelix_llama_index-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b2b9c8eef84e701db60ccba0b7d9719fae6bec81ba6032cc96a7806414c259fc
MD5 570cc9d092239b640f4446340f2c7a3a
BLAKE2b-256 3599ad89be7a5a390a337af7736a61b399d0e989ab3f2ab4fd4b125c20770e9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for trelix_llama_index-1.1.0-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