Skip to content

Commit 42ce7ed

Browse files
committed
Merge branch 'v3/main' into remove-text-unit-grouping
2 parents 7b002e9 + 978e798 commit 42ce7ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1229
-2083
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type": "major",
3+
"description": "Remove document filtering option."
4+
}

docs/config/yaml.md

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ Our pipeline can ingest .csv, .txt, or .json data from an input location. See th
8787
- `file_type` **text|csv|json** - The type of input data to load. Default is `text`
8888
- `encoding` **str** - The encoding of the input file. Default is `utf-8`
8989
- `file_pattern` **str** - A regex to match input files. Default is `.*\.csv$`, `.*\.txt$`, or `.*\.json$` depending on the specified `file_type`, but you can customize it if needed.
90-
- `file_filter` **dict** - Key/value pairs to filter. Default is None.
9190
- `text_column` **str** - (CSV/JSON only) The text column name. If unset we expect a column named `text`.
9291
- `title_column` **str** - (CSV/JSON only) The title column name, filename will be used if unset.
9392
- `metadata` **list[str]** - (CSV/JSON only) The additional document attributes fields to keep.
@@ -286,29 +285,6 @@ These are the settings used for Leiden hierarchical clustering of the graph to c
286285
- `max_length` **int** - The maximum number of output tokens per report.
287286
- `max_input_length` **int** - The maximum number of input tokens to use when generating reports.
288287

289-
### embed_graph
290-
291-
We use node2vec to embed the graph. This is primarily used for visualization, so it is not turned on by default.
292-
293-
#### Fields
294-
295-
- `enabled` **bool** - Whether to enable graph embeddings.
296-
- `dimensions` **int** - Number of vector dimensions to produce.
297-
- `num_walks` **int** - The node2vec number of walks.
298-
- `walk_length` **int** - The node2vec walk length.
299-
- `window_size` **int** - The node2vec window size.
300-
- `iterations` **int** - The node2vec number of iterations.
301-
- `random_seed` **int** - The node2vec random seed.
302-
- `strategy` **dict** - Fully override the embed graph strategy.
303-
304-
### umap
305-
306-
Indicates whether we should run UMAP dimensionality reduction. This is used to provide an x/y coordinate to each graph node, suitable for visualization. If this is not enabled, nodes will receive a 0/0 x/y coordinate. If this is enabled, you *must* enable graph embedding as well.
307-
308-
#### Fields
309-
310-
- `enabled` **bool** - Whether to enable UMAP layouts.
311-
312288
### snapshots
313289

314290
#### Fields

docs/index/architecture.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ stateDiagram-v2
2323
Chunk --> EmbedDocuments
2424
ExtractGraph --> GenerateReports
2525
ExtractGraph --> EmbedEntities
26-
ExtractGraph --> EmbedGraph
2726
```
2827

2928
### LLM Caching

docs/index/default_dataflow.md

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ flowchart TB
4646
end
4747
subgraph phase6[Phase 6: Network Visualization]
4848
graph_outputs --> graph_embed[Graph Embedding]
49-
graph_embed --> umap_entities[Umap Entities]
50-
umap_entities --> combine_nodes[Final Entities]
49+
graph_embed --> combine_nodes[Final Entities]
5150
end
5251
subgraph phase7[Phase 7: Text Embeddings]
5352
textUnits --> text_embed[Text Embedding]
@@ -174,27 +173,8 @@ In this step, we link each document to the text-units that were created in the f
174173

175174
At this point, we can export the **Documents** table into the knowledge Model.
176175

177-
## Phase 6: Network Visualization (optional)
178176

179-
In this phase of the workflow, we perform some steps to support network visualization of our high-dimensional vector spaces within our existing graphs. At this point there are two logical graphs at play: the _Entity-Relationship_ graph and the _Document_ graph.
180-
181-
```mermaid
182-
---
183-
title: Network Visualization Workflows
184-
---
185-
flowchart LR
186-
ag[Graph Table] --> ge[Node2Vec Graph Embedding] --> ne[Umap Entities] --> ng[Entities Table]
187-
```
188-
189-
### Graph Embedding
190-
191-
In this step, we generate a vector representation of our graph using the Node2Vec algorithm. This will allow us to understand the implicit structure of our graph and provide an additional vector-space in which to search for related concepts during our query phase.
192-
193-
### Dimensionality Reduction
194-
195-
For each of the logical graphs, we perform a UMAP dimensionality reduction to generate a 2D representation of the graph. This will allow us to visualize the graph in a 2D space and understand the relationships between the nodes in the graph. The UMAP embeddings are reduced to two dimensions as x/y coordinates.
196-
197-
## Phase 7: Text Embedding
177+
## Phase 6: Text Embedding
198178

199179
For all artifacts that require downstream vector search, we generate text embeddings as a final step. These embeddings are written directly to a configured vector store. By default we embed entity descriptions, text unit text, and community report text.
200180

docs/index/methods.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ You can install it manually by running `python -m spacy download <model_name>`,
4141

4242
## Choosing a Method
4343

44-
Standard GraphRAG provides a rich description of real-world entities and relationships, but is more expensive that FastGraphRAG. We estimate graph extraction to constitute roughly 75% of indexing cost. FastGraphRAG is therefore much cheaper, but the tradeoff is that the extracted graph is less directly relevant for use outside of GraphRAG, and the graph tends to be quite a bit noisier. If high fidelity entities and graph exploration are important to your use case, we recommend staying with traditional GraphRAG. If your use case is primarily aimed at summary questions using global search, FastGraphRAG provides high quality summarization at much less LLM cost.
44+
Standard GraphRAG provides a rich description of real-world entities and relationships, but is more expensive than FastGraphRAG. We estimate graph extraction to constitute roughly 75% of indexing cost. FastGraphRAG is therefore much cheaper, but the tradeoff is that the extracted graph is less directly relevant for use outside of GraphRAG, and the graph tends to be quite a bit noisier. If high fidelity entities and graph exploration are important to your use case, we recommend staying with traditional GraphRAG. If your use case is primarily aimed at summary questions using global search, FastGraphRAG provides high quality summarization at much less LLM cost.

docs/index/outputs.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ List of all entities found in the data by the LM.
8282
| text_unit_ids | str[] | List of the text units containing the entity. |
8383
| frequency | int | Count of text units the entity was found within. |
8484
| degree | int | Node degree (connectedness) in the graph. |
85-
| x | float | X position of the node for visual layouts. If graph embeddings and UMAP are not turned on, this will be 0. |
86-
| y | float | Y position of the node for visual layouts. If graph embeddings and UMAP are not turned on, this will be 0. |
8785

8886
## relationships
8987
List of all entity-to-entity relationships found in the data by the LM. This is also the _edge list_ for the graph.

docs/visualization_guide.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@ Before building an index, please review your `settings.yaml` configuration file
88
snapshots:
99
graphml: true
1010
```
11-
(Optional) To support other visualization tools and exploration, additional parameters can be enabled that provide access to vector embeddings.
12-
```yaml
13-
embed_graph:
14-
enabled: true # will generate node2vec embeddings for nodes
15-
umap:
16-
enabled: true # will generate UMAP embeddings for nodes, giving the entities table an x/y position to plot
17-
```
1811
After running the indexing pipeline over your data, there will be an output folder (defined by the `storage.base_dir` setting).
1912

