Skip to main content

Setup

LightRag connects to a running LightRAG server over HTTP. The default server URL is http://localhost:9621.

Example

agent_with_knowledge.py
Inserted content is uploaded to the LightRAG server for indexing. Searches query the server in hybrid mode and return its response as a document, with source references preserved in meta_data["references"].
Search filters are not supported. Indexing happens on the server after upload, so documents may take a moment to become searchable.

Async Support ⚡

LightRAG also supports asynchronous operations, enabling concurrency and leading to better performance.

async_lightrag_db.py
Use ainsert() and aprint_response() methods with asyncio.run() for non-blocking operations in high-throughput applications.

LightRag Params