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-2.0.0.tar.gz (4.1 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-2.0.0-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: trelix_llama_index-2.0.0.tar.gz
  • Upload date:
  • Size: 4.1 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-2.0.0.tar.gz
Algorithm Hash digest
SHA256 61324a144b8034bdaecee72fb7663cfa708ab6896b83437b31666ffaf54cabbb
MD5 bf2714355e06c8e9289dc2ae49911631
BLAKE2b-256 5a34b3851bcc960bdad25f9d9c165502359041b5f6c7aee3b0ed74550bebd99d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for trelix_llama_index-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c64cf3d3020425bbde8a1bd878ebe3e04d30b50ed2f073e226044fdc11540662
MD5 eacb91d1e6d827f870279e8c1b3de24f
BLAKE2b-256 ce79e9d7199b55572bfdf67b3905c2bf5d7dddd59a6845e7ac56870f68d5f6f0

See more details on using hashes here.

Provenance

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