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

Uploaded Python 3

File details

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

File metadata

  • Download URL: trelix_llama_index-1.0.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.0.0.tar.gz
Algorithm Hash digest
SHA256 b5ee7f6f25a11cb62a873af20a91328ad17db82bfba6314a572775197bd69fe5
MD5 fd55b01b7caf81d66cd1329870547861
BLAKE2b-256 627ff87e01a760ae7f10794223d76e8762ac4f9e43af4d9da09ee580a148bb5f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for trelix_llama_index-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3eca1b6e1dc30f279ddba365ef7b9134677c7fe25741ca4dff53c2656d281a24
MD5 2bd175df82f97d11ca2c87dce264662a
BLAKE2b-256 c1d0597e03b0cf9f454b64b2c78d07ccc80dad5f6c60b7ee37dc133409925b1b

See more details on using hashes here.

Provenance

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