Skip to content

Commit 1bbce33

Browse files
KennyZhang1dorbakerAlonsoGuevara
authored
Multi-index querying for API layer (#1644)
* added multi-global-query function header * ported over code for merging dataframes * added connection to global streaming api function * added function header for update context helper * implemented and incorperated update_context function * Updated to make sure 'parent' column in final_communities gets incremented for multi index. * first cut at multi_local_seach function * several minor changes and fixes * Updated multi index local search. * Cleaned up code. * fixed lambda function ruff errors * fixed more ruff errors * moved query api helpers to util file * moved index api helpers to util file * merged in code left out of conflict * changed GraphRagConfig object to support lists of vector stores * Updated with fixes for multi_local_search. * Minor updates. * Minor updates. * Updates for ruff check. * Minor updates. * removed redundant vector_store_configs arg * ruff formatting changes * semversioner * Minor fix. * spellcheck fixes * ruff * test fix for cicd errors * another test fix * added explicit typing for ci tests * added dict type check for vector_store during indexing * more ruff fixes * moved type check * Removed streaming. Added multi drift and basic searches. * Formatting changes. * Updates for pyright. * Update for ruff. * Ruff formatted. * first cut at fixing vector store typing errors * got multi local search working with new config * ruff and test fixes * added fix for embeddings type error * renamed multi index api functions * ruff * convert config model to dict[VectorStoreConfig] * modified tests to support new vector_store model * ruff fixes * changed some test setups to match new model * changed ci/cd settings files to match new structure * Fix stderror check * fixed bug in vector_store_config validation * ruff * add database_name field to vectorstoreconfig * removed print statements * small refactoring for PR comments * modified default config in test * modified vector store config unit test --------- Co-authored-by: dorbaker <[email protected]> Co-authored-by: Alonso Guevara <[email protected]>
1 parent 053bf60 commit 1bbce33

File tree

14 files changed

+1087
-182
lines changed

14 files changed

+1087
-182
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "patch",
3+
"description": "implemented multi-index querying for api layer"
4+
}

graphrag/api/index.py

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from graphrag.index.run.run_workflows import run_workflows
1919
from graphrag.index.typing import PipelineRunResult
2020
from graphrag.logger.base import ProgressLogger
21+
from graphrag.utils.api import get_workflows_list
2122

2223
log = logging.getLogger(__name__)
2324

@@ -60,7 +61,7 @@ async def build_index(
6061
if memory_profile:
6162
log.warning("New pipeline does not yet support memory profiling.")
6263

63-
workflows = _get_workflows_list(config)
64+
workflows = get_workflows_list(config)
6465

6566
async for output in run_workflows(
6667
workflows,
@@ -79,20 +80,3 @@ async def build_index(
7980
progress_logger.info(str(output.result))
8081

8182
return outputs
82-
83-
84-
def _get_workflows_list(config: GraphRagConfig) -> list[str]:
85-
return [
86-
"create_base_text_units",
87-
"create_final_documents",
88-
"extract_graph",
89-
"compute_communities",
90-
"create_final_entities",
91-
"create_final_relationships",
92-
"create_final_nodes",
93-
"create_final_communities",
94-
*(["create_final_covariates"] if config.claim_extraction.enabled else []),
95-
"create_final_text_units",
96-
"create_final_community_reports",
97-
"generate_text_embeddings",
98-
]

0 commit comments

Comments
 (0)