2013
- **Output Folder**: Contains artifacts from the LLM’s indexing pass.

graphrag/config/defaults.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -124,20 +124,6 @@ class DriftSearchDefaults:
124124
embedding_model_id: str = DEFAULT_EMBEDDING_MODEL_ID
125125

126126

127-
@dataclass
128-
class EmbedGraphDefaults:
129-
"""Default values for embedding graph."""
130-
131-
enabled: bool = False
132-
dimensions: int = 1536
133-
num_walks: int = 10
134-
walk_length: int = 40
135-
window_size: int = 2
136-
iterations: int = 3
137-
random_seed: int = 597832
138-
use_lcc: bool = True
139-
140-
141127
@dataclass
142128
class EmbedTextDefaults:
143129
"""Default values for embedding text."""
@@ -261,7 +247,6 @@ class InputDefaults:
261247
file_type: ClassVar[InputFileType] = InputFileType.text
262248
encoding: str = "utf-8"
263249
file_pattern: str = ""
264-
file_filter: None = None
265250
text_column: str = "text"
266251
title_column: None = None
267252
metadata: None = None
@@ -366,13 +351,6 @@ class SummarizeDescriptionsDefaults:
366351
model_id: str = DEFAULT_CHAT_MODEL_ID
367352

368353

369-
@dataclass
370-
class UmapDefaults:
371-
"""Default values for UMAP."""
372-
373-
enabled: bool = False
374-
375-
376354
@dataclass
377355
class UpdateIndexOutputDefaults(StorageDefaults):
378356
"""Default values for update index output."""
@@ -409,7 +387,6 @@ class GraphRagConfigDefaults:
409387
)
410388
cache: CacheDefaults = field(default_factory=CacheDefaults)
411389
input: InputDefaults = field(default_factory=InputDefaults)
412-
embed_graph: EmbedGraphDefaults = field(default_factory=EmbedGraphDefaults)
413390
embed_text: EmbedTextDefaults = field(default_factory=EmbedTextDefaults)
414391
chunks: ChunksDefaults = field(default_factory=ChunksDefaults)
415392
snapshots: SnapshotsDefaults = field(default_factory=SnapshotsDefaults)
@@ -426,7 +403,6 @@ class GraphRagConfigDefaults:
426403
extract_claims: ExtractClaimsDefaults = field(default_factory=ExtractClaimsDefaults)
427404
prune_graph: PruneGraphDefaults = field(default_factory=PruneGraphDefaults)
428405
cluster_graph: ClusterGraphDefaults = field(default_factory=ClusterGraphDefaults)
429-
umap: UmapDefaults = field(default_factory=UmapDefaults)
430406
local_search: LocalSearchDefaults = field(default_factory=LocalSearchDefaults)
431407
global_search: GlobalSearchDefaults = field(default_factory=GlobalSearchDefaults)
432408
drift_search: DriftSearchDefaults = field(default_factory=DriftSearchDefaults)

graphrag/config/init_content.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,12 +129,6 @@
129129
max_length: {graphrag_config_defaults.community_reports.max_length}
130130
max_input_length: {graphrag_config_defaults.community_reports.max_input_length}
131131
132-
embed_graph:
133-
enabled: false # if true, will generate node2vec embeddings for nodes
134-
135-
umap:
136-
enabled: false # if true, will generate UMAP embeddings for nodes (embed_graph must also be enabled)
137-
138132
snapshots:
139133
graphml: false
140134
embeddings: false

graphrag/config/models/embed_graph_config.py

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)