mirror of
https://github.com/microsoft/graphrag.git
synced 2026-01-14 09:07:20 +08:00
Deploying to gh-pages from @ microsoft/graphrag@d6e6f5c077 🚀
This commit is contained in:
parent
c2a645ed03
commit
be8493ddec
@ -1486,17 +1486,16 @@
|
||||
|
||||
|
||||
<h1 id="configuring-graphrag-indexing">Configuring GraphRAG Indexing</h1>
|
||||
<p>To start using GraphRAG, you need to configure the system. The <code>init</code> command is the easiest way to get started. It will create a <code>.env</code> and <code>settings.yaml</code> files in the specified directory with the necessary configuration settings. It will also output the default LLM prompts used by GraphRAG.</p>
|
||||
<p>To start using GraphRAG, you must generate a configuration file. The <code>init</code> command is the easiest way to get started. It will create a <code>.env</code> and <code>settings.yaml</code> files in the specified directory with the necessary configuration settings. It will also output the default LLM prompts used by GraphRAG.</p>
|
||||
<h2 id="usage">Usage</h2>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.index<span class="w"> </span><span class="o">[</span>--init<span class="o">]</span><span class="w"> </span><span class="o">[</span>--root<span class="w"> </span>PATH<span class="o">]</span>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>graphrag<span class="w"> </span>init<span class="w"> </span><span class="o">[</span>--root<span class="w"> </span>PATH<span class="o">]</span>
|
||||
</code></pre></div>
|
||||
<h2 id="options">Options</h2>
|
||||
<ul>
|
||||
<li><code>--init</code> - Initialize the directory with the necessary configuration files.</li>
|
||||
<li><code>--root PATH</code> - The root directory to initialize. Default is the current directory.</li>
|
||||
<li><code>--root PATH</code> - The project root directory to initialize graphrag at. Default is the current directory.</li>
|
||||
</ul>
|
||||
<h2 id="example">Example</h2>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.index<span class="w"> </span>--init<span class="w"> </span>--root<span class="w"> </span>./ragtest
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>graphrag<span class="w"> </span>init<span class="w"> </span>--root<span class="w"> </span>./ragtest
|
||||
</code></pre></div>
|
||||
<h2 id="output">Output</h2>
|
||||
<p>The <code>init</code> command will create the following files in the specified directory:</p>
|
||||
|
||||
@ -2531,15 +2531,15 @@ print(result.response)</div>
|
||||
<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="text/plain" tabindex="0">
|
||||
<pre>### Major Conflict
|
||||
|
||||
The central conflict in the story revolves around the Paranormal Military Squad's mission to establish contact with extraterrestrial intelligence. This mission involves deciphering alien signals and managing the potential implications of first contact. The conflict is marked by the secrecy and high stakes associated with the mission, as well as the challenges posed by the unknown nature of the extraterrestrial entities [Data: Reports (4, 5, 2, 3, 0)].
|
||||
The central conflict in the story revolves around the Paranormal Military Squad's mission to establish contact with extraterrestrial intelligence. This involves deciphering alien signals and managing the potential implications of first contact. The mission is characterized by its secrecy and high stakes, as well as the challenges posed by the unknown nature of the extraterrestrial entities. The squad must navigate these uncertainties and the potential risks associated with communicating with an alien civilization [Data: Reports (4, 5, 2, 3, 0)].
|
||||
|
||||
### Protagonists
|
||||
|
||||
The protagonists are the key members of the Paranormal Military Squad, including Taylor Cruz, Dr. Jordan Hayes, Alex Mercer, and Sam Rivera. Each of these individuals plays a crucial role in the mission, contributing their expertise in leadership, signal decryption, diplomatic engagement, and technical innovation [Data: Reports (4, 5, 2, 3, 0)].
|
||||
The protagonists of the story are the key members of the Paranormal Military Squad. This includes Taylor Cruz, Dr. Jordan Hayes, Alex Mercer, and Sam Rivera. Each of these individuals plays a crucial role in the mission, bringing their expertise in leadership, signal decryption, diplomatic engagement, and technical innovation to the forefront. Their combined efforts are essential in tackling the challenges posed by the mission and striving towards successful communication with the extraterrestrial entities [Data: Reports (4, 5, 2, 3, 0)].
|
||||
|
||||
### Antagonist
|
||||
|
||||
The antagonist in the story is not a single entity or character. Instead, it may be considered the unknown and potentially hostile nature of the extraterrestrial signals and the challenges they present to the Paranormal Military Squad's mission [Data: Reports (4, 5, 2, 3, 0)].
|
||||
Interestingly, the story does not feature a clear antagonist in the traditional sense. Instead, the conflict is driven by the challenges and uncertainties inherent in extraterrestrial communication. There is no direct opposition from a specific entity or character. The focus is on the internal and external challenges faced by the Paranormal Military Squad as they work towards their mission objectives [Data: Reports (4, 5, 2, 3, 0)].
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
@ -2690,7 +2690,7 @@ print(f"LLM calls: {result.llm_calls}. LLM tokens: {result.prompt_tokens}")</div
|
||||
<div class="jp-OutputArea-child">
|
||||
<div class="jp-OutputPrompt jp-OutputArea-prompt"></div>
|
||||
<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="text/plain" tabindex="0">
|
||||
<pre>LLM calls: 2. LLM tokens: 5270
|
||||
<pre>LLM calls: 2. LLM tokens: 5278
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -2347,7 +2347,7 @@ entity_df.head()</div>
|
||||
<div class="jp-OutputArea-child">
|
||||
<div class="jp-OutputPrompt jp-OutputArea-prompt"></div>
|
||||
<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="application/vnd.jupyter.stderr" tabindex="0">
|
||||
<pre>[2024-10-24T17:21:23Z WARN lance::dataset] No existing dataset at /home/runner/work/graphrag/graphrag/docs/examples_notebooks/inputs/operation dulce/lancedb/entity_description_embeddings.lance, it will be created
|
||||
<pre>[2024-10-24T18:23:53Z WARN lance::dataset] No existing dataset at /home/runner/work/graphrag/graphrag/docs/examples_notebooks/inputs/operation dulce/lancedb/entity_description_embeddings.lance, it will be created
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
@ -3335,7 +3335,7 @@ print(result.response)</div>
|
||||
<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="text/plain" tabindex="0">
|
||||
<pre>### Overview of Agent Alex Mercer
|
||||
|
||||
Agent Alex Mercer is a central figure within the Paranormal Military Squad Team at Dulce Base, where he plays a pivotal role in the team's operations and mission objectives. His responsibilities are multifaceted, encompassing leadership, strategic oversight, and direct involvement in the analysis and interpretation of extraterrestrial signals. Mercer's military background and experience are crucial to his role, as he guides the team through complex scenarios involving potential first contact with alien intelligence [Data: Entities (0, 209); Relationships (5, 8, 65)].
|
||||
Agent Alex Mercer is a central figure within the Paranormal Military Squad Team at Dulce Base, where he plays a pivotal role in the team's operations and mission objectives. His responsibilities are multifaceted, encompassing leadership, strategic oversight, and direct involvement in the analysis and interpretation of extraterrestrial signals. Mercer's military background and experience are crucial to his role, as he guides the team through complex scenarios involving potential first contact with alien intelligence [Data: Entities (0, 209); Relationships (5, 8, 6)].
|
||||
|
||||
### Leadership and Responsibilities
|
||||
|
||||
@ -3343,13 +3343,13 @@ As a leader, Alex Mercer is instrumental in overseeing the team's efforts to eng
|
||||
|
||||
### Collaboration and Team Dynamics
|
||||
|
||||
Agent Mercer works closely with other key members of the Paranormal Military Squad, such as Dr. Jordan Hayes and Sam Rivera. His collaboration with Dr. Hayes is particularly significant, as they jointly focus on decrypting and communicating with extraterrestrial intelligence. This partnership is built on mutual respect and recognition of each other's analytical skills, which are essential for the team's success. Mercer's interactions with Sam Rivera highlight his role as a mentor, providing guidance and fostering a relationship based on intuition and trust [Data: Reports (0); Relationships (1, 4, 2)].
|
||||
Agent Mercer works closely with other key members of the Paranormal Military Squad, such as Dr. Jordan Hayes and Sam Rivera. His collaboration with Dr. Hayes is particularly significant, as they jointly focus on decrypting and communicating with extraterrestrial intelligence. This partnership is built on mutual respect and recognition of each other's analytical skills, which are essential for the team's success. Additionally, Mercer's interactions with Sam Rivera highlight the importance of intuition and trust in their mission, complementing the technological aspects of their work [Data: Reports (0); Relationships (1, 4, 2)].
|
||||
|
||||
### Involvement in Extraterrestrial Communication
|
||||
|
||||
Mercer's involvement in the decryption and analysis of alien signals is a critical aspect of his role. He is actively engaged in interpreting these signals, contributing to the understanding of an extraterrestrial society. His efforts are not only focused on overseeing the team but also on unraveling galactic mysteries and engaging with alien signals. This involvement underscores his position as a key figure in the mission's hypothesis and decision-making processes [Data: Claims (73, 85, 82); Reports (0)].
|
||||
Mercer's involvement in the decryption and analysis of alien signals is a critical aspect of his role. He is actively engaged in interpreting these signals, contributing to the understanding of an extraterrestrial society. This task is not only about decoding messages but also about understanding the broader implications of their work, as Mercer and his team navigate the complexities of potential first contact scenarios. His efforts are seen as a representation of humanity's readiness to engage in interstellar dialogue [Data: Claims (73, 85, 82); Reports (0)].
|
||||
|
||||
In summary, Agent Alex Mercer is a vital member of the Paranormal Military Squad Team, whose leadership and expertise are crucial to the team's mission at Dulce Base. His role in guiding the team through the complexities of extraterrestrial communication and his collaboration with other team members highlight his importance in the broader objectives of their work.
|
||||
In summary, Agent Alex Mercer is a key figure in the Paranormal Military Squad Team, whose leadership and expertise are vital to the team's mission at Dulce Base. His role in guiding the team through the challenges of extraterrestrial communication underscores the significance of their work in the broader context of human-alien relations.
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
@ -3393,27 +3393,23 @@ print(result.response)</div>
|
||||
<div class="jp-OutputArea-child">
|
||||
<div class="jp-OutputPrompt jp-OutputArea-prompt"></div>
|
||||
<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="text/plain" tabindex="0">
|
||||
<pre>### Overview of Dr. Jordan Hayes
|
||||
<pre>## Overview of Dr. Jordan Hayes
|
||||
|
||||
Dr. Jordan Hayes is a prominent member of the Paranormal Military Squad, a specialized team based at Dulce Base, dedicated to the study and communication with extraterrestrial entities. Dr. Hayes plays a crucial role in the team's mission, focusing on deciphering alien code and interpreting extraterrestrial patterns. This expertise is vital to the squad's efforts in understanding and interacting with alien intelligence [Data: Entities (104, 2); Reports (0)].
|
||||
Dr. Jordan Hayes is a prominent member of the Paranormal Military Squad, a specialized team based at Dulce Base, dedicated to the study and communication with extraterrestrial entities. Dr. Hayes plays a crucial role in the squad, focusing on deciphering alien code and interpreting extraterrestrial patterns, which are essential for the team's mission of understanding and interacting with alien intelligence [Data: Entities (104, 2); Reports (0)].
|
||||
|
||||
### Role and Responsibilities
|
||||
## Role and Responsibilities
|
||||
|
||||
Dr. Hayes is deeply involved in the analysis and interpretation of alien signals, which includes isolating signal harmonics, decrypting alien messages, and interpreting these signals for further analysis. This work is central to the team's operations at Dulce Base, where Dr. Hayes collaborates closely with other team members, such as Agent Alex Mercer, to manage interspecies communication [Data: Entities (2, 166, 192); Relationships (1, 4, 26, 67)].
|
||||
Dr. Hayes is deeply involved in the analysis and interpretation of alien signals, a task that requires a high level of expertise in decryption algorithms and signal harmonics. This work is pivotal to the team's operations at Dulce Base, as it involves isolating signal harmonics, decrypting alien messages, and interpreting these signals for further analysis. Dr. Hayes' analytical mindset and skepticism are key attributes that contribute to their effectiveness in this role [Data: Entities (2, 166, 180); Claims (12, 36, 39)].
|
||||
|
||||
### Expertise and Approach
|
||||
## Collaboration and Team Dynamics
|
||||
|
||||
Known for an analytical and skeptical mindset, Dr. Hayes emphasizes empirical evidence and adaptability in the face of the unknown. This approach is particularly evident in their work on decryption algorithms and signal analysis, which are crucial for deciphering extraterrestrial communications. Dr. Hayes' role is pivotal in the team's focus on analyzing and interpreting alien signals, which is a cornerstone of their operation at Dulce Base [Data: Entities (2, 180, 124); Claims (12, 54, 68)].
|
||||
Dr. Hayes works closely with other team members, including Agent Alex Mercer, with whom they share a mutual respect and understanding. This collaboration is vital for managing interspecies communication and ensuring the success of their mission. Dr. Hayes also collaborates with colleagues like Sam Rivera and Taylor Cruz, emphasizing the importance of teamwork in deciphering alien code and preparing for potential first contact scenarios [Data: Relationships (1, 4, 21, 9); Reports (0)].
|
||||
|
||||
### Collaboration and Impact
|
||||
## Scientific Contributions and Challenges
|
||||
|
||||
Dr. Hayes works closely with colleagues such as Sam Rivera and Taylor Cruz, contributing to the team's collective effort in deciphering alien code and preparing for first contact. The collaboration with Agent Alex Mercer is particularly significant, as they share a mutual respect and understanding of each other's strengths and the mission's significance. This teamwork is essential for the success of their mission, as they bring their expertise to the forefront of paranormal military endeavors [Data: Reports (0); Relationships (21, 9, 1, 4, 67)].
|
||||
Dr. Hayes is on the verge of a scientific breakthrough, as their work involves deciphering extraterrestrial patterns that could represent potential threats or untapped wisdom. This involves analyzing evolving alien signals and considering the implications of a tandem evolution with extraterrestrial intelligence. The complexity of this task highlights the challenges faced by Dr. Hayes and the Paranormal Military Squad in their quest to understand and interact with alien entities [Data: Claims (18, 49, 74, 84); Reports (0)].
|
||||
|
||||
### Significance of Work
|
||||
|
||||
The work of Dr. Hayes and the Paranormal Military Squad is not just about scientific discovery but also about preparing humanity for potential interstellar communication. The team's efforts in analyzing extraterrestrial patterns and first contact data are indicative of their role in predicting extraterrestrial intentions and actions. Dr. Hayes' contributions are crucial in this historic effort, which could mark the beginning of a new era in human-alien relations [Data: Reports (0); Claims (84, 54, 61)].
|
||||
|
||||
In summary, Dr. Jordan Hayes is a key figure in the Paranormal Military Squad, bringing a critical and methodical approach to the team's extraordinary endeavors in understanding and interacting with alien entities. Their work at Dulce Base is central to the mission of deciphering extraterrestrial signals and preparing for potential interspecies communication.
|
||||
In summary, Dr. Jordan Hayes is a key figure in the Paranormal Military Squad, contributing significantly to the team's efforts in extraterrestrial communication and analysis. Their expertise and collaborative efforts are crucial in navigating the complexities of interstellar communication and potential alien contact.
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
@ -3975,7 +3971,7 @@ print(candidate_questions.response)</div>
|
||||
<div class="jp-OutputArea-child">
|
||||
<div class="jp-OutputPrompt jp-OutputArea-prompt"></div>
|
||||
<div class="jp-RenderedText jp-OutputArea-output" data-mime-type="text/plain" tabindex="0">
|
||||
<pre>['- What is the role of Agent Alex Mercer in Operation: Dulce?', '- How does the Paranormal Military Squad interact with extraterrestrial intelligence at Dulce Base?', '- What are the main objectives of Operation: Dulce at the Dulce Military Base?', '- How does the environment of the Dulce Military Base affect the team members involved in the operation?', "- What is the significance of New Mexico's location for the Dulce Military Base and Operation: Dulce?"]
|
||||
<pre>['- What is the role of Alex Mercer in Operation: Dulce?', '- How does the Paranormal Military Squad interact with extraterrestrial intelligence at Dulce Base?', '- What are the main objectives of Operation: Dulce?', '- How does the environment of Dulce Military Base affect the team members?', '- What challenges does the Paranormal Military Squad face during their mission at Dulce Base?']
|
||||
</pre>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1460,19 +1460,19 @@ It shows how to use the system to index some text, and then use the indexed data
|
||||
<p>Next we'll inject some required config variables:</p>
|
||||
<h2 id="set-up-your-workspace-variables">Set Up Your Workspace Variables</h2>
|
||||
<p>First let's make sure to setup the required environment variables. For details on these environment variables, and what environment variables are available, see the <a href="../config/overview/">variables documentation</a>.</p>
|
||||
<p>To initialize your workspace, let's first run the <code>graphrag.index --init</code> command.
|
||||
Since we have already configured a directory named .ragtest` in the previous step, we can run the following command:</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.index<span class="w"> </span>--init<span class="w"> </span>--root<span class="w"> </span>./ragtest
|
||||
<p>To initialize your workspace, first run the <code>graphrag init</code> command.
|
||||
Since we have already configured a directory named <code>./ragtest</code> in the previous step, run the following command:</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a>graphrag<span class="w"> </span>init<span class="w"> </span>--root<span class="w"> </span>./ragtest
|
||||
</code></pre></div>
|
||||
<p>This will create two files: <code>.env</code> and <code>settings.yaml</code> in the <code>./ragtest</code> directory.</p>
|
||||
<ul>
|
||||
<li><code>.env</code> contains the environment variables required to run the GraphRAG pipeline. If you inspect the file, you'll see a single environment variable defined,
|
||||
<code>GRAPHRAG_API_KEY=<API_KEY></code>. This is the API key for the OpenAI API or Azure OpenAI endpoint. You can replace this with your own API key.</li>
|
||||
<code>GRAPHRAG_API_KEY=<API_KEY></code>. This is the API key for the OpenAI API or Azure OpenAI endpoint. You can replace this with your own API key. If you are using another form of authentication (i.e. managed identity), please delete this file.</li>
|
||||
<li><code>settings.yaml</code> contains the settings for the pipeline. You can modify this file to change the settings for the pipeline.
|
||||
<br/></li>
|
||||
</ul>
|
||||
<h4 id="openai-and-azure-openai"><ins>OpenAI and Azure OpenAI</ins></h4>
|
||||
<p>To run in OpenAI mode, just make sure to update the value of <code>GRAPHRAG_API_KEY</code> in the <code>.env</code> file with your OpenAI API key.</p>
|
||||
<p>If running in OpenAI mode, update the value of <code>GRAPHRAG_API_KEY</code> in the <code>.env</code> file with your OpenAI API key.</p>
|
||||
<h4 id="azure-openai"><ins>Azure OpenAI</ins></h4>
|
||||
<p>In addition, Azure OpenAI users should set the following variables in the settings.yaml file. To find the appropriate sections, just search for the <code>llm:</code> configuration, you should see two sections, one for the chat endpoint and one for the embeddings endpoint. Here is an example of how to configure the chat endpoint:</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-4-1" name="__codelineno-4-1" href="#__codelineno-4-1"></a><span class="nt">type</span><span class="p">:</span><span class="w"> </span><span class="l l-Scalar l-Scalar-Plain">azure_openai_chat</span><span class="w"> </span><span class="c1"># Or azure_openai_embedding for embeddings</span>
|
||||
@ -1487,25 +1487,25 @@ Since we have already configured a directory named .ragtest` in the previous ste
|
||||
</ul>
|
||||
<h2 id="running-the-indexing-pipeline">Running the Indexing pipeline</h2>
|
||||
<p>Finally we'll run the pipeline!</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.index<span class="w"> </span>--root<span class="w"> </span>./ragtest
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-5-1" name="__codelineno-5-1" href="#__codelineno-5-1"></a>graphrag<span class="w"> </span>index<span class="w"> </span>--root<span class="w"> </span>./ragtest
|
||||
</code></pre></div>
|
||||
<p><img alt="pipeline executing from the CLI" src="../img/pipeline-running.png" /></p>
|
||||
<p>This process will take some time to run. This depends on the size of your input data, what model you're using, and the text chunk size being used (these can be configured in your <code>settings.yml</code> file).
|
||||
Once the pipeline is complete, you should see a new folder called <code>./ragtest/output/<timestamp>/artifacts</code> with a series of parquet files.</p>
|
||||
Once the pipeline is complete, you should see a new folder called <code>./ragtest/output</code> with a series of parquet files.</p>
|
||||
<h1 id="using-the-query-engine">Using the Query Engine</h1>
|
||||
<h2 id="running-the-query-engine">Running the Query Engine</h2>
|
||||
<p>Now let's ask some questions using this dataset.</p>
|
||||
<p>Here is an example using Global search to ask a high-level question:</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.query<span class="w"> </span><span class="se">\</span>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-6-1" name="__codelineno-6-1" href="#__codelineno-6-1"></a>graphrag<span class="w"> </span>query<span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-6-2" name="__codelineno-6-2" href="#__codelineno-6-2"></a>--root<span class="w"> </span>./ragtest<span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-6-3" name="__codelineno-6-3" href="#__codelineno-6-3"></a>--method<span class="w"> </span>global<span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-6-4" name="__codelineno-6-4" href="#__codelineno-6-4"></a><span class="s2">"What are the top themes in this story?"</span>
|
||||
<a id="__codelineno-6-4" name="__codelineno-6-4" href="#__codelineno-6-4"></a>--query<span class="w"> </span><span class="s2">"What are the top themes in this story?"</span>
|
||||
</code></pre></div>
|
||||
<p>Here is an example using Local search to ask a more specific question about a particular character:</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.query<span class="w"> </span><span class="se">\</span>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-7-1" name="__codelineno-7-1" href="#__codelineno-7-1"></a>graphrag<span class="w"> </span>query<span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-7-2" name="__codelineno-7-2" href="#__codelineno-7-2"></a>--root<span class="w"> </span>./ragtest<span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-7-3" name="__codelineno-7-3" href="#__codelineno-7-3"></a>--method<span class="w"> </span><span class="nb">local</span><span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-7-4" name="__codelineno-7-4" href="#__codelineno-7-4"></a><span class="s2">"Who is Scrooge, and what are his main relationships?"</span>
|
||||
<a id="__codelineno-7-4" name="__codelineno-7-4" href="#__codelineno-7-4"></a>--query<span class="w"> </span><span class="s2">"Who is Scrooge and what are his main relationships?"</span>
|
||||
</code></pre></div>
|
||||
<p>Please refer to <a href="../query/overview/">Query Engine</a> docs for detailed information about how to leverage our Local and Global search mechanisms for extracting meaningful insights from data after the Indexer has wrapped up execution.</p>
|
||||
|
||||
|
||||
@ -1413,21 +1413,21 @@
|
||||
|
||||
<h1 id="indexer-cli">Indexer CLI</h1>
|
||||
<p>The GraphRAG indexer CLI allows for no-code usage of the GraphRAG Indexer.</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.index<span class="w"> </span>--verbose<span class="w"> </span>--root<span class="w"> </span></workspace/project/root><span class="w"> </span><span class="se">\</span>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>graphrag<span class="w"> </span>index<span class="w"> </span>--verbose<span class="w"> </span>--root<span class="w"> </span></workspace/project/root><span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>--config<span class="w"> </span><custom_config.yml><span class="w"> </span>--resume<span class="w"> </span><timestamp><span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a>--reporter<span class="w"> </span><rich<span class="p">|</span>print<span class="p">|</span>none><span class="w"> </span>--emit<span class="w"> </span>json,csv,parquet<span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>--nocache
|
||||
<a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>--no-cache
|
||||
</code></pre></div>
|
||||
<h2 id="cli-arguments">CLI Arguments</h2>
|
||||
<ul>
|
||||
<li><code>--verbose</code> - Adds extra logging information during the run.</li>
|
||||
<li><code>--root <data-project-dir></code> - the data root directory. This should contain an <code>input</code> directory with the input data, and an <code>.env</code> file with environment variables. These are described below.</li>
|
||||
<li><code>--init</code> - This will initialize the data project directory at the specified <code>root</code> with bootstrap configuration and prompt-overrides.</li>
|
||||
<li><code>--resume <output-timestamp></code> - if specified, the pipeline will attempt to resume a prior run. The parquet files from the prior run will be loaded into the system as inputs, and the workflows that generated those files will be skipped. The input value should be the timestamped output folder, e.g. "20240105-143721".</li>
|
||||
<li><code>--config <config_file.yml></code> - This will opt-out of the Default Configuration mode and execute a custom configuration. If this is used, then none of the environment-variables below will apply.</li>
|
||||
<li><code>--reporter <reporter></code> - This will specify the progress reporter to use. The default is <code>rich</code>. Valid values are <code>rich</code>, <code>print</code>, and <code>none</code>.</li>
|
||||
<li><code>--dry-run</code> - Runs the indexing pipeline without executing any steps in order to inspect and validate the configuration file.</li>
|
||||
<li><code>--emit <types></code> - This specifies the table output formats the pipeline should emit. The default is <code>parquet</code>. Valid values are <code>parquet</code>, <code>csv</code>, and <code>json</code>, comma-separated.</li>
|
||||
<li><code>--nocache</code> - This will disable the caching mechanism. This is useful for debugging and development, but should not be used in production.</li>
|
||||
<li><code>--no-cache</code> - This will disable the caching mechanism. This is useful for debugging and development, but should not be used in production.</li>
|
||||
<li><code>--output <directory></code> - Specify the output directory for pipeline artifacts.</li>
|
||||
<li><code>--reports <directory></code> - Specify the output directory for reporting.</li>
|
||||
</ul>
|
||||
|
||||
@ -1512,10 +1512,10 @@ Figure 1: Auto Tuning Conceptual Diagram.
|
||||
</p>
|
||||
|
||||
<h2 id="prerequisites">Prerequisites</h2>
|
||||
<p>Before running auto tuning make sure you have already initialized your workspace with the <code>graphrag.index --init</code> command. This will create the necessary configuration files and the default prompts. Refer to the <a href="../../config/init/">Init Documentation</a> for more information about the initialization process.</p>
|
||||
<p>Before running auto tuning, ensure you have already initialized your workspace with the <code>graphrag init</code> command. This will create the necessary configuration files and the default prompts. Refer to the <a href="../../config/init/">Init Documentation</a> for more information about the initialization process.</p>
|
||||
<h2 id="usage">Usage</h2>
|
||||
<p>You can run the main script from the command line with various options:</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.prompt_tune<span class="w"> </span><span class="o">[</span>--root<span class="w"> </span>ROOT<span class="o">]</span><span class="w"> </span><span class="o">[</span>--domain<span class="w"> </span>DOMAIN<span class="o">]</span><span class="w"> </span><span class="o">[</span>--method<span class="w"> </span>METHOD<span class="o">]</span><span class="w"> </span><span class="o">[</span>--limit<span class="w"> </span>LIMIT<span class="o">]</span><span class="w"> </span><span class="o">[</span>--language<span class="w"> </span>LANGUAGE<span class="o">]</span><span class="w"> </span><span class="se">\</span>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>graphrag<span class="w"> </span>prompt-tune<span class="w"> </span><span class="o">[</span>--root<span class="w"> </span>ROOT<span class="o">]</span><span class="w"> </span><span class="o">[</span>--domain<span class="w"> </span>DOMAIN<span class="o">]</span><span class="w"> </span><span class="o">[</span>--method<span class="w"> </span>METHOD<span class="o">]</span><span class="w"> </span><span class="o">[</span>--limit<span class="w"> </span>LIMIT<span class="o">]</span><span class="w"> </span><span class="o">[</span>--language<span class="w"> </span>LANGUAGE<span class="o">]</span><span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a><span class="o">[</span>--max-tokens<span class="w"> </span>MAX_TOKENS<span class="o">]</span><span class="w"> </span><span class="o">[</span>--chunk-size<span class="w"> </span>CHUNK_SIZE<span class="o">]</span><span class="w"> </span><span class="o">[</span>--n-subset-max<span class="w"> </span>N_SUBSET_MAX<span class="o">]</span><span class="w"> </span><span class="o">[</span>--k<span class="w"> </span>K<span class="o">]</span><span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="o">[</span>--min-examples-required<span class="w"> </span>MIN_EXAMPLES_REQUIRED<span class="o">]</span><span class="w"> </span><span class="o">[</span>--no-entity-types<span class="o">]</span><span class="w"> </span><span class="o">[</span>--output<span class="w"> </span>OUTPUT<span class="o">]</span>
|
||||
</code></pre></div>
|
||||
@ -1562,12 +1562,12 @@ Figure 1: Auto Tuning Conceptual Diagram.
|
||||
</li>
|
||||
</ul>
|
||||
<h2 id="example-usage">Example Usage</h2>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.prompt_tune<span class="w"> </span>--root<span class="w"> </span>/path/to/project<span class="w"> </span>--config<span class="w"> </span>/path/to/settings.yaml<span class="w"> </span>--domain<span class="w"> </span><span class="s2">"environmental news"</span><span class="w"> </span><span class="se">\</span>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-1-1" name="__codelineno-1-1" href="#__codelineno-1-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag<span class="w"> </span>prompt-tune<span class="w"> </span>--root<span class="w"> </span>/path/to/project<span class="w"> </span>--config<span class="w"> </span>/path/to/settings.yaml<span class="w"> </span>--domain<span class="w"> </span><span class="s2">"environmental news"</span><span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-1-2" name="__codelineno-1-2" href="#__codelineno-1-2"></a>--method<span class="w"> </span>random<span class="w"> </span>--limit<span class="w"> </span><span class="m">10</span><span class="w"> </span>--language<span class="w"> </span>English<span class="w"> </span>--max-tokens<span class="w"> </span><span class="m">2048</span><span class="w"> </span>--chunk-size<span class="w"> </span><span class="m">256</span><span class="w"> </span>--min-examples-required<span class="w"> </span><span class="m">3</span><span class="w"> </span><span class="se">\</span>
|
||||
<a id="__codelineno-1-3" name="__codelineno-1-3" href="#__codelineno-1-3"></a>--no-entity-types<span class="w"> </span>--output<span class="w"> </span>/path/to/output
|
||||
</code></pre></div>
|
||||
<p>or, with minimal configuration (suggested):</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.prompt_tune<span class="w"> </span>--root<span class="w"> </span>/path/to/project<span class="w"> </span>--config<span class="w"> </span>/path/to/settings.yaml<span class="w"> </span>--no-entity-types
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-2-1" name="__codelineno-2-1" href="#__codelineno-2-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag<span class="w"> </span>prompt-tune<span class="w"> </span>--root<span class="w"> </span>/path/to/project<span class="w"> </span>--config<span class="w"> </span>/path/to/settings.yaml<span class="w"> </span>--no-entity-types
|
||||
</code></pre></div>
|
||||
<h2 id="document-selection-methods">Document Selection Methods</h2>
|
||||
<p>The auto tuning feature ingests the input data and then divides it into text units the size of the chunk size parameter.
|
||||
|
||||
@ -1431,14 +1431,14 @@
|
||||
|
||||
<h1 id="query-cli">Query CLI</h1>
|
||||
<p>The GraphRAG query CLI allows for no-code usage of the GraphRAG Query engine.</p>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>python<span class="w"> </span>-m<span class="w"> </span>graphrag.query<span class="w"> </span>--config<span class="w"> </span><config_file.yml><span class="w"> </span>--data<span class="w"> </span><path-to-data><span class="w"> </span>--community_level<span class="w"> </span><comunit-level><span class="w"> </span>--response_type<span class="w"> </span><response-type><span class="w"> </span>--method<span class="w"> </span><<span class="s2">"local"</span><span class="p">|</span><span class="s2">"global"</span>><span class="w"> </span><query>
|
||||
<div class="highlight"><pre><span></span><code><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>graphrag<span class="w"> </span>query<span class="w"> </span>--config<span class="w"> </span><config_file.yml><span class="w"> </span>--data<span class="w"> </span><path-to-data><span class="w"> </span>--community-level<span class="w"> </span><comunit-level><span class="w"> </span>--response-type<span class="w"> </span><response-type><span class="w"> </span>--method<span class="w"> </span><<span class="s2">"local"</span><span class="p">|</span><span class="s2">"global"</span>><span class="w"> </span><query>
|
||||
</code></pre></div>
|
||||
<h2 id="cli-arguments">CLI Arguments</h2>
|
||||
<ul>
|
||||
<li><code>--config <config_file.yml></code> - The configuration yaml file to use when running the query. If this is used, then none of the environment-variables below will apply.</li>
|
||||
<li><code>--data <path-to-data></code> - Folder containing the <code>.parquet</code> output files from running the Indexer.</li>
|
||||
<li><code>--community_level <community-level></code> - Community level in the Leiden community hierarchy from which we will load the community reports higher value means we use reports on smaller communities. Default: 2</li>
|
||||
<li><code>--response_type <response-type></code> - Free form text describing the response type and format, can be anything, e.g. <code>Multiple Paragraphs</code>, <code>Single Paragraph</code>, <code>Single Sentence</code>, <code>List of 3-7 Points</code>, <code>Single Page</code>, <code>Multi-Page Report</code>. Default: <code>Multiple Paragraphs</code>.</li>
|
||||
<li><code>--community-level <community-level></code> - Community level in the Leiden community hierarchy from which we will load the community reports higher value means we use reports on smaller communities. Default: 2</li>
|
||||
<li><code>--response-type <response-type></code> - Free form text describing the response type and format, can be anything, e.g. <code>Multiple Paragraphs</code>, <code>Single Paragraph</code>, <code>Single Sentence</code>, <code>List of 3-7 Points</code>, <code>Single Page</code>, <code>Multi-Page Report</code>. Default: <code>Multiple Paragraphs</code>.</li>
|
||||
<li><code>--method <"local"|"global"></code> - Method to use to answer the query, one of local or global. For more information check <a href="../overview/">Overview</a></li>
|
||||
<li><code>--streaming</code> - Stream back the LLM response</li>
|
||||
</ul>
|
||||
|
||||
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user