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
- trelix on GitHub
- trelix on PyPI
- trelix-mcp — MCP server for Claude Code, Cursor, Windsurf
- trelix-langchain — LangChain retriever
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61324a144b8034bdaecee72fb7663cfa708ab6896b83437b31666ffaf54cabbb
|
|
| MD5 |
bf2714355e06c8e9289dc2ae49911631
|
|
| BLAKE2b-256 |
5a34b3851bcc960bdad25f9d9c165502359041b5f6c7aee3b0ed74550bebd99d
|
Provenance
The following attestation bundles were made for trelix_llama_index-2.0.0.tar.gz:
Publisher:
release.yml on sairam0424/trelix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trelix_llama_index-2.0.0.tar.gz -
Subject digest:
61324a144b8034bdaecee72fb7663cfa708ab6896b83437b31666ffaf54cabbb - Sigstore transparency entry: 2007024583
- Sigstore integration time:
-
Permalink:
sairam0424/trelix@34543cc1790d242da2b0f31c26edd6c0755e9d9a -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/sairam0424
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@34543cc1790d242da2b0f31c26edd6c0755e9d9a -
Trigger Event:
push
-
Statement type:
File details
Details for the file trelix_llama_index-2.0.0-py3-none-any.whl.
File metadata
- Download URL: trelix_llama_index-2.0.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c64cf3d3020425bbde8a1bd878ebe3e04d30b50ed2f073e226044fdc11540662
|
|
| MD5 |
eacb91d1e6d827f870279e8c1b3de24f
|
|
| BLAKE2b-256 |
ce79e9d7199b55572bfdf67b3905c2bf5d7dddd59a6845e7ac56870f68d5f6f0
|
Provenance
The following attestation bundles were made for trelix_llama_index-2.0.0-py3-none-any.whl:
Publisher:
release.yml on sairam0424/trelix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trelix_llama_index-2.0.0-py3-none-any.whl -
Subject digest:
c64cf3d3020425bbde8a1bd878ebe3e04d30b50ed2f073e226044fdc11540662 - Sigstore transparency entry: 2007024799
- Sigstore integration time:
-
Permalink:
sairam0424/trelix@34543cc1790d242da2b0f31c26edd6c0755e9d9a -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/sairam0424
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@34543cc1790d242da2b0f31c26edd6c0755e9d9a -
Trigger Event:
push
-
Statement type: