{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/lightrag-simple-and-fast-retrieval-augmented","title":"LightRAG: Simple and Fast Retrieval-Augmented Generation","arxiv_id":"2410.05779","date":"2024-10-08","proceeding":null,"authors":["Zirui Guo","Lianghao Xia","Yanhua Yu","Tu Ao","Chao Huang"],"abstract":"Retrieval-Augmented Generation (RAG) systems enhance large language models (LLMs) by integrating external knowledge sources, enabling more accurate and contextually relevant responses tailored to user needs. However, existing RAG systems have significant limitations, including reliance on flat data representations and inadequate contextual awareness, which can lead to fragmented answers that fail to capture complex inter-dependencies. To address these challenges, we propose LightRAG, which incorporates graph structures into text indexing and retrieval processes. This innovative framework employs a dual-level retrieval system that enhances comprehensive information retrieval from both low-level and high-level knowledge discovery. Additionally, the integration of graph structures with vector representations facilitates efficient retrieval of related entities and their relationships, significantly improving response times while maintaining contextual relevance. This capability is further enhanced by an incremental update algorithm that ensures the timely integration of new data, allowing the system to remain effective and responsive in rapidly changing data environments. Extensive experimental validation demonstrates considerable improvements in retrieval accuracy and efficiency compared to existing approaches. We have made our LightRAG open-source and available at the link: https://github.com/HKUDS/LightRAG","url_abs":"https://arxiv.org/abs/2410.05779v3","url_pdf":"https://arxiv.org/pdf/2410.05779v3.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"lightrag-simple-and-fast-retrieval-augmented","repo_url":"https://github.com/hkuds/lightrag","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":1,"framework":"none","reach":{"status":"ok","spdx":"MIT"}}],"tasks":[{"task_slug":"information-retrieval","task_name":"Information Retrieval"},{"task_slug":"rag","task_name":"RAG"},{"task_slug":"retrieval","task_name":"Retrieval"},{"task_slug":"retrieval-augmented-generation","task_name":"Retrieval-augmented Generation"}],"methods":[{"method_slug":"adam","method_name":"Adam"},{"method_slug":"attention","method_name":"Attention"},{"method_slug":"attention-dropout","method_name":"Attention Dropout"},{"method_slug":"bart","method_name":"BART"},{"method_slug":"bert","method_name":"BERT"},{"method_slug":"bpe","method_name":"BPE"},{"method_slug":"dense-connections","method_name":"Dense Connections"},{"method_slug":"dropout","method_name":"Dropout"},{"method_slug":"layer-normalization","method_name":"Layer Normalization"},{"method_slug":"linear-layer","method_name":"Linear Layer"},{"method_slug":"linear-warmup-with-linear-decay","method_name":"Linear Warmup With Linear Decay"},{"method_slug":"multi-head-attention","method_name":"Multi-Head Attention"},{"method_slug":"rag","method_name":"RAG"},{"method_slug":"residual-connection","method_name":"Residual Connection"},{"method_slug":"softmax","method_name":"Softmax"},{"method_slug":"weight-decay","method_name":"Weight Decay"},{"method_slug":"wordpiece","method_name":"WordPiece"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2410.05779","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2410.05779"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/hkuds/lightrag","reach":{"status":"ok","spdx":"MIT"}}],"summary":{"unverified":8},"by_repo_kind":{"official":{"samples":8,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"014de214db1895ca","entry":"collect_kg_merge_candidates","repo":"hkuds/lightrag","repo_kind":"official","path":"lightrag/operate.py","file_url":"https://github.com/hkuds/lightrag/blob/HEAD/lightrag/operate.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"014de214db1895ca"}},{"code_sha256_prefix":"1729c5aef344cc43","entry":"find_target_span","repo":"hkuds/lightrag","repo_kind":"official","path":"lightrag/multimodal_context.py","file_url":"https://github.com/hkuds/lightrag/blob/HEAD/lightrag/multimodal_context.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"1729c5aef344cc43"}},{"code_sha256_prefix":"07fbfec7874e6a96","entry":"flush_may_have_lost_reference","repo":"hkuds/lightrag","repo_kind":"official","path":"lightrag/exceptions.py","file_url":"https://github.com/hkuds/lightrag/blob/HEAD/lightrag/exceptions.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"07fbfec7874e6a96"}},{"code_sha256_prefix":"cad2192dedaa609f","entry":"is_namespace","repo":"hkuds/lightrag","repo_kind":"official","path":"lightrag/namespace.py","file_url":"https://github.com/hkuds/lightrag/blob/HEAD/lightrag/namespace.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cad2192dedaa609f"}},{"code_sha256_prefix":"c629108e63d2245a","entry":"load_content_rows_by_blockid","repo":"hkuds/lightrag","repo_kind":"official","path":"lightrag/multimodal_context.py","file_url":"https://github.com/hkuds/lightrag/blob/HEAD/lightrag/multimodal_context.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c629108e63d2245a"}},{"code_sha256_prefix":"245793d97f7a353f","entry":"normalize_chunk_heading","repo":"hkuds/lightrag","repo_kind":"official","path":"lightrag/chunk_schema.py","file_url":"https://github.com/hkuds/lightrag/blob/HEAD/lightrag/chunk_schema.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"245793d97f7a353f"}},{"code_sha256_prefix":"65781232be7b3546","entry":"normalize_kv_create_time","repo":"hkuds/lightrag","repo_kind":"official","path":"lightrag/base.py","file_url":"https://github.com/hkuds/lightrag/blob/HEAD/lightrag/base.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"65781232be7b3546"}},{"code_sha256_prefix":"851727a852a7d324","entry":"tmp_path_for","repo":"hkuds/lightrag","repo_kind":"official","path":"lightrag/file_atomic.py","file_url":"https://github.com/hkuds/lightrag/blob/HEAD/lightrag/file_atomic.py","link_basis":"plan_row","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"851727a852a7d324"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}