lightrag-client
Python SDK for the InfraX RAGservicer — hybrid knowledge-base (vector + graph + keyword) retrieval over REST.
Install
pip install lightrag-client
Quick Start
from lightrag_client import LightRAGClient
rs = LightRAGClient(base_url="http://localhost:9721", api_key="lr_xxx", tenant_id="market")
# Insert documents
rs.insert("market", "BTC 走势受美联储利率政策影响", "doc-1")
rs.insert_batch("market", [
{"text": "DeFi TVL 回升", "doc_id": "doc-2"},
{"text": "链上巨鲸增持", "doc_id": "doc-3"},
])
# Query (context retrieval, no LLM answer)
result = rs.query("market", "比特币走势")
print(result)
# Context-only retrieval with top_k
ctx = rs.retrieve("market", "利率", top_k=5)
# Documents
rs.list_documents("market", page=1, limit=20)
rs.delete("market", "doc-1")
Admin
# Tenants & API keys
rs.create_tenant("market", "Market Data", "default tenant")
rs.generate_api_key("market", "prod", expires_days=90)
rs.list_api_keys("market")
# Hot-reload LLM / Embedding config (no restart needed)
rs.update_config(llm={"api_key": "sk-new", "model": "deepseek-chat"})
All methods talk the standard InfraX envelope {code, message, data} and return the data payload on success; API failures raise LightRAGClientError with .status / .code / .message.
Requirements
- Python >= 3.9
requests
License
MIT
Metadata
Release files for lightrag-client 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lightrag_client-2.0.0.tar.gz | 3.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| lightrag_client-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 8.2 kB
Release files / lightrag_client-2.0.0.tar.gz
| Download URL | lightrag_client-2.0.0.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9a3e3d1bb722c8f2d46228c6a45dc8f2ebf2ae9e77c820b07f93f33621c105a2
|
|
BLAKE2b-256 checksum How to use checksums |
b525e1adc3b81f8acd51a08fe5b3eeb072cfe3b7959b858083f8b6cb31732545
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / lightrag_client-2.0.0-py3-none-any.whl
| Download URL | lightrag_client-2.0.0-py3-none-any.whl |
|---|---|
| Size | 4.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3140777b0cde2d925dad3562d773221141d1dac15cd1dfacc18fdad1057051ed
|
|
BLAKE2b-256 checksum How to use checksums |
9cb7f565d481dc55e7dd5c95cc83cdba4b7dda3be4e1f1138ed0da295b6b9f37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|