Repository Analysis

HKUDS/LightRAG

[EMNLP2025] LightRAG: Simple and Fast Retrieval-Augmented Generation

35.1 Strong AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of HKUDS/LightRAG, a Python project with 39,253 GitHub stars. SynthScan v2.0 examined 404,882 lines of code across 993 source files, recording 10386 pattern matches distributed across 21 syntactic categories. The overall adjusted score of 35.1 places this repository in the Strong AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

35.1
Adjusted Score
35.1
Raw Score
100%
Time Factor
2026-08-28
Last Push
39.3K
Stars
Python
Language
404.9K
Lines of Code
993
Files
10.4K
Pattern Hits
2026-08-29
Scan Date
0.19
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 193MEDIUM 1621LOW 8572

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 10386 distinct pattern matches across 21 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

Hyper-Verbose Identifiers6469 hits · 5659 pts
SeverityFileLineSnippetContext
LOWreproduce/Step_3_openai_compatible.py57def run_queries_and_save_to_json(CODE
LOWreproduce/Step_3.py26def run_queries_and_save_to_json(CODE
LOWlightrag/rerank.py36def chunk_documents_for_rerank(CODE
LOWlightrag/rerank.py142async def achunk_documents_for_rerank(CODE
LOWlightrag/addon_params.py30def _emit_deprecated_addon_warnings(params: Mapping[str, Any]) -> None:CODE
LOWlightrag/table_markup.py83def header_grid_to_thead_html(grid: list[list[str]]) -> str:CODE
LOWlightrag/llm_roles.py130 def register_role_llm_builder(CODE
LOWlightrag/llm_roles.py162 def _get_effective_role_llm_kwargs(self, role: str) -> dict[str, Any]:CODE
LOWlightrag/llm_roles.py170 def _get_effective_role_llm_timeout(self, role: str) -> int:CODE
LOWlightrag/llm_roles.py174 def _get_effective_role_llm_max_async(self, role: str) -> int:CODE
LOWlightrag/llm_roles.py212 def _rebuild_single_role_llm_func(self, role: str) -> None:CODE
LOWlightrag/llm_roles.py228 def _schedule_retired_llm_queue_cleanup(CODE
LOWlightrag/llm_roles.py256 def _finalize_retired_llm_queue_cleanup(self, task: asyncio.Task) -> None:CODE
LOWlightrag/llm_roles.py265 async def wait_for_retired_llm_queues(self) -> None:CODE
LOWlightrag/llm_roles.py276 def _apply_llm_role_config_update(CODE
LOWlightrag/llm_roles.py578 async def get_embedding_queue_status(self) -> dict[str, Any]:CODE
LOWlightrag/lightrag.py1028 def _set_runtime_addon_params(self, addon_params: Mapping[str, Any] | None) -> None:CODE
LOWlightrag/lightrag.py1032 def _apply_chunk_size_overlay(self) -> None:CODE
LOWlightrag/lightrag.py1151 def _refresh_addon_params_cache(self) -> None:CODE
LOWlightrag/lightrag.py1171 def _ensure_addon_params_cache(self) -> None:CODE
LOWlightrag/lightrag.py1217 def _build_role_llm_cache_identity(CODE
LOWlightrag/lightrag.py1621 def _get_parse_native_executor(self) -> ThreadPoolExecutor:CODE
LOWlightrag/lightrag.py1638 def _shutdown_parser_executor(self) -> None:CODE
LOWlightrag/lightrag.py2155 def _operation_truncation_record() -> dict[str, Any] | None:CODE
LOWlightrag/lightrag.py2169 def _terminal_truncation_kwargs() -> dict[str, Any]:CODE
LOWlightrag/lightrag.py2192 async def _journal_truncation_write_ahead(CODE
LOWlightrag/lightrag.py2603 async def _upsert_custom_chunk_status(CODE
LOWlightrag/lightrag.py2693 async def _union_doc_recovery_anchors(CODE
LOWlightrag/lightrag.py2733 async def arollback_failed_custom_chunk_patches(CODE
LOWlightrag/lightrag.py2900 async def _rollback_one_custom_chunk_patch(CODE
LOWlightrag/lightrag.py3029 async def _persist_custom_chunk_recovery_warning(CODE
LOWlightrag/lightrag.py3153 async def _prune_doc_recovery_anchors(CODE
LOWlightrag/lightrag.py3223 async def _process_extract_entities(CODE
LOWlightrag/lightrag.py3275 async def _discard_pending_index_ops(CODE
LOWlightrag/lightrag.py3423 async def _insert_done_with_cleanup(self) -> None:CODE
LOWlightrag/lightrag.py3499 def _normalize_custom_kg_entity_name(value: Any, *, field: str) -> str:CODE
LOWlightrag/lightrag.py4361 async def _update_delete_retry_state(CODE
LOWlightrag/lightrag.py4443 async def _get_existing_llm_cache_ids(self, cache_ids: list[str]) -> list[str]:CODE
LOWlightrag/lightrag.py4610 def _patch_journal_candidates(CODE
LOWlightrag/lightrag.py4640 async def _resolve_purge_recovery_proof(CODE
LOWlightrag/lightrag.py4848 def _raise_missing_recovery_proof(CODE
LOWlightrag/lightrag.py5227 async def _purge_derived_kg_contributions(CODE
LOWlightrag/lightrag.py6433 async def _raise_if_recovery_required(self) -> None:CODE
LOWlightrag/operate.py183def _get_relationship_vdb_timeout_seconds(global_config: dict[str, Any]) -> float:CODE
LOWlightrag/operate.py200def _format_relation_edge_label(edge_key: tuple[str, str] | list[str]) -> str:CODE
LOWlightrag/operate.py208def _truncate_entity_identifier(CODE
LOWlightrag/operate.py248def _truncate_section_context(CODE
LOWlightrag/operate.py371async def _handle_entity_relation_summary(CODE
LOWlightrag/operate.py660def _normalize_and_validate_entity_type(entity_type: str, context: str) -> str | None:CODE
LOWlightrag/operate.py708def _handle_single_entity_extraction(CODE
LOWlightrag/operate.py772def _handle_single_relationship_extraction(CODE
LOWlightrag/operate.py852def _normalize_text_extraction_record_attributes(CODE
LOWlightrag/operate.py889def _looks_like_json_extraction_result(result: str) -> bool:CODE
LOWlightrag/operate.py905async def _process_json_extraction_result(CODE
LOWlightrag/operate.py1091async def rebuild_knowledge_from_chunks(CODE
LOWlightrag/operate.py1312 async def _locked_rebuild_relationship(src, tgt, chunk_ids):CODE
LOWlightrag/operate.py1404async def _get_cached_extraction_results(CODE
LOWlightrag/operate.py1497async def _process_extraction_result(CODE
LOWlightrag/operate.py1628async def _rebuild_from_extraction_result(CODE
LOWlightrag/operate.py1684def _surviving_chunk_file_paths(CODE
6409 more matches not shown…
Decorative Section Separators1425 hits · 5348 pts
SeverityFileLineSnippetContext
MEDIUMlightrag/constants.py783# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/constants.py787# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py3662# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py3664# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py2698# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py2700# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py2961# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py2963# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py3016# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py3018# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py3233 # -----------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py3235 # -----------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py3468 # -----------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils.py3470 # -----------------------------------------------------------------------COMMENT
MEDIUMlightrag/pipeline.py660 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py662 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py2194 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py2196 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py5778 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py5780 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py6056 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py6058 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py558 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py560 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py3070 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py3076 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py4169 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py4171 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py4751 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py4753 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py6391 # ============================================================COMMENT
MEDIUMlightrag/pipeline.py6393 # ============================================================COMMENT
MEDIUMlightrag/multimodal_context.py88# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py92# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py685# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py687# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py132# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py135# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py188# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py190# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py267# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py269# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py461# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/multimodal_context.py463# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1281# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1283# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1308# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1310# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1156# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1158# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1206# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1208# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1346# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/utils_pipeline.py1348# ---------------------------------------------------------------------------COMMENT
MEDIUMlightrag/base.py1455 # ------------------------------------------------------------------COMMENT
MEDIUMlightrag/base.py1461 # ------------------------------------------------------------------COMMENT
MEDIUMlightrag/tools/rebuild_vdb.py575 # ------------------------------------------------------------------COMMENT
MEDIUMlightrag/tools/rebuild_vdb.py577 # ------------------------------------------------------------------COMMENT
MEDIUMlightrag/tools/rebuild_vdb.py760 # ------------------------------------------------------------------COMMENT
MEDIUMlightrag/tools/rebuild_vdb.py762 # ------------------------------------------------------------------COMMENT
1365 more matches not shown…
Excessive Try-Catch Wrapping797 hits · 622 pts
SeverityFileLineSnippetContext
LOWreproduce/Step_1_openai_compatible.py50 except Exception as e:CODE
LOWreproduce/Step_0.py41 except Exception as e:CODE
MEDIUMreproduce/Step_0.py42 print(f"An error occurred while processing file {filename}: {e}")CODE
LOWreproduce/Step_0.py54 except Exception as e:CODE
MEDIUMreproduce/Step_0.py55 print(f"An error occurred while saving to the file {output_filename}: {e}")CODE
LOWreproduce/Step_1.py19 except Exception as e:CODE
LOWreproduce/Step_3_openai_compatible.py53 except Exception as e:CODE
MEDIUMreproduce/Step_3_openai_compatible.py49def process_query(query_text, rag_instance, query_param):CODE
LOWreproduce/Step_3.py22 except Exception as e:CODE
MEDIUMreproduce/Step_3.py18def process_query(query_text, rag_instance, query_param):CODE
LOWlightrag/pipeline_metrics.py97 except Exception as metric_error: # pragma: no cover - defensiveCODE
LOWlightrag/pipeline_metrics.py115 except Exception as metric_error: # pragma: no cover - defensiveCODE
LOWlightrag/rerank.py84 except Exception as e:CODE
LOWlightrag/rerank.py624 except Exception as e:CODE
LOWlightrag/rerank.py639 except Exception as e:CODE
LOWlightrag/rerank.py654 except Exception as e:CODE
LOWlightrag/llm_roles.py262 except Exception as e:CODE
LOWlightrag/llm_roles.py348 except Exception:CODE
LOWlightrag/lightrag.py15except Exception: # pragma: no cover - optional dependencyCODE
LOWlightrag/lightrag.py1685 except Exception as e:CODE
LOWlightrag/lightrag.py2451 except Exception as bookkeeping_error:CODE
LOWlightrag/lightrag.py2483 except Exception as ingress_error:CODE
LOWlightrag/lightrag.py2513 except Exception as probe_error:CODE
LOWlightrag/lightrag.py2584 except Exception as drain_error:CODE
LOWlightrag/lightrag.py2824 except Exception as rollback_error:CODE
LOWlightrag/lightrag.py3241 except Exception as e:CODE
LOWlightrag/lightrag.py3349 except Exception as e:CODE
LOWlightrag/lightrag.py3353 except Exception as e:CODE
LOWlightrag/lightrag.py3381 except Exception as e:CODE
LOWlightrag/lightrag.py3889 except Exception as e:CODE
LOWlightrag/lightrag.py4316 except Exception as e:CODE
LOWlightrag/lightrag.py4458 except Exception as verification_error:CODE
LOWlightrag/lightrag.py4492 except Exception as e:CODE
LOWlightrag/lightrag.py5171 except Exception as e:CODE
LOWlightrag/lightrag.py5203 except Exception as e:CODE
LOWlightrag/lightrag.py5340 except Exception as e:CODE
LOWlightrag/lightrag.py5525 except Exception as e:CODE
LOWlightrag/lightrag.py5563 except Exception as e:CODE
LOWlightrag/lightrag.py5629 except Exception as e:CODE
LOWlightrag/lightrag.py5642 except Exception as e:CODE
LOWlightrag/lightrag.py5667 except Exception as e:CODE
LOWlightrag/lightrag.py5680 except Exception as e:CODE
LOWlightrag/lightrag.py5985 except Exception as cache_err:CODE
LOWlightrag/lightrag.py5998 except Exception as e:CODE
LOWlightrag/lightrag.py6055 except Exception as cache_collect_error:CODE
LOWlightrag/lightrag.py6074 except Exception as status_write_error:CODE
LOWlightrag/lightrag.py6168 except Exception as cache_delete_error:CODE
LOWlightrag/lightrag.py6196 except Exception as e:CODE
LOWlightrag/lightrag.py6229 except Exception as status_update_error:CODE
LOWlightrag/lightrag.py6243 except Exception as e:CODE
LOWlightrag/lightrag.py6262 except Exception as status_update_error:CODE
LOWlightrag/lightrag.py6301 except Exception as ingress_error:CODE
LOWlightrag/lightrag.py6324 except Exception as probe_error:CODE
LOWlightrag/lightrag.py6363 except Exception as persistence_error:CODE
LOWlightrag/lightrag.py6418 except Exception as drain_error:CODE
LOWlightrag/operate.py765 except Exception as e:CODE
LOWlightrag/operate.py845 except Exception as e:CODE
LOWlightrag/operate.py1006 except Exception as e:CODE
LOWlightrag/operate.py1082 except Exception as e:CODE
LOWlightrag/operate.py1258 except Exception as e:CODE
737 more matches not shown…
Cross-File Repetition85 hits · 425 pts
SeverityFileLineSnippetContext
HIGHlightrag/base.py0get multiple vector data by their ids (read-your-writes), preserving order. args: ids: list of unique identifiers returnSTRING
HIGHlightrag/kg/deprecated/chroma_impl.py0get multiple vector data by their ids (read-your-writes), preserving order. args: ids: list of unique identifiers returnSTRING
HIGHlightrag/kg/nano_vector_db_impl.py0get multiple vector data by their ids (read-your-writes), preserving order. args: ids: list of unique identifiers returnSTRING
HIGHlightrag/base.py0get all edges in the graph. returns: a list of all edges, where each edge is a dictionary of its propertiesSTRING
HIGHlightrag/kg/networkx_impl.py0get all edges in the graph. returns: a list of all edges, where each edge is a dictionary of its propertiesSTRING
HIGHlightrag/kg/mongo_impl.py0get all edges in the graph. returns: a list of all edges, where each edge is a dictionary of its propertiesSTRING
HIGHlightrag/kg/memgraph_impl.py0get all edges in the graph. returns: a list of all edges, where each edge is a dictionary of its propertiesSTRING
HIGHlightrag/kg/neo4j_impl.py0get all edges in the graph. returns: a list of all edges, where each edge is a dictionary of its propertiesSTRING
HIGHlightrag/kg/qdrant_impl.py0buffered vector upsert waiting for embedding and/or bulk flush.STRING
HIGHlightrag/kg/mongo_impl.py0buffered vector upsert waiting for embedding and/or bulk flush.STRING
HIGHlightrag/kg/opensearch_impl.py0buffered vector upsert waiting for embedding and/or bulk flush.STRING
HIGHlightrag/kg/milvus_impl.py0buffered vector upsert waiting for embedding and/or bulk flush.STRING
HIGHlightrag/kg/qdrant_impl.py0discard buffered upserts/deletes (pipeline aborting on error).STRING
HIGHlightrag/kg/mongo_impl.py0discard buffered upserts/deletes (pipeline aborting on error).STRING
HIGHlightrag/kg/postgres_impl.py0discard buffered upserts/deletes (pipeline aborting on error).STRING
HIGHlightrag/kg/opensearch_impl.py0discard buffered upserts/deletes (pipeline aborting on error).STRING
HIGHlightrag/kg/milvus_impl.py0discard buffered upserts/deletes (pipeline aborting on error).STRING
HIGHlightrag/kg/qdrant_impl.py0buffer an entity vector delete by computing its hash id.STRING
HIGHlightrag/kg/mongo_impl.py0buffer an entity vector delete by computing its hash id.STRING
HIGHlightrag/kg/opensearch_impl.py0buffer an entity vector delete by computing its hash id.STRING
HIGHlightrag/kg/milvus_impl.py0buffer an entity vector delete by computing its hash id.STRING
HIGHlightrag/kg/qdrant_impl.py0get multiple vector data by their ids (read-your-writes), preserving order.STRING
HIGHlightrag/kg/mongo_impl.py0get multiple vector data by their ids (read-your-writes), preserving order.STRING
HIGHlightrag/kg/milvus_impl.py0get multiple vector data by their ids (read-your-writes), preserving order.STRING
HIGHlightrag/kg/networkx_impl.py0retrieve a connected subgraph of nodes where the label includes the specified `node_label`. args: node_label: label of tSTRING
HIGHlightrag/kg/postgres_impl.py0retrieve a connected subgraph of nodes where the label includes the specified `node_label`. args: node_label: label of tSTRING
HIGHlightrag/kg/memgraph_impl.py0retrieve a connected subgraph of nodes where the label includes the specified `node_label`. args: node_label: label of tSTRING
HIGHlightrag/kg/neo4j_impl.py0retrieve a connected subgraph of nodes where the label includes the specified `node_label`. args: node_label: label of tSTRING
HIGHlightrag/kg/networkx_impl.py0get all nodes in the graph. returns: a list of all nodes, where each node is a dictionary of its propertiesSTRING
HIGHlightrag/kg/mongo_impl.py0get all nodes in the graph. returns: a list of all nodes, where each node is a dictionary of its propertiesSTRING
HIGHlightrag/kg/postgres_impl.py0get all nodes in the graph. returns: a list of all nodes, where each node is a dictionary of its propertiesSTRING
HIGHlightrag/kg/memgraph_impl.py0get all nodes in the graph. returns: a list of all nodes, where each node is a dictionary of its propertiesSTRING
HIGHlightrag/kg/neo4j_impl.py0get all nodes in the graph. returns: a list of all nodes, where each node is a dictionary of its propertiesSTRING
HIGHlightrag/kg/mongo_impl.py0check if the storage is empty for the current workspace and namespace returns: bool: true if storage is empty, false othSTRING
HIGHlightrag/kg/postgres_impl.py0check if the storage is empty for the current workspace and namespace returns: bool: true if storage is empty, false othSTRING
HIGHlightrag/kg/redis_impl.py0check if the storage is empty for the current workspace and namespace returns: bool: true if storage is empty, false othSTRING
HIGHlightrag/kg/mongo_impl.py0get documents with pagination support args: status_filter: filter by document status, none for all statuses page: page nSTRING
HIGHlightrag/kg/postgres_impl.py0get documents with pagination support args: status_filter: filter by document status, none for all statuses page: page nSTRING
HIGHlightrag/kg/json_doc_status_impl.py0get documents with pagination support args: status_filter: filter by document status, none for all statuses page: page nSTRING
HIGHlightrag/kg/redis_impl.py0get documents with pagination support args: status_filter: filter by document status, none for all statuses page: page nSTRING
HIGHlightrag/kg/mongo_impl.py0get counts of documents in each status for all documents returns: dictionary mapping status names to counts, including 'STRING
HIGHlightrag/kg/postgres_impl.py0get counts of documents in each status for all documents returns: dictionary mapping status names to counts, including 'STRING
HIGHlightrag/kg/json_doc_status_impl.py0get counts of documents in each status for all documents returns: dictionary mapping status names to counts, including 'STRING
HIGHlightrag/kg/redis_impl.py0get counts of documents in each status for all documents returns: dictionary mapping status names to counts, including 'STRING
HIGHlightrag/kg/mongo_impl.py0get document by file path args: file_path: the file path to search for returns: union[dict[str, any], none]: document daSTRING
HIGHlightrag/kg/postgres_impl.py0get document by file path args: file_path: the file path to search for returns: union[dict[str, any], none]: document daSTRING
HIGHlightrag/kg/redis_impl.py0get document by file path args: file_path: the file path to search for returns: union[dict[str, any], none]: document daSTRING
HIGHlightrag/kg/json_doc_status_impl.py0get document by file path args: file_path: the file path to search for returns: union[dict[str, any], none]: document daSTRING
HIGHlightrag/kg/mongo_impl.py0deterministic digest over candidate doc ids in stable sort order.STRING
HIGHlightrag/kg/postgres_impl.py0deterministic digest over candidate doc ids in stable sort order.STRING
HIGHlightrag/kg/opensearch_impl.py0deterministic digest over candidate doc ids in stable sort order.STRING
HIGHlightrag/kg/json_doc_status_impl.py0deterministic digest over candidate doc ids in stable sort order.STRING
HIGHlightrag/kg/redis_impl.py0deterministic digest over candidate doc ids in stable sort order.STRING
HIGHlightrag/kg/mongo_impl.py0get the total degree (sum of relationships) of two nodes. args: src_id: label of the source node tgt_id: label of the taSTRING
HIGHlightrag/kg/memgraph_impl.py0get the total degree (sum of relationships) of two nodes. args: src_id: label of the source node tgt_id: label of the taSTRING
HIGHlightrag/kg/neo4j_impl.py0get the total degree (sum of relationships) of two nodes. args: src_id: label of the source node tgt_id: label of the taSTRING
HIGHlightrag/kg/mongo_impl.py0check existence of multiple nodes in a single unwind query. args: node_ids: list of node ids to check. returns: set of nSTRING
HIGHlightrag/kg/postgres_impl.py0check existence of multiple nodes in a single unwind query. args: node_ids: list of node ids to check. returns: set of nSTRING
HIGHlightrag/kg/memgraph_impl.py0check existence of multiple nodes in a single unwind query. args: node_ids: list of node ids to check. returns: set of nSTRING
HIGHlightrag/kg/neo4j_impl.py0check existence of multiple nodes in a single unwind query. args: node_ids: list of node ids to check. returns: set of nSTRING
25 more matches not shown…
Unused Imports357 hits · 327 pts
SeverityFileLineSnippetContext
LOWlightrag/pipeline_metrics.py34CODE
LOWlightrag/rerank.py1CODE
LOWlightrag/file_atomic.py29CODE
LOWlightrag/addon_params.py15CODE
LOWlightrag/table_markup.py17CODE
LOWlightrag/llm_roles.py11CODE
LOWlightrag/lightrag.py1CODE
LOWlightrag/lightrag.py201CODE
LOWlightrag/__init__.py3CODE
LOWlightrag/types.py1CODE
LOWlightrag/operate.py1CODE
LOWlightrag/utils.py1CODE
LOWlightrag/utils.py384CODE
LOWlightrag/utils.py384CODE
LOWlightrag/utils.py384CODE
LOWlightrag/pipeline.py12CODE
LOWlightrag/pipeline.py122CODE
LOWlightrag/pipeline.py122CODE
LOWlightrag/storage_migrations.py13CODE
LOWlightrag/exceptions.py1CODE
LOWlightrag/multimodal_context.py64CODE
LOWlightrag/utils_graph.py1CODE
LOWlightrag/prompt.py1CODE
LOWlightrag/utils_pipeline.py10CODE
LOWlightrag/namespace.py1CODE
LOWlightrag/chunk_schema.py24CODE
LOWlightrag/base.py1CODE
LOWlightrag/prompt_multimodal.py31CODE
LOWlightrag/tools/kg_integrity_repair.py38CODE
LOWlightrag/tools/source_conflict_repair.py92CODE
LOWlightrag/tools/source_conflict_repair.py727CODE
LOWlightrag/tools/migrate_graph_storage.py58CODE
LOWlightrag/llm/_error_utils.py14CODE
LOWlightrag/llm/gemini.py10CODE
LOWlightrag/llm/_vision_utils.py20CODE
LOWlightrag/llm/azure_openai.py12CODE
LOWlightrag/llm/azure_openai.py12CODE
LOWlightrag/llm/azure_openai.py12CODE
LOWlightrag/parser/plugins.py25CODE
LOWlightrag/parser/param_schema.py30CODE
LOWlightrag/parser/native_dispatch.py16CODE
LOWlightrag/parser/registry.py16CODE
LOWlightrag/parser/registry.py32CODE
LOWlightrag/parser/_html_table.py13CODE
LOWlightrag/parser/llm_bridge.py17CODE
LOWlightrag/parser/cli.py20CODE
LOWlightrag/parser/_markdown.py10CODE
LOWlightrag/parser/routing.py1CODE
LOWlightrag/parser/debug.py17CODE
LOWlightrag/parser/noop.py18CODE
LOWlightrag/parser/native_base.py15CODE
LOWlightrag/parser/native_base.py33CODE
LOWlightrag/parser/exceptions.py10CODE
LOWlightrag/parser/base.py22CODE
LOWlightrag/parser/base.py31CODE
LOWlightrag/parser/markdown/ir_builder.py20CODE
LOWlightrag/parser/markdown/ir_builder.py23CODE
LOWlightrag/parser/markdown/parser.py41CODE
LOWlightrag/parser/markdown/parser.py87CODE
LOWlightrag/parser/markdown/raw_cache.py22CODE
297 more matches not shown…
Deep Nesting379 hits · 261 pts
SeverityFileLineSnippetContext
LOWreproduce/Step_0.py7CODE
LOWreproduce/Step_3_openai_compatible.py57CODE
LOWreproduce/Step_3.py26CODE
LOWlightrag/rerank.py36CODE
LOWlightrag/rerank.py165CODE
LOWlightrag/rerank.py240CODE
LOWlightrag/table_markup.py133CODE
LOWlightrag/llm_roles.py276CODE
LOWlightrag/lightrag.py1232CODE
LOWlightrag/lightrag.py1656CODE
LOWlightrag/lightrag.py1858CODE
LOWlightrag/lightrag.py3153CODE
LOWlightrag/lightrag.py3464CODE
LOWlightrag/lightrag.py4184CODE
LOWlightrag/lightrag.py5227CODE
LOWlightrag/lightrag.py5689CODE
LOWlightrag/operate.py248CODE
LOWlightrag/operate.py371CODE
LOWlightrag/operate.py1091CODE
LOWlightrag/operate.py1497CODE
LOWlightrag/operate.py1718CODE
LOWlightrag/operate.py1990CODE
LOWlightrag/operate.py2392CODE
LOWlightrag/operate.py2745CODE
LOWlightrag/operate.py3477CODE
LOWlightrag/operate.py3905CODE
LOWlightrag/operate.py4817CODE
LOWlightrag/operate.py5043CODE
LOWlightrag/operate.py6005CODE
LOWlightrag/operate.py6256CODE
LOWlightrag/operate.py4012CODE
LOWlightrag/utils.py150CODE
LOWlightrag/utils.py1011CODE
LOWlightrag/utils.py3921CODE
LOWlightrag/utils.py4237CODE
LOWlightrag/utils.py4363CODE
LOWlightrag/utils.py5051CODE
LOWlightrag/utils.py5595CODE
LOWlightrag/utils.py5623CODE
LOWlightrag/utils.py5861CODE
LOWlightrag/utils.py6060CODE
LOWlightrag/utils.py6191CODE
LOWlightrag/utils.py6319CODE
LOWlightrag/utils.py6698CODE
LOWlightrag/utils.py1058CODE
LOWlightrag/utils.py3363CODE
LOWlightrag/utils.py3488CODE
LOWlightrag/utils.py3573CODE
LOWlightrag/utils.py1269CODE
LOWlightrag/utils.py1368CODE
LOWlightrag/utils.py1473CODE
LOWlightrag/utils.py1631CODE
LOWlightrag/utils.py1730CODE
LOWlightrag/pipeline.py664CODE
LOWlightrag/pipeline.py1644CODE
LOWlightrag/pipeline.py2427CODE
LOWlightrag/pipeline.py2833CODE
LOWlightrag/pipeline.py3842CODE
LOWlightrag/pipeline.py4173CODE
LOWlightrag/pipeline.py4569CODE
319 more matches not shown…
Modern AI Meta-Vocabulary81 hits · 251 pts
SeverityFileLineSnippetContext
MEDIUMREADME-ja.md7# 🚀 LightRAG: シンプルかつ高速な検索拡張生成(RAG)COMMENT
MEDIUMREADME-ja.md259### 軽量なグラフベース RAG フレームワークCOMMENT
MEDIUMREADME.md259### A Lightweight, Graph-Based RAG FrameworkCOMMENT
MEDIUMREADME-zh.md7# 🚀 LightRAG: 简单且快速的检索增强生成(RAG)框架COMMENT
MEDIUMreproduce/Step_1_openai_compatible.py77 # Initialize RAG instanceCOMMENT
MEDIUMreproduce/Step_1.py42 # Initialize RAG instanceCOMMENT
MEDIUMlightrag/constants.py41# pushing an otherwise-valid chunk past the provider context window; over budgetCOMMENT
MEDIUMlightrag/constants.py713# over the embedding model's context limit after chunking. Independent fromCOMMENT
MEDIUMlightrag/operate.py322 # embedding model's own context limit — not a real-world budget.COMMENT
MEDIUMlightrag/operate.py4035 # an otherwise-valid chunk past the provider context window. When theCOMMENT
MEDIUMlightrag/pipeline.py2195 # Pipeline orchestrationCOMMENT
MEDIUMlightrag/pipeline.py173# fully event-driven (``await get_document()``) and never polls.COMMENT
MEDIUMlightrag/pipeline.py6799 # absolute legacy RAG-Anything/MinerU path, a ``..`` escape)COMMENT
MEDIUMlightrag/pipeline.py7027 # it for their model's context window.COMMENT
MEDIUMlightrag/tools/download_cache.py158 "text-embedding-ada-002", # Legacy embedding modelCODE
MEDIUMlightrag/tools/download_cache.py159 "text-embedding-3-small", # Small embedding modelCODE
MEDIUMlightrag/tools/download_cache.py160 "text-embedding-3-large", # Large embedding modelCODE
MEDIUMlightrag/tools/source_conflict_repair.py751 # embedding model — full_docs is a plain KV, and reading it is what lets theCOMMENT
MEDIUMlightrag/tools/migrate_graph_storage.py569# Async orchestration — preconditions, write pipeline, compensationCOMMENT
MEDIUMlightrag/llm/gemini.py562 # model that burned the whole output budget on its reasoning trace isCOMMENT
MEDIUMlightrag/llm/gemini.py622 # A thinking model that spent its whole budget on the reasoning traceCOMMENT
MEDIUMlightrag/llm/binding_options.py632 # Whether the model may emit a hidden reasoning trace before its answer.COMMENT
MEDIUMlightrag/llm/ollama.py325 # the reasoning trace). Raise like the OpenAI binding does,COMMENT
MEDIUMlightrag/parser/docx/parse_document.py667 # (guardrails.is_visually_centered).COMMENT
MEDIUMlightrag/parser/docx/parse_document.py1168 # --- smart path (pipeline + landing guardrails) ---------------COMMENT
MEDIUMlightrag/parser/docx/parse_document.py1188 # Landing guardrails: any violation abandons the smart output for THISCOMMENT
MEDIUMlightrag/parser/docx/parse_document.py1242 # three counts come from guardrails.plan_toc_output — the single visibilityCOMMENT
MEDIUMlightrag/parser/docx/smart_heading/features.py341 #: is not visually centered (``guardrails.is_visually_centered``).COMMENT
MEDIUMlightrag/parser/docx/smart_heading/features.py431#: unit :func:`leading_pad_em` reports and ``guardrails.CENTER_MAX_LEADING_PAD_EM``COMMENT
MEDIUMlightrag/parser/docx/smart_heading/heading_flow.py2710# whole-document orchestrationCOMMENT
MEDIUMlightrag/parser/docx/smart_heading/heading_flow.py1842#: - _Medical Graph RAG.docx's author line (96) absorbing its affiliation lineCOMMENT
MEDIUMlightrag/parser/docx/smart_heading/guardrails.py560# Landing guardrails: canonicalization, I1/I2/I3 machine checks, TOCCOMMENT
MEDIUMlightrag/parser/docx/smart_heading/guardrails.py246 # dependency parser hallucinates sentence boundaries mid-word on shortCOMMENT
MEDIUMlightrag/parser/docx/smart_heading/title_block.py1046 # candidate reuses single=True judge semantics (± context window; aCOMMENT
MEDIUMlightrag/kg/mongo_impl.py3998 # built under a *different* embedding model must NOT beCOMMENT
MEDIUMlightrag/kg/postgres_impl.py2313 # with proper embedding model and dimension suffix for data isolationSTRING
MEDIUMlightrag/kg/faiss_impl.py1202 # the `is pdoc` identity check is defensive scaffolding: today theCOMMENT
MEDIUMlightrag/kg/scan_job_store.py227 # Timestamps, version, counters_dropped and the JSON scaffolding.COMMENT
MEDIUMlightrag/api/config.py391 # RAG configurationCOMMENT
MEDIUMlightrag/api/utils_api.py690 # RAG ConfigurationSTRING
MEDIUMlightrag/api/lightrag_server.py714 # embedding model is configured. Without this, the provider's decoratorCOMMENT
MEDIUMlightrag/api/lightrag_server.py2332 # Initialize RAG with unified configurationCOMMENT
MEDIUMlightrag/api/lightrag_server.py2753 # embedding model configuration binding/host address (if applicable)/model (if applicable)COMMENT
MEDIUMlightrag/evaluation/eval_rag_quality.py19 # Specify custom RAG endpointSTRING
MEDIUMlightrag/evaluation/eval_rag_quality.py419 # all RAG responses from being generated at once when eval is slowCOMMENT
MEDIUMlightrag/evaluation/eval_rag_quality.py424 # Stage 1: Generate RAG responseCOMMENT
MEDIUMlightrag/evaluation/eval_rag_quality.py572 # Stage 1: RAG generation - allow x2 concurrency to keep evaluation fedCOMMENT
MEDIUMlightrag/evaluation/eval_rag_quality.py598 max_connections=(max_async + 1) * 2, # Allow buffer for RAG stageCODE
MEDIUMlightrag/evaluation/eval_rag_quality.py976 # Specify custom RAG endpointCOMMENT
MEDIUM…ation/sample_documents/05_evaluation_and_deployment.md1# RAG Evaluation Metrics and DeploymentCOMMENT
MEDIUM…ation/sample_documents/05_evaluation_and_deployment.md3## Key RAG Evaluation MetricsCOMMENT
MEDIUM…rag/evaluation/sample_documents/02_rag_architecture.md1# RAG System ArchitectureCOMMENT
MEDIUM…rag/evaluation/sample_documents/02_rag_architecture.md3## Main Components of RAG SystemsCOMMENT
MEDIUM…valuation/sample_documents/03_lightrag_improvements.md1# LightRAG Improvements Over Traditional RAGCOMMENT
MEDIUMtests/test_doc_processing_status_from_stored.py34 # The RAG-Anything shape from HKUDS/RAG-Anything#73COMMENT
MEDIUMtests/tools/test_migrate_graph_storage.py434# Async orchestration — fakes standing in for the storage backendsCOMMENT
MEDIUMtests/workspace/test_workspace_isolation.py547 # Purpose: Validate guardrails for workspace normalization and namespaceCOMMENT
MEDIUMtests/workspace/test_workspace_isolation.py1076 # Test 11.2: Insert different data to each RAG instance (CONCURRENTLY)COMMENT
MEDIUMtests/parser/docx/test_smart_heading_flow.py2892# These tests use the REAL guardrails.strong_body_reason: every record eitherCOMMENT
MEDIUMtests/kg/qdrant_impl/test_qdrant_migration.py214 # Use a large embedding modelCOMMENT
21 more matches not shown…
Docstring Block Structure50 hits · 250 pts
SeverityFileLineSnippetContext
HIGHlightrag/lightrag.py297Drive an async coroutine to completion from a synchronous wrapper. The synchronous wrappers (``insert``, ``query``,STRING
HIGHlightrag/utils.py2256 Execute function with enhanced priority-based concurrency control and timeout handling Args: STRING
HIGHlightrag/utils.py7014Validate a workspace name used to build per-workspace directories. File-based storages place their data in a subdirSTRING
HIGHlightrag/utils.py7315Reject a node/edge attribute mapping no graph backend could store. Args: attributes: Attribute mapping abouSTRING
HIGHlightrag/utils.py7337Reject attribute names a backend would read as something other than a name. The *interpretation* rule, not the seriSTRING
HIGHlightrag/utils.py7387Reject attribute names or values XML cannot encode. For a GraphML-backed store. Names are checked as well as valuesSTRING
HIGHlightrag/utils.py7414Reject attribute values no graph backend can store. See ``graph_attribute_value_rejection`` for the rules and `STRING
HIGHlightrag/pipeline.py677 Pipeline for Processing Documents 1. Validate ids if provided or generate MD5 hash IDs and remove duplSTRING
HIGHlightrag/utils_graph.py61Return *data* reduced to well-typed, storable graph attributes. Two call shapes, because the two families of callerSTRING
HIGHlightrag/tools/clean_llm_query_cache.py252Initialize storage instance with fallback to config.ini and defaults Args: storage_name: Storage imSTRING
HIGHlightrag/tools/migrate_llm_cache.py289Initialize storage instance with fallback to config.ini and defaults Args: storage_name: Storage imSTRING
HIGHlightrag/llm/jina.py85Generate embeddings for a list of texts using Jina AI's API. Args: texts: List of texts to embed. mSTRING
HIGHlightrag/llm/voyageai.py64Generate embeddings for a list of texts using VoyageAI's API. Args: texts: List of texts to embed. STRING
HIGHlightrag/llm/gemini.py307 Complete a prompt using Gemini's API with Chain of Thought (COT) support. This function supports automatic intSTRING
HIGHlightrag/llm/gemini.py716Generate embeddings for a list of texts using Gemini's API. This function uses Google's Gemini embedding model to gSTRING
HIGHlightrag/llm/openai.py323Complete a prompt using OpenAI's API with caching support and Chain of Thought (COT) integration. This function supSTRING
HIGHlightrag/llm/openai.py1070Generate embeddings for a list of texts using OpenAI's API with automatic text truncation. This function supports bSTRING
HIGHlightrag/parser/docx/utils.py96 Create Gemini client for AI Studio or Vertex AI. Supports two modes: - AI Studio (default): Uses GOOGLE_APSTRING
HIGHlightrag/parser/docx/utils.py173 Create OpenAI client with optional custom base URL. Environment variables: - OPENAI_API_KEY: Required API STRING
HIGHlightrag/parser/docx/table_extractor.py250 Extract table to 2D string array with metadata (paraIds, header info). Vertical merge behavior: STRING
HIGHlightrag/kg/postgres_impl.py789 Execute a database operation with automatic retry for transient failures. Args: operation:STRING
HIGHlightrag/kg/memgraph_impl.py135 Check if a node exists in the graph. Args: node_id: The ID of the node to check. STRING
HIGHlightrag/kg/memgraph_impl.py175 Check if an edge exists between two nodes in the graph. Args: source_node_id: The ID of thSTRING
HIGHlightrag/kg/memgraph_impl.py223Get node by its label identifier, return only node properties Args: node_id: The node label to lookSTRING
HIGHlightrag/kg/memgraph_impl.py278Get the degree (number of relationships) of a node with the given label. If multiple nodes have the same label, STRING
HIGHlightrag/kg/memgraph_impl.py365Retrieves all edges (relationships) for a particular node identified by its label. Args: source_nodSTRING
HIGHlightrag/kg/memgraph_impl.py440Get edge properties between two nodes. Args: source_node_id: Label of the source node tSTRING
HIGHlightrag/kg/neo4j_impl.py476 Check if a node with the given label exists in the database Args: node_id: Label of the noSTRING
HIGHlightrag/kg/neo4j_impl.py510 Check if an edge exists between two nodes Args: source_node_id: Label of the source node STRING
HIGHlightrag/kg/neo4j_impl.py552Get node by its label identifier, return only node properties Args: node_id: The node label to lookSTRING
HIGHlightrag/kg/neo4j_impl.py643Get the degree (number of relationships) of a node with the given label. If multiple nodes have the same label, STRING
HIGHlightrag/kg/neo4j_impl.py780Get edge properties between two nodes. Args: source_node_id: Label of the source node tSTRING
HIGHlightrag/kg/neo4j_impl.py914Retrieves all edges (relationships) for a particular node identified by its label. Args: source_nodSTRING
HIGHlightrag/api/auth.py183 Validate JWT token Args: token: JWT token Returns: dict: Dictionary cSTRING
HIGHlightrag/api/routers/graph_routes.py786 Delete an entity and all its relationships from the knowledge graph. Args: request (DeleteSTRING
HIGHlightrag/api/routers/graph_routes.py822 Delete a relationship between two entities from the knowledge graph. Args: request (DeleteSTRING
HIGHlightrag/api/routers/query_routes.py448 Comprehensive RAG query endpoint with non-streaming response. Parameter "stream" is ignored. **Query MSTRING
HIGHlightrag/api/routers/query_routes.py737 Advanced RAG query endpoint with flexible streaming response. This endpoint provides the most flexibleSTRING
HIGHlightrag/api/routers/query_routes.py1310 Advanced data retrieval endpoint for structured RAG analysis. This endpoint provides raw retrieval resSTRING
HIGHlightrag/api/routers/document_routes.py265 Validate an uploaded filename and return it unchanged when safe. Uploaded filenames are document identifiers aSTRING
HIGHlightrag/api/routers/document_routes.py5200 Upload a file to the input directory and index it. This API endpoint accepts a file through an HTTP POSTRING
HIGHlightrag/api/routers/document_routes.py5531 Insert text into the RAG system. This endpoint allows you to insert text data into the RAG system for STRING
HIGHlightrag/api/routers/document_routes.py5663 Insert multiple texts into the RAG system. This endpoint allows you to insert multiple text entries inSTRING
HIGHlightrag/api/routers/document_routes.py6368 Delete documents and all their associated data by their IDs using background processing. Deletes speciSTRING
HIGHlightrag/api/routers/document_routes.py6491 Clear all cache data from the LLM response cache storage. This endpoint clears all cached LLM responseSTRING
HIGHlightrag/api/routers/document_routes.py6525 Get the processing status of documents by tracking ID. This endpoint retrieves all documents associateSTRING
HIGHlightrag/api/routers/document_routes.py6601 Get documents with pagination support. This endpoint retrieves documents with pagination, filtering, aSTRING
HIGHlightrag/evaluation/eval_rag_quality.py295 Generate RAG response by calling LightRAG API. Args: question: The user query. STRING
HIGHlightrag/chunker/paragraph_semantic.py2060Paragraph Semantic Chunking — the ``chunking="P"`` strategy. Reads structured blocks from a ``.blocks.jsonl`` sidecSTRING
HIGHtests/api/test_lightrag_ollama_chat.py147Send an HTTP request with retry mechanism Args: url: Request URL data: Request data stream: STRING
Magic Placeholder Names37 hits · 195 pts
SeverityFileLineSnippetContext
HIGHtests/setup/test_misc.py297 "LLM_BINDING_API_KEY=your_api_key",STRING
HIGHtests/setup/test_misc.py302 "EMBEDDING_BINDING_API_KEY=your_api_key",STRING
HIGHdocs/LightRAG-API-Server.md149LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server.md155# EMBEDDING_BINDING_API_KEY=your_api_keyCOMMENT
HIGHdocs/LightRAG-API-Server.md166# LLM_BINDING_API_KEY=your_api_keyCOMMENT
HIGHdocs/LightRAG-API-Server.md174# EMBEDDING_BINDING_API_KEY=your_api_keyCOMMENT
HIGHdocs/LightRAG-API-Server.md298LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server.md309EMBEDDING_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server.md815LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server.md1114LLM_BINDING_API_KEY=your-api-keyCODE
HIGHdocs/ParserServiceDeployment.md48 "api_key": "your_api_key",CODE
HIGHdocs/ProgramingWithCore.md978export OPENAI_API_KEY=your-api-keyCODE
HIGHdocs/ProgramingWithCore.md992OPENAI_API_KEY=your-api-key \CODE
HIGHdocs/ParserServiceDeployment-zh.md48 "api_key": "your_api_key",CODE
HIGHdocs/RoleSpecificLLMConfiguration-zh.md26LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/RoleSpecificLLMConfiguration-zh.md126LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/RoleSpecificLLMConfiguration-zh.md207LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/RoleSpecificLLMConfiguration-zh.md224LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/RoleSpecificLLMConfiguration-zh.md337LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server-zh.md149LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server-zh.md155# EMBEDDING_BINDING_API_KEY=your_api_keyCOMMENT
HIGHdocs/LightRAG-API-Server-zh.md166# LLM_BINDING_API_KEY=your_api_keyCOMMENT
HIGHdocs/LightRAG-API-Server-zh.md174# EMBEDDING_BINDING_API_KEY=your_api_keyCOMMENT
HIGHdocs/LightRAG-API-Server-zh.md298LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server-zh.md309EMBEDDING_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server-zh.md815LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/LightRAG-API-Server-zh.md1114LLM_BINDING_API_KEY=your-api-keyCODE
HIGHdocs/RoleSpecificLLMConfiguration.md26LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/RoleSpecificLLMConfiguration.md126LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/RoleSpecificLLMConfiguration.md207LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/RoleSpecificLLMConfiguration.md224LLM_BINDING_API_KEY=your_api_keyCODE
HIGHdocs/RoleSpecificLLMConfiguration.md337LLM_BINDING_API_KEY=your_api_keyCODE
HIGHexamples/lightrag_gemini_postgres_demo.py28 GEMINI_API_KEY=your-api-keySTRING
HIGHexamples/lightrag_gemini_demo.py37 "Please set it with: export GEMINI_API_KEY='your-api-key'"CODE
HIGHexamples/lightrag_openai_opensearch_graph_demo.py23 OPENAI_API_KEY=your-api-keySTRING
HIGH…s/unofficial-sample/lightrag_llamaindex_direct_demo.py29OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY", "your-api-key-here")CODE
HIGHexamples/unofficial-sample/lightrag_cloudflare_demo.py20cloudflare_api_key = "YOUR_API_KEY"CODE
Over-Commented Block286 hits · 192 pts
SeverityFileLineSnippetContext
LOWdocker-compose.podman.yml1# Podman-compatible compose file for LightRAGCOMMENT
LOWdocker-entrypoint.sh1#!/bin/shCOMMENT
LOWdocker-entrypoint.sh21 # process can read/write them, covering bind-mounts/PVCs whose host contentCOMMENT
LOWrequirements-offline-smart-heading.txt1# LightRAG Offline Dependencies - Native docx smart_heading (optional)COMMENT
LOWlightrag/lightrag.py1101 # paragraphs together. ``default_chunker_config`` alreadyCOMMENT
LOWlightrag/lightrag.py1181 self._ensure_addon_params_cache()COMMENT
LOWlightrag/lightrag.py1941 "pipeline_status", workspace=self.workspaceCOMMENT
LOWlightrag/lightrag.py2101 prior_truncation = existing_journal["prior_llm_truncation"]COMMENT
LOWlightrag/lightrag.py2221 _operation_truncation_record(),COMMENT
LOWlightrag/lightrag.py2381 # write PROCESSED (the commit record) last with theCOMMENT
LOWlightrag/lightrag.py2461 # slot nor wrote any data, so we must NOT flush/discard the SHAREDCOMMENT
LOWlightrag/lightrag.py2541 try:COMMENT
LOWlightrag/lightrag.py2841 # has_custom_chunk_journal flag (no per-row hydration).COMMENT
LOWlightrag/lightrag.py3701 namespace = f"{workspace}:GraphDB" if workspace else "GraphDB"COMMENT
LOWlightrag/lightrag.py4801 # purge from destroying the chunk rows and anchor rows that are theCOMMENT
LOWlightrag/lightrag.py5921 )COMMENT
LOWlightrag/lightrag.py6101 # Delegated to the shared primitive rather than reimplemented hereCOMMENT
LOWlightrag/lightrag.py6281 finally:COMMENT
LOWlightrag/constants.py121# Bounds on any separator cascade, wherever it comes from. The recursive splitterCOMMENT
LOWlightrag/constants.py141# CHUNK_SIZE default — heading-aligned paragraph merging needs moreCOMMENT
LOWlightrag/constants.py161# the ingestion path bounds: MAX_UPLOAD_SIZE bounds the compressed artifact onCOMMENT
LOWlightrag/constants.py181# class — so the DOCX_* knobs below bound all three, enforced in the legacyCOMMENT
LOWlightrag/constants.py201# above, these cap the bytes materialized into ``*.blocks.assets``: one imageCOMMENT
LOWlightrag/constants.py221# Overall wall-clock budget for downloading the result bundle from doclingCOMMENT
LOWlightrag/constants.py241# Native docx smart_heading (opt-in engine param) tunables. Each DEFAULT_*COMMENT
LOWlightrag/constants.py261 "年,月,日,时,分,秒,个,人,只,条,次,项,天,号,元,角,件,名,台,种,倍,"COMMENT
LOWlightrag/constants.py281# anchor, which is why there is no longer an IMPRINT_SPACE_PREFIXES knob);COMMENT
LOWlightrag/constants.py301# rich physical outline naturally admits more candidates, so the effectiveCOMMENT
LOWlightrag/constants.py321# CB4 per-sub-document gate: once the whole document clears the gate above,COMMENT
LOWlightrag/constants.py341# paragraphs (0 disables the auxiliary body-run break; the primary closeCOMMENT
LOWlightrag/constants.py361# Marker prefix for full_docs.content when format=lightrag.COMMENT
LOWlightrag/constants.py381# Reserved doc_status.metadata key recording how far this document's KG writeCOMMENT
LOWlightrag/constants.py421)COMMENT
LOWlightrag/constants.py521# Whether a doc_status backend missing a strict capability is a startup failureCOMMENT
LOWlightrag/constants.py541# retries and ``/documents/scan`` bulk enqueues deliberately break through theCOMMENT
LOWlightrag/constants.py561# Enabled by default. It used to be ``0`` and to cover three ingestion routesCOMMENT
LOWlightrag/constants.py581# Input ceilings for the model-facing request fields. Deliberately NOT env knobs:COMMENT
LOWlightrag/constants.py621# limit. Deliberately fixed process-wide constants rather than anything derivedCOMMENT
LOWlightrag/constants.py641# exclusive reset acknowledges it — so an operator hammering /reprocess_failedCOMMENT
LOWlightrag/constants.py661# characters because that is what is being bounded (CJK is 3 bytes/char).COMMENT
LOWlightrag/constants.py681# DEFAULT_PROCESSING_PRIORITY so analysis and ingestion work share the EXTRACTCOMMENT
LOWlightrag/constants.py721# Default llm and embedding timeoutCOMMENT
LOWlightrag/constants.py741# workers); other waiters back off exponentially up to the DEFERRED cap.COMMENT
LOWlightrag/constants.py781ROLLBACK_REPORT_SAMPLE_CAP = 32COMMENT
LOWlightrag/operate.py2141 if all_keywordsCOMMENT
LOWlightrag/operate.py2821 if relation_chunks_storage is not None:COMMENT
LOWlightrag/operate.py2921 # of distinct contributing sources. On reprocess/resume the same sourceCOMMENT
LOWlightrag/operate.py4021 chunk_key = chunk_key_dp[0]COMMENT
LOWlightrag/operate.py4401 # every run of the same document. That permutation reaches persisted stateCOMMENT
LOWlightrag/utils.py2701#COMMENT
LOWlightrag/utils.py2961# ---------------------------------------------------------------------------COMMENT
LOWlightrag/utils.py3021# the event loop: ``write_json`` for the JSON KV / doc-status stores,COMMENT
LOWlightrag/utils.py3241 # reliable token-to-character mapping; see ``TiktokenTokenizer`` below forCOMMENT
LOWlightrag/utils.py3461COMMENT
LOWlightrag/utils.py3661COMMENT
LOWlightrag/utils.py5481 if not text:COMMENT
LOWlightrag/utils.py6721COMMENT
LOWlightrag/utils.py7061COMMENT
LOWlightrag/utils.py7221 return NoneCOMMENT
LOWlightrag/pipeline.py161# §7.3) — never as a side effect of an unrelated upload or rescan.COMMENT
226 more matches not shown…
Redundant / Tautological Comments140 hits · 191 pts
SeverityFileLineSnippetContext
LOWdocker-build-push.sh38# Check if buildx builder exists, create if notCOMMENT
LOWlightrag/lightrag.py4285 # Check if query_result is NoneCOMMENT
LOWlightrag/operate.py3042 # Check if this is a placeholder recordCOMMENT
LOWlightrag/operate.py3952 # Check if JSON structured output mode is enabledCOMMENT
LOWlightrag/operate.py4395 # Check if any task raised an exception and ensure all exceptions are retrieved.COMMENT
LOWlightrag/operate.py4762 # Check if pre-defined keywords are already providedCOMMENT
LOWlightrag/operate.py6349 # Check if any relations still have chunks after deduplicationCOMMENT
LOWlightrag/utils.py305 # Check if the resolved path is within the base directoryCOMMENT
LOWlightrag/utils.py474 # Check if record has the required attributes for an access logCOMMENT
LOWlightrag/utils.py651 # Check if func is already an EmbeddingFunc instance and unwrap itCOMMENT
LOWlightrag/utils.py674 # Check if user provided embedding_dim parameterCOMMENT
LOWlightrag/utils.py698 # Check if underlying function supports max_token_size and inject if not providedCOMMENT
LOWlightrag/utils.py711 # Check if total elements can be evenly divided by embedding_dimCOMMENT
LOWlightrag/utils.py1398 # Check if task was cancelled before worker startedCOMMENT
LOWlightrag/utils.py4171 # Check if we already have identical content cachedCOMMENT
LOWlightrag/utils.py5846 # Check if there are still unused chunksCOMMENT
LOWlightrag/utils.py6117 # Check if results are in the new index-based formatCOMMENT
LOWlightrag/pipeline.py2895 # Check if corresponding content exists in full_docs. Strict whereCOMMENT
LOWlightrag/pipeline.py2904 # Check if this is a failed document that should be preservedCOMMENT
LOWlightrag/storage_migrations.py34 # Check if migration is needed:COMMENT
LOWlightrag/storage_migrations.py54 # Check if full_entities and full_relations are emptyCOMMENT
LOWlightrag/utils_graph.py343 # Check if the entity existsCOMMENT
LOWlightrag/utils_graph.py444 # Check if the relation existsCOMMENT
LOWlightrag/utils_graph.py1266 # Check if storage has existing dataCOMMENT
LOWlightrag/utils_graph.py1419 # Check if the normalized entity already exists.COMMENT
LOWlightrag/utils_graph.py1564 # Check if both entities existCOMMENT
LOWlightrag/utils_graph.py1573 # Check if relation already existsCOMMENT
LOWlightrag/base.py261 # Check if model_name exists (model_name is optional in EmbeddingFunc)COMMENT
LOWlightrag/tools/clean_llm_query_cache.py207 # Check if config.ini has configurationCOMMENT
LOWlightrag/tools/clean_llm_query_cache.py971 # Check if choice is validCOMMENT
LOWlightrag/tools/clean_llm_query_cache.py1069 # Check if user cancelledCOMMENT
LOWlightrag/tools/clean_llm_query_cache.py1131 # Check if there are any records to deleteCOMMENT
LOWlightrag/tools/download_cache.py131 # Check if TIKTOKEN_CACHE_DIR is already set in environmentCOMMENT
LOWlightrag/tools/check_initialization.py101 # Print resultsCOMMENT
LOWlightrag/tools/migrate_llm_cache.py237 # Check if storage requires configurationCOMMENT
LOWlightrag/tools/migrate_llm_cache.py244 # Check if has environment variablesCOMMENT
LOWlightrag/tools/migrate_llm_cache.py249 # Check if has config.ini configurationCOMMENT
LOWlightrag/tools/migrate_llm_cache.py216 # Check if config.ini has configurationCOMMENT
LOWlightrag/tools/migrate_llm_cache.py1068 # Check if choice is validCOMMENT
LOWlightrag/tools/migrate_llm_cache.py1438 # Check if user cancelled (setup_storage returns None for all fields)COMMENT
LOWlightrag/tools/migrate_llm_cache.py1442 # Check if there are at least 2 storage types availableCOMMENT
LOWlightrag/llm/jina.py28 # Check if the error response is HTML (common for 502, 503, etc.)COMMENT
LOWlightrag/llm/gemini.py262 # Check if this part is thought content using the 'thought' attributeCOMMENT
LOWlightrag/llm/binding_options.py296 # Check if this is a dataclass and use dataclass fieldsCOMMENT
LOWlightrag/llm/openai.py589 # Check if this chunk has usage information (final chunk)COMMENT
LOWlightrag/llm/openai.py596 # Check if choices exists and is not emptyCOMMENT
LOWlightrag/llm/openai.py604 # Check if delta existsCOMMENT
LOWlightrag/llm/openai.py53 # Check if required Langfuse environment variables are setCOMMENT
LOWlightrag/llm/openai.py820 # Check if we should include reasoning contentCOMMENT
LOWlightrag/parser/docx/utils.py373 # Check if it mentions billing which indicates permanent quota issueCOMMENT
LOWlightrag/kg/qdrant_impl.py329 # Check if legacy collection has workspace_id to determine migration strategyCOMMENT
LOWlightrag/kg/qdrant_impl.py440 # Check if we've reached the endCOMMENT
LOWlightrag/kg/networkx_impl.py349 # Check if data needs to be reloadedCOMMENT
LOWlightrag/kg/networkx_impl.py734 # Check if graph is truncatedCOMMENT
LOWlightrag/kg/networkx_impl.py745 # Check if node existsCOMMENT
LOWlightrag/kg/networkx_impl.py796 # Add neighbors to the queue with their degreesCOMMENT
LOWlightrag/kg/networkx_impl.py801 # Check if there are unexplored neighbors (skipped due to depth limit)COMMENT
LOWlightrag/kg/networkx_impl.py809 # Check if we've reached max_nodesCOMMENT
LOWlightrag/kg/networkx_impl.py818 # Check if graph is truncated - either due to max_nodes limit or depth limitCOMMENT
LOWlightrag/kg/networkx_impl.py947 # Check if storage was updated by another processCOMMENT
80 more matches not shown…
Self-Referential Comments46 hits · 138 pts
SeverityFileLineSnippetContext
MEDIUMreproduce/Step_1_openai_compatible.py77 # Initialize RAG instanceCOMMENT
MEDIUMreproduce/Step_1.py42 # Initialize RAG instanceCOMMENT
MEDIUMlightrag/lightrag.py1374 # Create a NEW EmbeddingFunc instance with the wrapped func to avoid mutating the caller's objectCOMMENT
MEDIUMlightrag/lightrag.py4091 # Create a copy of param to avoid modifying the originalCOMMENT
MEDIUMlightrag/operate.py6564 # Create a preliminary system prompt with empty content_data to calculate overheadCOMMENT
MEDIUMlightrag/utils.py6900 # Create a list of (file_path, count, first_index) tuplesCOMMENT
MEDIUMlightrag/pipeline.py1351 # Create a new record with unique ID for this duplicate attemptCOMMENT
MEDIUMlightrag/tools/migrate_llm_cache.py716 # Create a snapshot of matching items while holding the lockCOMMENT
MEDIUMlightrag/llm/openai.py229 # Create a merged config dict with precedence: explicit params > client_configsCOMMENT
MEDIUMlightrag/llm/openai.py263 # Create a merged config dict with precedence: explicit params > client_configs > defaultsCOMMENT
MEDIUMlightrag/llm/openai.py443 # Create the OpenAI client (supports both OpenAI and Azure)COMMENT
MEDIUMlightrag/llm/openai.py1166 # Create the OpenAI client (supports both OpenAI and Azure)COMMENT
MEDIUMlightrag/llm/bedrock.py347 # Create a session that will be used throughout the streaming processCOMMENT
MEDIUMlightrag/llm/bedrock.py358 # Define the generator function that will manage the client lifecycleCOMMENT
MEDIUMlightrag/kg/mongo_impl.py3747 # Create the improved search index (async, no waiting)COMMENT
MEDIUMlightrag/kg/mongo_impl.py489 # Create a copy of v for $set operation, excluding create_time to avoid conflictsCOMMENT
MEDIUMlightrag/kg/mongo_impl.py4149 # Define the aggregation pipeline with the converted query vectorCOMMENT
MEDIUMlightrag/kg/postgres_impl.py2170 # Define the field changes neededCOMMENT
MEDIUMlightrag/kg/faiss_impl.py269 # Create an empty Faiss index for inner product (useful for normalized vectors = cosine similarity).COMMENT
MEDIUMlightrag/kg/shared_storage.py62# Define a direct print function for critical logs that must be visible in all processesCOMMENT
MEDIUMlightrag/kg/shared_storage.py1671 # Create a shared list object for history_messagesCOMMENT
MEDIUMlightrag/kg/shared_storage.py3554 # Create a simple mutable object to store boolean value for compatibility with mutiprocessCOMMENT
MEDIUMlightrag/api/run_with_gunicorn.py147 # Define a custom application class that loads our configCOMMENT
MEDIUMlightrag/api/run_with_gunicorn.py277 # Create the applicationCOMMENT
MEDIUMlightrag/api/lightrag_server.py1024 # Create the EmbeddingFunc instance (now returns complete EmbeddingFunc with max_token_size)COMMENT
MEDIUMlightrag/api/routers/ollama_api.py210 # Create an instance of the modelCOMMENT
MEDIUMlightrag/api/routers/query_routes.py547 # Create a mapping from reference_id to chunk contentCOMMENT
MEDIUMlightrag/api/routers/document_routes.py4698 # Create the bounded job record BEFORE publishing the manual intentCOMMENT
MEDIUMtests/kg/test_graph_storage.py152 # Initialize the storage instanceCOMMENT
MEDIUMtests/kg/postgres_impl/test_postgres_index_name.py84 # Create a table name that results in exactly 63 bytesCOMMENT
MEDIUMtests/chunker/test_rerank_chunking.py90 # Create a very long document that exceeds character limitCOMMENT
MEDIUMexamples/graph_visual_with_html.py15# Create a Pyvis networkCOMMENT
MEDIUMexamples/lightrag_openai_compatible_demo.py150 # Initialize RAG instanceCOMMENT
MEDIUMexamples/lightrag_openai_mongodb_graph_demo.py72 # Initialize RAG instanceCOMMENT
MEDIUMexamples/lightrag_openai_demo.py119 # Initialize RAG instanceCOMMENT
MEDIUMexamples/lightrag_ollama_demo.py139 # Initialize RAG instanceCOMMENT
MEDIUMexamples/graph_visual_with_neo4j.py159 # Create a Neo4j driverSTRING
MEDIUM…mples/unofficial-sample/lightrag_embedding_prefixes.py156 # Initialize RAG instanceCOMMENT
MEDIUM…/unofficial-sample/lightrag_llamaindex_litellm_demo.py103 # Initialize RAG instanceCOMMENT
MEDIUM…cial-sample/lightrag_openai_neo4j_milvus_redis_demo.py73 # Initialize RAG instanceCOMMENT
MEDIUM…s/unofficial-sample/lightrag_llamaindex_direct_demo.py101 # Initialize RAG instanceCOMMENT
MEDIUM…ficial-sample/lightrag_llamaindex_litellm_opik_demo.py114 # Initialize RAG instanceCOMMENT
MEDIUMexamples/unofficial-sample/lightrag_cloudflare_demo.py251 # Initialize RAG instanceCOMMENT
MEDIUMexamples/unofficial-sample/lightrag_lmdeploy_demo.py69 # Initialize RAG instanceCOMMENT
MEDIUMexamples/unofficial-sample/lightrag_nvidia_demo.py123 # Initialize RAG instanceCOMMENT
MEDIUMscripts/setup/apple-container.sh272 # This file is a copy of the user's .env (real API keys) — keep it private.COMMENT
Cross-Language Confusion21 hits · 96 pts
SeverityFileLineSnippetContext
HIGHlightrag/utils.py6507 ``{"chunk_ids": null}``), which mean UNKNOWN. Only in the UNKNOWN case may aSTRING
HIGHlightrag/utils.py7277 ``SET n += {k: null}`` silently *deletes* the property.STRING
HIGHlightrag/parser/docx/parser.py149 # ``positions: [{"type": "paraid", "range": null}]``.COMMENT
HIGHlightrag/parser/docx/smart_heading/title_block.py1129- If false: set all six text fields to null, and classify EVERY index — {indices} — into exactly one of "headings" (a reCODE
HIGHlightrag/parser/docx/smart_heading/title_block.py1132{{"is_title_block": true|false, "main_title": string|null, "sub_title": string|null, "doc_number": string|null, "classifCODE
HIGHlightrag/kg/pgtable_impl.py753 properties = lightrag_graph_nodes.properties || EXCLUDED.properties,CODE
HIGHlightrag/kg/pgtable_impl.py1513 properties = lightrag_graph_nodes.properties || EXCLUDED.properties,CODE
HIGHlightrag/kg/mongo_impl.py1351 # every doc with a real (non-null, existing) value.COMMENT
HIGHlightrag/kg/postgres_impl.py7231 " $1::text || E'\\x01' ||"CODE
HIGHlightrag/kg/postgres_impl.py5936 CURRENT_TIMESTAMP) sort FIRST and encode as ``[null, id]`` so theSTRING
HIGHlightrag/api/lightrag_server.py139 if (!data || data.type !== 'lightrag:set-docs-theme') return;CODE
HIGHlightrag/api/routers/graph_routes.py374 "merge_error": null,STRING
HIGHlightrag/api/routers/graph_routes.py376 "target_entity": null,STRING
HIGHlightrag/api/routers/graph_routes.py402 "merge_error": null,STRING
HIGHtests/kg/postgres_impl/test_pg_scheduling_pages.py199 the cursor encodes [null, id] instead of failing closed — a row-valueSTRING
HIGH…sts/kg/postgres_impl/test_postgres_cypher_injection.py202 "formula": "x < 5 && y > 3",CODE
HIGH…sts/kg/postgres_impl/test_postgres_cypher_injection.py213 assert '`formula`: "x < 5 && y > 3"' in call["sql"]CODE
HIGH…s/kg/postgres_impl/test_postgres_upsert_edge_cypher.py183 assert "$1::text || E'\\x01' ||" in lock_sqlCODE
HIGHtests/kg/neo4j_impl/test_search_labels_sanitize.py34 ("foo && bar", "foo bar"),CODE
HIGHtests/kg/pgtable_impl/test_pgtable_graph_storage.py350 assert "lightrag_graph_nodes.properties || EXCLUDED.properties" in sqlCODE
HIGHtests/kg/pgtable_impl/test_pgtable_graph_storage.py366 assert "lightrag_graph_nodes.properties || EXCLUDED.properties" in sqlCODE
Fake / Example Data66 hits · 62 pts
SeverityFileLineSnippetContext
LOWlightrag/api/routers/document_routes.py1149 "metadata": {"author": "John Doe", "year": 2025},CODE
LOWlightrag/api/routers/document_routes.py1213 "metadata": {"author": "John Doe"},CODE
LOWlightrag/api/routers/document_routes.py1255 "metadata": {"author": "John Doe", "year": 2025},CODE
LOWlightrag/api/routers/document_routes.py1373 "metadata": {"author": "John Doe", "year": 2025},CODE
LOWtests/setup/test_collect.py860prompt_secret_until_valid_with_default() {{ printf 'fake-key'; }}CODE
LOWtests/parser/docx/test_smart_heading_flow.py3758 logs = [m for m in _log_messages(caplog) if "placeholder" in m]CODE
LOWtests/kg/json_impl/test_write_json_optimization.py30 "name": "John Doe",CODE
LOWtests/api/config/test_api_config_vlm_enable.py76 monkeypatch.setenv("VLM_LLM_BINDING_API_KEY", "placeholder")CODE
LOWtests/api/routes/test_description_api_validation.py229 ["entity", "Alice", "Acme Corp", "founded", "Alice founded Acme Corp."],CODE
LOWtests/api/routes/test_description_api_validation.py241 assert relation["tgt_id"] == "Acme Corp"CODE
LOWtests/api/routes/test_description_api_validation.py262 ["entity", "Alice", "Acme Corp", "founded", " "],CODE
LOWtests/api/routes/test_description_api_validation.py277 ["edge", "Alice", "Acme Corp", "founded", "Alice founded Acme Corp."],CODE
LOWtests/extraction/test_relation_evidence_floor_repair.py265@pytest.mark.parametrize("placeholder", sorted(RELATION_NO_EVIDENCE_SOURCE_IDS))CODE
LOWtests/extraction/test_relation_evidence_floor_repair.py327@pytest.mark.parametrize("placeholder", sorted(RELATION_NO_EVIDENCE_SOURCE_IDS))CODE
LOWtests/extraction/test_entity_extraction_stability.py510 assert set(nodes) == {"Alice", "Acme Corp"}CODE
LOWtests/extraction/test_entity_extraction_stability.py511 assert ("Alice", "Acme Corp") in edgesCODE
LOWtests/extraction/test_entity_extraction_stability.py702 assert set(entities.keys()) == {"Alice", "Acme Corp"}CODE
LOWtests/extraction/test_entity_extraction_stability.py706 assert relation_data["tgt_id"] == "Acme Corp"CODE
LOWtests/extraction/test_entity_extraction_stability.py185 "name": "Acme Corp",CODE
LOWtests/extraction/test_entity_extraction_stability.py193 "target": "Acme Corp",CODE
LOWtests/extraction/test_entity_extraction_stability.py660 assert next(iter(relationships.keys())) == ("Alice", "Acme Corp")CODE
LOWtests/extraction/test_entity_extraction_stability.py683 assert relation_data["tgt_id"] == "Acme Corp"CODE
LOWlightrag_webui/src/locales/zh.json390 "placeholder": "页面内搜索节点...",CODE
LOWlightrag_webui/src/locales/zh.json397 "placeholder": "搜索节点名称...",CODE
LOWlightrag_webui/src/locales/zh.json436 "placeholder": "输入查询内容 (支持模式前缀: /<Query Mode>)",CODE
LOWlightrag_webui/src/locales/zh.json493 "placeholder": "请输入 API Key",CODE
LOWlightrag_webui/src/locales/ja.json390 "placeholder": "ページ内のノードを検索...",CODE
LOWlightrag_webui/src/locales/ja.json397 "placeholder": "ノード名を検索...",CODE
LOWlightrag_webui/src/locales/ja.json436 "placeholder": "クエリを入力(プレフィックス対応: /<クエリモード>)",CODE
LOWlightrag_webui/src/locales/ja.json493 "placeholder": "APIキーを入力",CODE
LOWlightrag_webui/src/locales/de.json390 "placeholder": "Knoten auf der Seite suchen...",CODE
LOWlightrag_webui/src/locales/de.json397 "placeholder": "Knotenname suchen...",CODE
LOWlightrag_webui/src/locales/de.json436 "placeholder": "Geben Sie Ihre Abfrage ein (Präfix unterstützt: /<Abfragemodus>)",CODE
LOWlightrag_webui/src/locales/de.json493 "placeholder": "API-Schlüssel eingeben",CODE
LOWlightrag_webui/src/locales/ru.json390 "placeholder": "Поиск узлов на странице...",CODE
LOWlightrag_webui/src/locales/ru.json397 "placeholder": "Поиск имени узла...",CODE
LOWlightrag_webui/src/locales/ru.json436 "placeholder": "Введите ваш запрос (Поддержка префикса: /<Режим запроса>)",CODE
LOWlightrag_webui/src/locales/ru.json493 "placeholder": "Введите ваш API ключ",CODE
LOWlightrag_webui/src/locales/uk.json390 "placeholder": "Шукати вузли на сторінці...",CODE
LOWlightrag_webui/src/locales/uk.json397 "placeholder": "Шукати ім'я вузла...",CODE
LOWlightrag_webui/src/locales/uk.json436 "placeholder": "Введіть ваш запит (Підтримка префіксу: /<Режим запиту>)",CODE
LOWlightrag_webui/src/locales/uk.json493 "placeholder": "Введіть ваш API ключ",CODE
LOWlightrag_webui/src/locales/en.json390 "placeholder": "Search nodes in page...",CODE
LOWlightrag_webui/src/locales/en.json397 "placeholder": "Search node name...",CODE
LOWlightrag_webui/src/locales/en.json436 "placeholder": "Enter your query (Support prefix: /<Query Mode>)",CODE
LOWlightrag_webui/src/locales/en.json493 "placeholder": "Enter your API key",CODE
LOWlightrag_webui/src/locales/fr.json390 "placeholder": "Rechercher des nœuds dans la page...",CODE
LOWlightrag_webui/src/locales/fr.json397 "placeholder": "Rechercher le nom du nœud...",CODE
LOWlightrag_webui/src/locales/fr.json436 "placeholder": "Tapez votre requête (Préfixe de requête : /<Query Mode>)",CODE
LOWlightrag_webui/src/locales/fr.json493 "placeholder": "Entrez votre clé API",CODE
LOWlightrag_webui/src/locales/ko.json390 "placeholder": "페이지 내 노드 검색...",CODE
LOWlightrag_webui/src/locales/ko.json397 "placeholder": "노드 이름 검색...",CODE
LOWlightrag_webui/src/locales/ko.json436 "placeholder": "질문을 입력하세요 (접두사 지원: /<쿼리 모드>)",CODE
LOWlightrag_webui/src/locales/ko.json493 "placeholder": "API 키 입력",CODE
LOWlightrag_webui/src/locales/vi.json390 "placeholder": "Tìm kiếm nút trong trang...",CODE
LOWlightrag_webui/src/locales/vi.json397 "placeholder": "Tìm kiếm tên nút...",CODE
LOWlightrag_webui/src/locales/vi.json436 "placeholder": "Nhập truy vấn của bạn (Hỗ trợ tiền tố: /<Chế Độ Truy Vấn>)",CODE
LOWlightrag_webui/src/locales/vi.json493 "placeholder": "Nhập khóa API của bạn",CODE
LOWlightrag_webui/src/locales/zh_TW.json390 "placeholder": "頁面內搜尋節點...",CODE
LOWlightrag_webui/src/locales/zh_TW.json397 "placeholder": "搜尋節點名稱...",CODE
6 more matches not shown…
Structural Annotation Overuse31 hits · 48 pts
SeverityFileLineSnippetContext
LOWlightrag/lightrag.py1373 # Step 2: Apply priority wrapper decorator to EmbeddingFunc's inner funcCOMMENT
LOWlightrag/lightrag.py1355 # Step 1: Capture embedding_func and max_token_size before applying rate_limit decoratorCOMMENT
LOWlightrag/operate.py6138 # Step 5: Batch retrieve chunk dataCOMMENT
LOWlightrag/operate.py6144 # Step 6: Build result chunks with valid data and update chunk trackingCOMMENT
LOWlightrag/operate.py6433 # Step 5: Batch retrieve chunk dataCOMMENT
LOWlightrag/operate.py6439 # Step 6: Build result chunks with valid data and update chunk trackingCOMMENT
LOWlightrag/operate.py6027 # Step 1: Collect all text chunks for each entityCOMMENT
LOWlightrag/operate.py6054 # Step 2: Count chunk occurrences and deduplicate (keep chunks from earlier positioned entities)COMMENT
LOWlightrag/operate.py6071 # Step 3: Sort chunks for each entity by occurrence count (higher count = higher priority)COMMENT
LOWlightrag/operate.py6084 # Step 4: Apply the selected chunk selection algorithmCOMMENT
LOWlightrag/operate.py6278 # Step 1: Collect all text chunks for each relationshipCOMMENT
LOWlightrag/operate.py6313 # Step 2: Count chunk occurrences and deduplicate (keep chunks from earlier positioned relationships)COMMENT
LOWlightrag/operate.py6362 # Step 3: Sort chunks for each relationship by occurrence count (higher count = higher priority)COMMENT
LOWlightrag/operate.py6377 # Step 4: Apply the selected chunk selection algorithmCOMMENT
LOWlightrag/utils.py6465 # Step 1: Remove chunks that are no longer neededCOMMENT
LOWlightrag/utils.py6471 # Step 2: Append genuine additions only (preserving order from new_chunk_ids).COMMENT
LOWlightrag/api/lightrag_server.py787 # Step 3: Create optimized embedding function (calls underlying function directly)COMMENT
LOWlightrag/api/lightrag_server.py660 # Step 1: Import provider function and extract default attributesCOMMENT
LOWlightrag/api/lightrag_server.py767 # Step 2: Apply priority (user config > provider default)COMMENT
LOWlightrag/api/lightrag_server.py983 # Step 4: Wrap in EmbeddingFunc and returnCOMMENT
LOWlightrag/chunker/paragraph_semantic.py1351 # Step 1: expand each oversized table paragraph into row-boundedCOMMENT
LOWlightrag/chunker/paragraph_semantic.py1375 # Step 2: greedy-pack pieces into chunks ≤ target_max. A pieceCOMMENT
LOWtests/kg/postgres_impl/test_postgres_migration.py662 # Step 1: Simulate workspace_a initialization (Case 3 - only legacy exists)COMMENT
LOWtests/kg/postgres_impl/test_postgres_migration.py760 # Step 2: Simulate workspace_b initialization (Case 3 - both exist, but legacy has B's data)COMMENT
LOWdocs/OfflineDeployment.md212### Step 1: Prepare in Online EnvironmentCOMMENT
LOWdocs/OfflineDeployment.md231### Step 2: Transfer to Offline EnvironmentCOMMENT
LOWdocs/OfflineDeployment.md241### Step 3: Install in Offline EnvironmentCOMMENT
LOWdocs/OfflineDeployment.md262### Step 4: Verify InstallationCOMMENT
LOWexamples/lightrag_ag2_multiagent_demo.py267 # Step 1: Set up LightRAG (async, runs on the background loop)COMMENT
LOWexamples/lightrag_ag2_multiagent_demo.py270 # Step 2: Create AG2 agents with LightRAG toolsCOMMENT
LOWexamples/lightrag_ag2_multiagent_demo.py273 # Step 3: Ask a complex questionCOMMENT
Verbosity Indicators27 hits · 43 pts
SeverityFileLineSnippetContext
LOWlightrag/lightrag.py1373 # Step 2: Apply priority wrapper decorator to EmbeddingFunc's inner funcCOMMENT
LOWlightrag/lightrag.py1355 # Step 1: Capture embedding_func and max_token_size before applying rate_limit decoratorCOMMENT
LOWlightrag/operate.py6138 # Step 5: Batch retrieve chunk dataCOMMENT
LOWlightrag/operate.py6144 # Step 6: Build result chunks with valid data and update chunk trackingCOMMENT
LOWlightrag/operate.py6433 # Step 5: Batch retrieve chunk dataCOMMENT
LOWlightrag/operate.py6439 # Step 6: Build result chunks with valid data and update chunk trackingCOMMENT
LOWlightrag/operate.py6027 # Step 1: Collect all text chunks for each entityCOMMENT
LOWlightrag/operate.py6054 # Step 2: Count chunk occurrences and deduplicate (keep chunks from earlier positioned entities)COMMENT
LOWlightrag/operate.py6071 # Step 3: Sort chunks for each entity by occurrence count (higher count = higher priority)COMMENT
LOWlightrag/operate.py6084 # Step 4: Apply the selected chunk selection algorithmCOMMENT
LOWlightrag/operate.py6278 # Step 1: Collect all text chunks for each relationshipCOMMENT
LOWlightrag/operate.py6313 # Step 2: Count chunk occurrences and deduplicate (keep chunks from earlier positioned relationships)COMMENT
LOWlightrag/operate.py6362 # Step 3: Sort chunks for each relationship by occurrence count (higher count = higher priority)COMMENT
LOWlightrag/operate.py6377 # Step 4: Apply the selected chunk selection algorithmCOMMENT
LOWlightrag/utils.py6465 # Step 1: Remove chunks that are no longer neededCOMMENT
LOWlightrag/utils.py6471 # Step 2: Append genuine additions only (preserving order from new_chunk_ids).COMMENT
LOWlightrag/api/lightrag_server.py787 # Step 3: Create optimized embedding function (calls underlying function directly)COMMENT
LOWlightrag/api/lightrag_server.py660 # Step 1: Import provider function and extract default attributesCOMMENT
LOWlightrag/api/lightrag_server.py767 # Step 2: Apply priority (user config > provider default)COMMENT
LOWlightrag/api/lightrag_server.py983 # Step 4: Wrap in EmbeddingFunc and returnCOMMENT
LOWlightrag/chunker/paragraph_semantic.py1351 # Step 1: expand each oversized table paragraph into row-boundedCOMMENT
LOWlightrag/chunker/paragraph_semantic.py1375 # Step 2: greedy-pack pieces into chunks ≤ target_max. A pieceCOMMENT
LOWtests/kg/postgres_impl/test_postgres_migration.py662 # Step 1: Simulate workspace_a initialization (Case 3 - only legacy exists)COMMENT
LOWtests/kg/postgres_impl/test_postgres_migration.py760 # Step 2: Simulate workspace_b initialization (Case 3 - both exist, but legacy has B's data)COMMENT
LOWexamples/lightrag_ag2_multiagent_demo.py267 # Step 1: Set up LightRAG (async, runs on the background loop)COMMENT
LOWexamples/lightrag_ag2_multiagent_demo.py270 # Step 2: Create AG2 agents with LightRAG toolsCOMMENT
LOWexamples/lightrag_ag2_multiagent_demo.py273 # Step 3: Ask a complex questionCOMMENT
AI Slop Vocabulary15 hits · 40 pts
SeverityFileLineSnippetContext
MEDIUMlightrag/tools/clean_llm_query_cache.py872 """Print comprehensive cleanup reportSTRING
MEDIUMlightrag/tools/migrate_llm_cache.py1526 # Print comprehensive migration reportCOMMENT
MEDIUMlightrag/tools/migrate_llm_cache.py1358 """Print comprehensive migration reportSTRING
MEDIUMlightrag/kg/mongo_impl.py3485 """Try Atlas Search using compound query for comprehensive matching."""STRING
MEDIUMlightrag/kg/shared_storage.py1295 """Release all locks with comprehensive error handling, protected from cancellation"""STRING
MEDIUMlightrag/api/routers/document_routes.py6575 # Handle both DocStatus enum and string cases for robust deserializationCOMMENT
MEDIUMtests/tools/test_migrate_graph_storage_networkx.py53# the pgtable harness exercises.COMMENT
LOWtests/workspace/test_workspace_isolation.py696 # back in Test 8.2 and is legitimately False here, while ns_a/ns_b were just set.COMMENT
MEDIUMtests/parser/docx/test_smart_heading_e2e.py321# harnessCOMMENT
MEDIUMtests/kg/postgres_impl/test_postgres_graph_batch.py16# Capture harnessCOMMENT
MEDIUMtests/api/routes/test_aquery_data_endpoint.py493 "mode": "mix", # Use mixed mode to get the most comprehensive resultsCODE
MEDIUM…sts/chunker/test_paragraph_semantic_drop_references.py122# Filtering behaviour (assert on content markers, robust to LevelMerge)COMMENT
MEDIUMtests/chunker/test_chunking_raw_lightrag_parity.py62# Shared fixtures (mirrors the harness used by test_pipeline_release_closure)COMMENT
MEDIUMlightrag_webui/src/features/RetrievalView.tsx366 // Use the new robust COT parsing functionCOMMENT
MEDIUMlightrag_webui/src/features/RetrievalView.tsx917 // Handle copying message content with robust clipboard supportCOMMENT
Modern Structural Boilerplate39 hits · 39 pts
SeverityFileLineSnippetContext
LOWlightrag/llm_roles.py139 def set_role_llm_metadata(self, role: str, **metadata: Any) -> None:CODE
LOWlightrag/lightrag.py1028 def _set_runtime_addon_params(self, addon_params: Mapping[str, Any] | None) -> None:CODE
LOWlightrag/__init__.py5__all__ = [CODE
LOWlightrag/multimodal_context.py85logger = logging.getLogger(__name__)CODE
LOWlightrag/multimodal_context.py1060__all__ = [CODE
LOWlightrag/chunk_schema.py376__all__ = [CODE
LOWlightrag/prompt_multimodal.py352__all__ = [STRING
LOWlightrag/llm/gemini.py839__all__ = [CODE
LOWlightrag/llm/azure_openai.py18__all__ = [CODE
LOWlightrag/parser/_html_table.py208__all__ = [CODE
LOWlightrag/parser/_markdown.py68__all__ = [CODE
LOWlightrag/parser/markdown/ir_builder.py228__all__ = ["NativeMarkdownIRBuilder"]CODE
LOWlightrag/parser/markdown/raw_cache.py249__all__ = ["NativeImageRawCache", "native_md_options_signature"]CODE
LOWlightrag/parser/legacy/__init__.py14__all__ = ["LegacyExtractionError", "extract_text"]CODE
LOWlightrag/parser/external/_manifest.py159__all__ = [CODE
LOWlightrag/parser/external/_zip.py99__all__ = ["result_bundle_limits", "safe_extract_zip"]CODE
LOWlightrag/parser/external/_common.py326__all__ = [CODE
LOWlightrag/parser/external/__init__.py35__all__ = [CODE
LOWlightrag/parser/external/docling/ir_builder.py1069__all__ = ["DoclingIRBuilder"]CODE
LOWlightrag/parser/external/docling/manifest.py126__all__ = [CODE
LOWlightrag/parser/external/docling/client.py523__all__ = [CODE
LOWlightrag/parser/external/docling/cache.py251__all__ = [CODE
LOWlightrag/parser/external/docling/__init__.py33__all__ = [CODE
LOWlightrag/parser/external/mineru/ir_builder.py785__all__ = ["MinerUIRBuilder"]CODE
LOWlightrag/parser/external/mineru/manifest.py155__all__ = [CODE
LOWlightrag/parser/external/mineru/client.py742__all__ = ["MinerURawClient", "CONTENT_LIST_FILENAME"]CODE
LOWlightrag/parser/external/mineru/cache.py421__all__ = [CODE
LOWlightrag/parser/external/mineru/__init__.py21__all__ = [CODE
LOWlightrag/parser/docx/ir_builder.py335__all__ = ["NativeDocxIRBuilder"]CODE
LOWlightrag/parser/docx/zip_budget.py199__all__ = [CODE
LOWlightrag/api/routers/__init__.py14__all__ = ["OllamaAPI"]CODE
LOWlightrag/evaluation/__init__.py16__all__ = ["RAGEvaluator"]CODE
LOWlightrag/sidecar/__init__.py29__all__ = [CODE
LOWlightrag/chunker/__init__.py68__all__ = [CODE
LOWtests/llm/bedrock_impl/test_bedrock_llm.py643 def set_role_llm_metadata(self, _role: str, **_metadata) -> None:CODE
LOWtests/parser/docx/_native_docx_fixtures.py329__all__ = ["Scenario", "SCENARIOS", "_block"]CODE
LOW…ts/parser/docx/test_extract_blocks_characterization.py54def _set_para_id(para, hex_id: str) -> None:CODE
LOWtests/parser/docx/test_smart_heading_features.py40def _set_doc_default_size(doc: Document, half_points: int) -> None:CODE
LOWtests/api/test_lightrag_ollama_chat.py70 def set_verbose(cls, verbose: bool) -> None:CODE
AI Structural Patterns30 hits · 22 pts
SeverityFileLineSnippetContext
LOWlightrag/llm_roles.py276CODE
LOWlightrag/llm_roles.py360CODE
LOWlightrag/llm_roles.py395CODE
LOWlightrag/operate.py2745CODE
LOWlightrag/operate.py3477CODE
LOWlightrag/utils.py5051CODE
LOWlightrag/pipeline.py664CODE
LOWlightrag/llm/gemini.py288CODE
LOWlightrag/llm/gemini.py704CODE
LOWlightrag/llm/openai.py305CODE
LOWlightrag/llm/openai.py1032CODE
LOWlightrag/llm/openai.py1054CODE
LOWlightrag/llm/openai.py1216CODE
LOWlightrag/llm/openai.py1298CODE
LOWlightrag/llm/openai.py1307CODE
LOWlightrag/llm/llama_index_impl.py201CODE
LOWlightrag/llm/bedrock.py187CODE
LOWlightrag/llm/bedrock.py531CODE
LOWlightrag/llm/hf.py176CODE
LOWlightrag/parser/external/mineru/cache.py278CODE
LOWlightrag/parser/docx/utils.py752CODE
LOWlightrag/parser/docx/utils.py803CODE
LOWlightrag/parser/docx/smart_heading/heading_flow.py391CODE
LOWlightrag/parser/docx/smart_heading/title_block.py504CODE
LOWlightrag/kg/opensearch_impl.py5063CODE
LOWlightrag/kg/scan_job_store.py258CODE
LOWlightrag/chunker/semantic_vector.py197CODE
LOWtests/parser/external/docling/test_client.py65CODE
LOWtests/kg/mongo_impl/test_mongo_scheduling_pages.py102CODE
LOWtests/api/routes/test_document_routes_docx_archive.py126CODE
Slop Phrases2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMexamples/unofficial-sample/lightrag_cloudflare_demo.py32WORKING_DIR = "../dickens" # you can change output as desiredCODE
MEDIUMexamples/unofficial-sample/lightrag_nvidia_demo.py112 # so you can adjust to be able to fit the NVIDIA model (future work)COMMENT
Example Usage Blocks3 hits · 5 pts
SeverityFileLineSnippetContext
LOWdocker-compose.podman.yml3# Usage:COMMENT
LOWlightrag/llm/binding_options.py792# Usage:COMMENT
LOWscripts/setup/apple-container.sh35# Usage:COMMENT