Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Rate Limiting Controls Not Functioning as Expected Resulting in 429s #1620

Closed
3 tasks done
darien-schettler opened this issue Jan 14, 2025 · 4 comments
Closed
3 tasks done
Labels
bug Something isn't working triage Default label assignment, indicates new issue needs reviewed by a maintainer

Comments

@darien-schettler
Copy link

Do you need to file an issue?

  • I have searched the existing issues and this bug is not already filed.
  • My model is hosted on OpenAI or Azure. If not, please look at the "model providers" issue and don't file a new one here.
  • I believe this is a legitimate bug, not just a question. If this is a question, please use the Discussions area.

Describe the bug

Basically, ever since the updates to versions greater than 1.0.0 I have been facing impassable issues with rate-limiting. I have tried using the config to set explicit rate limits but unfortunately the issue persists. I tried waiting a full day and the issue still persists. I would guess this is related to fnllm and it appears that @natoverse attempted to push a fix in 1.0.1 (#1530). However, the issue still remains (at least for me).

Steps to reproduce

Run any signficiantly large dataset through the indexing pipeline by running:

graphrag index --root .

The majority of graph extraction proceeds successfully but near the end it errors out due to rate limits.

Expected Behavior

We should be able to control the requests and, in general (by default) we shouldn't be overwhelming the OpenAI API with requests to the degree where it will cause issues. I would take slower and successful over faster with rate limits any day.

GraphRAG Config Used

### This config file contains required core defaults that must be set, along with a handful of common optional settings.
### For a full list of available settings, see https://microsoft.github.io/graphrag/config/yaml/

### LLM settings ###
## There are a number of settings to tune the threading and token limits for LLM calls - check the docs.

encoding_model: cl100k_base # this needs to be matched to your model!

llm:
  api_key: ${GRAPHRAG_API_KEY} # set this in the generated .env file
  type: openai_chat # or azure_openai_chat
  model: o1-mini
  model_supports_json: true # recommended if this is available for your model.
  requests_per_minute: 1000
  tokens_per_minute: 2_500_000
  concurrent_requests: 10
  max_retries: 5
  max_retry_wait: 60
  sleep_on_rate_limit_recommendation: true
  # audience: "https://cognitiveservices.azure.com/.default"
  # api_base: https://<instance>.openai.azure.com
  # api_version: 2024-02-15-preview
  # organization: <organization_id>
  # deployment_name: <azure_model_deployment_name>

parallelization:
  stagger: 0.3
  # num_threads: 50

async_mode: threaded # or asyncio

embeddings:
  async_mode: threaded # or asyncio
  vector_store: 
    type: lancedb
    db_uri: 'output/lancedb'
    container_name: default
    overwrite: true
  llm:
    api_key: ${GRAPHRAG_API_KEY}
    type: openai_embedding # or azure_openai_embedding
    model: text-embedding-3-small
    # concurrent_requests: 1
    # batch_size: 1
    # api_base: http://localhost:1234/v1
    # api_version: 2024-02-15-preview
    # audience: "https://cognitiveservices.azure.com/.default"
    # organization: <organization_id>
    # deployment_name: <azure_model_deployment_name>

### Input settings ###

input:
  type: file # or blob
  file_type: text # or csv
  base_dir: "input"
  file_encoding: utf-8
  file_pattern: ".*\\.txt$"

chunks:
  size: 1200
  overlap: 100
  group_by_columns: [id]

### Storage settings ###
## If blob storage is specified in the following four sections,
## connection_string and container_name must be provided

cache:
  type: file # one of [blob, cosmosdb, file]
  base_dir: "cache"

reporting:
  type: file # or console, blob
  base_dir: "logs"

storage:
  type: file # one of [blob, cosmosdb, file]
  base_dir: "output"

## only turn this on if running `graphrag index` with custom settings
## we normally use `graphrag update` with the defaults
update_index_storage:
  # type: file # or blob
  # base_dir: "update_output"

### Workflow settings ###

skip_workflows: []

entity_extraction:
  prompt: "prompts/entity_extraction.txt"
  entity_types: [organization,person,geo,event,concept,algorithm,metric,dataset,tool,definition]
  max_gleanings: 1

summarize_descriptions:
  prompt: "prompts/summarize_descriptions.txt"
  max_length: 500

claim_extraction:
  enabled: false
  prompt: "prompts/claim_extraction.txt"
  description: "Any claims or facts that could be relevant to information discovery."
  max_gleanings: 1

community_reports:
  prompt: "prompts/community_report.txt"
  max_length: 2000
  max_input_length: 8000

cluster_graph:
  max_cluster_size: 16

embed_graph:
  enabled: true # if true, will generate node2vec embeddings for nodes

umap:
  enabled: true # if true, will generate UMAP embeddings for nodes (embed_graph must also be enabled)

snapshots:
  graphml: true
  embeddings: true
  transient: true

### Query settings ###
## The prompt locations are required here, but each search method has a number of optional knobs that can be tuned.
## See the config docs: https://microsoft.github.io/graphrag/config/yaml/#query

local_search:
  prompt: "prompts/local_search_system_prompt.txt"

global_search:
  map_prompt: "prompts/global_search_map_system_prompt.txt"
  reduce_prompt: "prompts/global_search_reduce_system_prompt.txt"
  knowledge_prompt: "prompts/global_search_knowledge_system_prompt.txt"

drift_search:
  prompt: "prompts/drift_search_system_prompt.txt"

basic_search:
  prompt: "prompts/basic_search_system_prompt.txt"

Logs and screenshots

The following is an example of the last two entries into the logs.json.

{
    "type": "error",
    "data": "Entity Extraction Error",
    "stack": "Traceback (most recent call last):\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/operations/extract_entities/graph_extractor.py\", line 127, in __call__\n    result = await self._process_document(text, prompt_variables)\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/operations/extract_entities/graph_extractor.py\", line 155, in _process_document\n    response = await self._llm(\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/openai/llm/chat.py\", line 83, in __call__\n    return await self._text_chat_llm(prompt, **kwargs)\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/openai/llm/features/tools_parsing.py\", line 120, in __call__\n    return await self._delegate(prompt, **kwargs)\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/base/base.py\", line 112, in __call__\n    return await self._invoke(prompt, **kwargs)\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/base/base.py\", line 128, in _invoke\n    return await self._decorated_target(prompt, **kwargs)\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/services/json.py\", line 71, in invoke\n    return await delegate(prompt, **kwargs)\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/services/retryer.py\", line 109, in invoke\n    result = await execute_with_retry()\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/services/retryer.py\", line 106, in execute_with_retry\n    raise RetriesExhaustedError(name, self._max_retries)\nfnllm.services.errors.RetriesExhaustedError: Operation 'chat' failed - 5 retries exhausted.\n",
    "source": "Operation 'chat' failed - 5 retries exhausted.",
    "details": {
        "doc_index": 0,
        "text": "each parameter once anyway.\n\n:begin_tab:`mxnet`\nBelow, we specify\nthe weight decay hyperparameter directly\nthrough `wd` when instantiating our `Trainer`.\nBy default, Gluon decays both\nweights and biases simultaneously.\nNote that the hyperparameter `wd`\nwill be multiplied by `wd_mult`\nwhen updating model parameters.\nThus, if we set `wd_mult` to zero,\nthe bias parameter $b$ will not decay.\n:end_tab:\n\n:begin_tab:`pytorch`\nBelow, we specify\nthe weight decay hyperparameter directly\nthrough `weight_decay` when instantiating our optimizer.\nBy default, PyTorch decays both\nweights and biases simultaneously, but\nwe can configure the optimizer to handle different parameters\naccording to different policies.\nHere, we only set `weight_decay` for\nthe weights (the `net.weight` parameters), hence the \nbias (the `net.bias` parameter) will not decay.\n:end_tab:\n\n:begin_tab:`tensorflow`\nBelow, we create an $\\ell_2$ regularizer with\nthe weight decay hyperparameter `wd` and apply it to the layer's weights\nthrough the `kernel_regularizer` argument.\n:end_tab:\n\n```{.python .input}\n%%tab mxnet\nclass WeightDecay(d2l.LinearRegression):\n    def __init__(self, wd, lr):\n        super().__init__(lr)\n        self.save_hyperparameters()\n        self.wd = wd\n        \n    def configure_optimizers(self):\n        self.collect_params('.*bias').setattr('wd_mult', 0)\n        return gluon.Trainer(self.collect_params(),\n                             'sgd', \n                             {'learning_rate': self.lr, 'wd': self.wd})\n```\n\n```{.python .input}\n%%tab pytorch\nclass WeightDecay(d2l.LinearRegression):\n    def __init__(self, wd, lr):\n        super().__init__(lr)\n        self.save_hyperparameters()\n        self.wd = wd\n\n    def configure_optimizers(self):\n        return torch.optim.SGD([\n            {'params': self.net.weight, 'weight_decay': self.wd},\n            {'params': self.net.bias}], lr=self.lr)\n```\n\n```{.python .input}\n%%tab tensorflow\nclass WeightDecay(d2l.LinearRegression):\n    def __init__(self, wd, lr):\n        super().__init__(lr)\n        self.save_hyperparameters()\n        self.net = tf.keras.layers.Dense(\n            1, kernel_regularizer=tf.keras.regularizers.l2(wd),\n            kernel_initializer=tf.keras.initializers.RandomNormal(0, 0.01)\n        )\n        \n    def loss(self, y_hat, y):\n        return super().loss(y_hat, y) + self.net.losses\n```\n\n```{.python .input}\n%%tab jax\nclass WeightDecay(d2l.LinearRegression):\n    wd: int = 0\n    \n    def configure_optimizers(self):\n        # Weight Decay is not available directly within optax.sgd, but\n        # optax allows chaining several transformations together\n        return optax.chain(optax.additive_weight_decay(self.wd),\n                           optax.sgd(self.lr))\n```\n\n[**The plot looks similar to that when\nwe implemented weight decay from scratch**].\nHowever, this version runs faster\nand is easier to implement,\nbenefits that will become more\npronounced as you address larger problems\nand this work becomes more routine.\n\n```{.python .input}\n%%tab all\nmodel = WeightDecay(wd=3, lr=0.01)\nmodel.board.yscale='log'\ntrainer.fit(model, data)\n\nif tab.selected('jax'):\n    print('L2 norm of w:', float(l2_penalty(model.get_w_b(trainer.state)[0])))\nif tab.selected('pytorch', 'mxnet', 'tensorflow'):\n    print('L2 norm of w:', float(l2_penalty(model.get_w_b()[0])))\n```\n\nSo far, we have touched upon one notion of\nwhat constitutes a simple linear function.\nHowever, even for simple nonlinear functions, the situation can be much more complex. To see this, the concept of [reproducing kernel Hilbert space (RKHS)](https://en.wikipedia.org/wiki/Reproducing_kernel_Hilbert_space)\nallows one to apply tools introduced\nfor linear functions in a nonlinear context.\nUnfortunately, RKHS-based algorithms\ntend to scale poorly to large, high-dimensional data.\nIn this book we will often adopt the common heuristic\nwhereby weight decay is applied\nto all layers of a deep network.\n\n## Summary\n\nRegularization is a common method for dealing with overfitting. Classical regularization techniques add a penalty term to the loss function (when training) to reduce the complexity of the learned model.\nOne particular choice for keeping the model simple is using an $\\ell_2$ penalty. This leads to weight decay in the update steps of the minibatch stochastic gradient descent algorithm.\nIn practice, the weight decay functionality is provided in optimizers from deep learning frameworks.\nDifferent sets of parameters can have different update behaviors within the same training loop.\n\n\n\n## Exercises\n\n1. Experiment with the value of $\\lambda$ in the estimation problem in this section. Plot training and validation accuracy as a function of $\\lambda$. What do you observe?\n1. Use a validation set to find the optimal value of $\\lambda$. Is it really the optimal value? Does this matter?\n1. What would the update equations look like if instead of $\\|\\mathbf{w}\\|^2$ we used $\\sum_i |w_i|$ as our penalty of choice ($\\ell_1$ regularization)?\n1. We know that $\\|\\mathbf{w}\\|^2 = \\mathbf{w}^\\top \\mathbf{w}$. Can you find a"
    }
}
{
    "type": "error",
    "data": "Error running pipeline!",
    "stack": "Traceback (most recent call last):\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/run/run_workflows.py\", line 166, in _run_workflows\n    result = await run_workflow(\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/workflows/extract_graph.py\", line 45, in run_workflow\n    base_entity_nodes, base_relationship_edges = await extract_graph(\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/flows/extract_graph.py\", line 33, in extract_graph\n    entities, relationships = await extract_entities(\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/operations/extract_entities/extract_entities.py\", line 136, in extract_entities\n    entities = _merge_entities(entity_dfs)\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/operations/extract_entities/extract_entities.py\", line 168, in _merge_entities\n    all_entities.groupby([\"title\", \"type\"], sort=False)\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/pandas/core/frame.py\", line 9183, in groupby\n    return DataFrameGroupBy(\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/pandas/core/groupby/groupby.py\", line 1329, in __init__\n    grouper, exclusions, obj = get_grouper(\n  File \"/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/pandas/core/groupby/grouper.py\", line 1043, in get_grouper\n    raise KeyError(gpr)\nKeyError: 'title'\n",
    "source": "'title'",
    "details": null
}

and here is where the errors start in the indexing-engine.log file:

15:29:10,812 graphrag.storage.file_pipeline_storage INFO Creating file storage at /Users/darienschettler/PycharmProjects/graphrag-server/output
15:29:10,812 graphrag.index.input.factory INFO loading input from root_dir=input
15:29:10,812 graphrag.index.input.factory INFO using file storage for input
15:29:10,813 graphrag.storage.file_pipeline_storage INFO search /Users/darienschettler/PycharmProjects/graphrag-server/input for files matching .*\.txt$
15:29:10,815 graphrag.index.input.text INFO found text files from input, found [...REDACTED...]
15:29:10,893 graphrag.index.input.text INFO Found 203 files, loading 203
15:29:10,896 graphrag.index.run.run_workflows INFO Final # of rows loaded: 203
15:29:10,926 graphrag.utils.storage INFO reading table from storage: input.parquet
15:29:12,907 graphrag.utils.storage INFO reading table from storage: input.parquet
15:29:12,914 graphrag.utils.storage INFO reading table from storage: create_base_text_units.parquet
15:29:12,964 graphrag.utils.storage INFO reading table from storage: create_base_text_units.parquet
15:29:13,692 httpx INFO HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 429 Too Many Requests"
.
.
... that 429 line is repeated about 100-200 times and then it errors out due to exceeding retries ...
.
.
15:29:30,66 graphrag.index.operations.extract_entities.graph_extractor ERROR error extracting graph
Traceback (most recent call last):
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/operations/extract_entities/graph_extractor.py", line 127, in __call__
    result = await self._process_document(text, prompt_variables)
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/graphrag/index/operations/extract_entities/graph_extractor.py", line 155, in _process_document
    response = await self._llm(
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/openai/llm/chat.py", line 83, in __call__
    return await self._text_chat_llm(prompt, **kwargs)
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/openai/llm/features/tools_parsing.py", line 120, in __call__
    return await self._delegate(prompt, **kwargs)
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/base/base.py", line 112, in __call__
    return await self._invoke(prompt, **kwargs)
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/base/base.py", line 128, in _invoke
    return await self._decorated_target(prompt, **kwargs)
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/services/json.py", line 71, in invoke
    return await delegate(prompt, **kwargs)
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/services/retryer.py", line 109, in invoke
    result = await execute_with_retry()
  File "/Users/darienschettler/PycharmProjects/graphrag-server/.venv/lib/python3.10/site-packages/fnllm/services/retryer.py", line 106, in execute_with_retry
    raise RetriesExhaustedError(name, self._max_retries)
fnllm.services.errors.RetriesExhaustedError: Operation 'chat' failed - 5 retries exhausted.

Additional Information

@darien-schettler darien-schettler added bug Something isn't working triage Default label assignment, indicates new issue needs reviewed by a maintainer labels Jan 14, 2025
@darien-schettler
Copy link
Author

It appears there is also some weirdness in how rate limiting is being handled across workflows... for instance in the community summarization extractor we have this line:

async def _run_extractor(
    llm: ChatLLM,
    community: str | int,
    input: str,
    level: int,
    args: StrategyConfig,
    callbacks: WorkflowCallbacks,
) -> CommunityReport | None:
    # RateLimiter
    rate_limiter = RateLimiter(rate=1, per=60)

Where we can see the rate limiter being instantiated . However if we look at the _run_extractor code for other workflows we find that it is absent. See here for instance:

https://github.com/microsoft/graphrag/blob/main/graphrag/index/operations/extract_entities/extract_entities.py

Then again I may be completely off base.

@natoverse
Copy link
Collaborator

Hi @darien-schettler, I just pushed another PR that is resolving this for me. It appears that prior to using fnllm we had fallbacks so that if the tpm/rpm were set to 0 they would end up with defaults of 50_000 and 10_000 respectively. fnllm does not contain the same fallbacks, so we were inadvertently retaining the settings of 0, which does not rate limit (I find that 0 = "no rate limiting" confusing anyway too, but it's there for legacy reasons and will be fixed soon). Anyhow, by adding the defaults in new configs, and ensuring I have some reasonable settings, I've been able to run pretty big (multi-hour) jobs without any problems.

However, I do see that you are setting those values in your llm block (though not the embeddings llm block, which you should do as well). You might try setting your values a bit lower as well - I am setting mine to about half or less of my endpoint limits. I suspect we still have a couple of issues with how the rate limiting and parallelization config is mapped, because we used to have a very complex config inheritance model that made it difficult to debug. We have another PR that drastically simplifies config coming soon.

TL;DR: please try lower settings, ensure you set them for embeddings too, and we know we're not out of the woods yet on the fnllm issues. Thanks!

@darien-schettler
Copy link
Author

Ah! That makes total sense. I set it superrr low and it ran through extraction and failed after. I assumed this was due to the chat rate limit but (duh) it must have been the embedding afterwards.

I’ll update the values in that section and take your advice and lower the limits a bit further too.

Thanks for the response and the wonderful work you do!

Closing this now.

@darien-schettler
Copy link
Author

darien-schettler commented Jan 17, 2025

Hey @natoverse - I'm still having this issue after updating to 1.2.0. I've seen it throw 429s on both completions and embeddings.


Updated yaml below:

### This config file contains required core defaults that must be set, along with a handful of common optional settings.
### For a full list of available settings, see https://microsoft.github.io/graphrag/config/yaml/

### LLM settings ###
## There are a number of settings to tune the threading and token limits for LLM calls - check the docs.

encoding_model: cl100k_base # this needs to be matched to your model!

llm:
  api_key: ${GRAPHRAG_API_KEY} # set this in the generated .env file
  type: openai_chat # or azure_openai_chat
  model: gpt-4o-mini
  model_supports_json: true # recommended if this is available for your model.
  requests_per_minute: 250
  tokens_per_minute: 1_000_000
  concurrent_requests: 5
  max_retries: 3
  max_retry_wait: 60
  sleep_on_rate_limit_recommendation: true
  # audience: "https://cognitiveservices.azure.com/.default"
  # api_base: https://<instance>.openai.azure.com
  # api_version: 2024-02-15-preview
  # organization: <organization_id>
  # deployment_name: <azure_model_deployment_name>

parallelization:
  stagger: 0.3
  # num_threads: 50

async_mode: threaded # or asyncio

embeddings:
  async_mode: threaded # or asyncio
  vector_store: 
    type: lancedb
    db_uri: 'output/lancedb'
    container_name: default
    overwrite: true
  llm:
    api_key: ${GRAPHRAG_API_KEY}
    type: openai_embedding # or azure_openai_embedding
    model: text-embedding-3-small
    requests_per_minute: 100
    tokens_per_minute: 200_000
    max_retries: 3
    max_retry_wait: 60
    sleep_on_rate_limit_recommendation: true
    concurrent_requests: 1
    batch_size: 1
    # api_base: http://localhost:1234/v1
    # api_version: 2024-02-15-preview
    # audience: "https://cognitiveservices.azure.com/.default"
    # organization: <organization_id>
    # deployment_name: <azure_model_deployment_name>

### Input settings ###

input:
  type: file # or blob
  file_type: text # or csv
  base_dir: "input"
  file_encoding: utf-8
  file_pattern: ".*\\.txt$"

chunks:
  size: 1200
  overlap: 100
  group_by_columns: [id]

### Storage settings ###
## If blob storage is specified in the following four sections,
## connection_string and container_name must be provided

cache:
  type: file # one of [blob, cosmosdb, file]
  base_dir: "cache"

reporting:
  type: file # or console, blob
  base_dir: "logs"

storage:
  type: file # one of [blob, cosmosdb, file]
  base_dir: "output"

## only turn this on if running `graphrag index` with custom settings
## we normally use `graphrag update` with the defaults
update_index_storage:
  # type: file # or blob
  # base_dir: "update_output"

### Workflow settings ###

skip_workflows: []

entity_extraction:
  prompt: "prompts/entity_extraction.txt"
  entity_types: [organization,person,geo,event,concept,algorithm,metric,dataset,tool,definition]
  max_gleanings: 1

summarize_descriptions:
  prompt: "prompts/summarize_descriptions.txt"
  max_length: 500

claim_extraction:
  enabled: false
  prompt: "prompts/claim_extraction.txt"
  description: "Any claims or facts that could be relevant to information discovery."
  max_gleanings: 1

community_reports:
  prompt: "prompts/community_report.txt"
  max_length: 2000
  max_input_length: 8000

cluster_graph:
  max_cluster_size: 16

embed_graph:
  enabled: true # if true, will generate node2vec embeddings for nodes

umap:
  enabled: true # if true, will generate UMAP embeddings for nodes (embed_graph must also be enabled)

snapshots:
  graphml: true
  embeddings: true
  transient: true

### Query settings ###
## The prompt locations are required here, but each search method has a number of optional knobs that can be tuned.
## See the config docs: https://microsoft.github.io/graphrag/config/yaml/#query

local_search:
  prompt: "prompts/local_search_system_prompt.txt"

global_search:
  map_prompt: "prompts/global_search_map_system_prompt.txt"
  reduce_prompt: "prompts/global_search_reduce_system_prompt.txt"
  knowledge_prompt: "prompts/global_search_knowledge_system_prompt.txt"

drift_search:
  prompt: "prompts/drift_search_system_prompt.txt"

basic_search:
  prompt: "prompts/basic_search_system_prompt.txt"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Default label assignment, indicates new issue needs reviewed by a maintainer
Projects
None yet
Development

No branches or pull requests

2 participants