Commit Graph

479 Commits

Author SHA1 Message Date
dependabot[bot] 1858955c48 Bump the github-actions group across 1 directory with 7 updates
Bumps the github-actions group with 7 updates in the / directory:

| Package | From | To |
| --- | --- | --- |
| [actions/checkout](https://github.com/actions/checkout) | `4` | `7` |
| [actions/setup-python](https://github.com/actions/setup-python) | `5` | `7` |
| [astral-sh/setup-uv](https://github.com/astral-sh/setup-uv) | `6` | `7` |
| [JamesIves/github-pages-deploy-action](https://github.com/jamesives/github-pages-deploy-action) | `4.6.4` | `4.8.0` |
| [actions/stale](https://github.com/actions/stale) | `9` | `10` |
| [dorny/paths-filter](https://github.com/dorny/paths-filter) | `3` | `4` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `4` | `7` |



Updates `actions/checkout` from 4 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4...v7)

Updates `actions/setup-python` from 5 to 7
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v5...v7)

Updates `astral-sh/setup-uv` from 6 to 7
- [Release notes](https://github.com/astral-sh/setup-uv/releases)
- [Commits](https://github.com/astral-sh/setup-uv/compare/v6...v7)

Updates `JamesIves/github-pages-deploy-action` from 4.6.4 to 4.8.0
- [Release notes](https://github.com/jamesives/github-pages-deploy-action/releases)
- [Commits](https://github.com/jamesives/github-pages-deploy-action/compare/v4.6.4...v4.8.0)

Updates `actions/stale` from 9 to 10
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v9...v10)

Updates `dorny/paths-filter` from 3 to 4
- [Release notes](https://github.com/dorny/paths-filter/releases)
- [Changelog](https://github.com/dorny/paths-filter/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dorny/paths-filter/compare/v3...v4)

Updates `actions/upload-artifact` from 4 to 7
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/setup-python
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/stale
  dependency-version: '10'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: actions/upload-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: astral-sh/setup-uv
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: dorny/paths-filter
  dependency-version: '4'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: JamesIves/github-pages-deploy-action
  dependency-version: 4.8.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-07-20 07:23:39 +00:00
gaudyb 14a00ad88f Release v3.1.1 (#2458)
gh-pages / build (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.11) (push) Has been cancelled
Python Build and Type Check / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Integration Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Notebook Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Publish (pypi) / Upload release to PyPI (push) Has been cancelled
Python Smoke Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Smoke Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (ubuntu-latest, 3.13) (push) Has been cancelled
Python Unit Tests / python-ci (windows-latest, 3.13) (push) Has been cancelled
Spellcheck / spellcheck (push) Has been cancelled
v3.1.1
2026-07-17 19:16:53 -06:00
Nathan Evans 0bb2865785 Fix JSONL loader handling of blank/invalid lines (#2434)
* Fix JSONL loader for blank and invalid rows

* Sync docs for schema and metadata fields

* Revert "Sync docs for schema and metadata fields"

This reverts commit 55f170f7d25f58ba4494f2dee8c5690fd282c778.
2026-07-17 14:45:30 -07:00
Nathan Evans 82c339a8bf Sync docs for schema and metadata fields (#2435)
* Sync docs for schema and metadata fields

* Clarify prepend_metadata raw_data note

* Align docs notebooks with v3 model APIs

* Clean notebook formatting in v3 model cells

* Use clean global_search params without pop workaround

* Fix dynamic global search notebook JSON mode param conflict

* Remove unused imports in docs drift notebook

* Restore drift notebook data setup variables

* Apply ruff format to drift notebook

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* remove outputs

---------

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-17 13:41:03 -07:00
gaudyb f5af4d251f Fix cannot release un-acquired lock in Blob logger (#2457)
* fix issue-2170

* semversioner change

* test changes

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

* fix syntax mismatch

---------

Co-authored-by: Gaudy Blanco <gaudy-microsoft@MacBook-Pro-m4-Gaudy-For-Work.local>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-07-17 13:27:16 -07:00
gaudyb 27a3675485 Issue 2265: Column length mismatch (#2442)
* fix issue 2265

* add semversioneer

* copilot feedback

---------

Co-authored-by: Gaudy Blanco <gaudy-microsoft@MacBook-Pro-m4-Gaudy-For-Work.local>
Co-authored-by: Nathan Evans <github@talkswithnumbers.com>
2026-07-17 12:46:37 -06:00
gaudyb 49c0911d0d Missing return type hints on generator functions in query/llm/text_utils.py (#2443)
* fix issue-2330

* semversioner change

* copilot feedback

---------

Co-authored-by: Gaudy Blanco <gaudy-microsoft@MacBook-Pro-m4-Gaudy-For-Work.local>
2026-07-17 11:22:29 -07:00
Derek Worthen 64a95d3d51 Dep sweep (#2441)
* build(deps): refresh lockfile and bump runtime constraints

- Refresh uv.lock within existing ranges (ruff 0.15.21, pyright 1.1.411)
- Bump azure-search-documents ~=12.0, pyarrow ~=25.0, aiofiles ~=25.1, lancedb ~=0.34.0, litellm ==1.92.0, pandas ~=3.0 (+ pandas-stubs)
- Hold graspologic-native on 1.2.x (1.3 changes Leiden clustering output)
- pandas 3.0: drop removed copy= kwarg from merge/concat calls
- Fix lint/type fallout from newer ruff/pyright to keep poe check green
- Hygiene: pin toml, dedupe markitdown, fix graphrag-input pin whitespace

* build(deps-dev): bump dev tooling to latest majors

- pytest ~=9.1, pytest-asyncio ~=1.4 (asyncio AUTO mode preserved)
- ipykernel ~=7.3
- semversioner ~=3.0 (verified current-version + changelog CLI)

* ci(dependabot): switch to uv ecosystem and cover workspace packages

- Use the dedicated uv ecosystem instead of generic pip
- Scan the workspace root and all packages/* member manifests via directories glob
- Group azure-* and dev tooling to reduce PR noise; group github-actions
- unified-search-app remains excluded (separate project at repo root)

* Bump dependencies.

* Fix type check and tests.

* Fix drift search.

* Fix streaming.

* Fix context management.
2026-07-17 08:38:45 -07:00
Derek Worthen dac4f721dd Fix .strip call (#2431)
- Resolves #2381
2026-07-10 14:00:01 -07:00
Derek Worthen 94a2095c6f Loosen service_tier type to str | None to allow for more flexibility … (#2430)
Loosen service_tier type to str | None to allow for more flexibility in service tier representation.

- Resolves #2389
2026-07-10 13:56:28 -07:00
Derek Worthen 2741015057 Fix logging bug. (#2429)
- Resolves #2254
2026-07-10 13:52:09 -07:00
Derek Worthen 6d02c2355c Update getting started docs. (#2367) 2026-05-28 09:53:15 -07:00
Derek Worthen 8679794df3 Release v3.1.0 (#2366) 2026-05-28 08:51:39 -07:00
Derek Worthen f7016ddfd0 Update litellm dependency. (#2365)
- Resolves #2331
2026-05-28 08:16:24 -07:00
disamhembere de531f0a69 feat: native CosmosTableProvider with namespace partitioning (#2354)
* feat: native CosmosTableProvider with namespace partitioning

Replace the parquet-decomposition approach in AzureCosmosStorage with a
native CosmosTableProvider that implements TableProvider directly:

- CosmosTableProvider: stores DataFrame rows as Cosmos documents with
  /namespace partition key. All queries are single-partition (no fan-out).
- CosmosTable: streaming Table impl with async SDK and server-side pagination.
- AzureCosmosStorage: simplified to key-value only (context.json, stats.json,
  cache). child() now works via ':'-separated namespace prefixes.
- TableProvider.child(): new non-abstract method for namespace isolation.
  ParquetTableProvider/CSVTableProvider delegate to Storage.child().
- Pipeline wiring: run_pipeline.py and utils.py use table_provider.child()
  for update-run delta/previous isolation.
- Legacy fallback: CosmosTableProvider reads from old containers when
  legacy_container is configured, enabling transparent migration.

Tested against Cosmos DB Linux emulator (vNext, ARM64).
302 unit tests + 15 verb tests pass (no regressions).

* fix: remove enable_cross_partition_query from async SDK calls

The async azure-cosmos SDK (v4.9) leaks this kwarg through to
aiohttp.ClientSession, causing TypeError. Omitting partition_key
achieves the same cross-partition behavior automatically.

Also documents the caveat in the design doc.

Verified: migration test passes all 5 phases against Cosmos emulator.

* feat: transactional batch writes with configurable batch_size

Add batch_size parameter (default 50, max 100) to CosmosTableProvider
and CosmosTable. Documents are written using Cosmos transactional
batch (execute_item_batch) for ~50× fewer network round-trips.

If a batch fails (e.g. payload too large), falls back to individual
upserts for that chunk so partial progress is never lost.

Config: table_provider.batch_size in settings.yaml
Propagates through child() and open() to streaming writes.

Tested: 120 rows at batch_size=50, 25 rows at batch_size=10,
75 streamed rows, clamping to max 100, child inheritance.

* chore: lint cleanup and dead code removal

- Remove unused _INTERNAL_FIELDS constant (duplicated _COSMOS_SYSTEM_KEYS)
- Fix TRY300: move returns to else blocks in AzureCosmosStorage
- Fix SIM105: use contextlib.suppress for CosmosResourceNotFoundError
- Fix SLF001: replace __new__ + private attr copy with __init__ in child()
- Fix RUF002: replace en-dash with hyphen in docstrings
- Fix D105: add __aiter__ docstring
- Add noqa: PERF401 for async iteration (false positive: no async listcomp)
- All ruff checks pass, pyright 0 errors, 317 tests pass

* fix: address code review findings

Critical fixes:
- Fix ID round-trip corruption: _strip_cosmos_metadata now restores
  original id from row_id field. Previously, read_dataframe returned
  '{table_name}:{key}' instead of the pipeline's original id value.
- Always store row_id on write (consistent between provider and table).
- has() now catches CosmosResourceNotFoundError specifically instead of
  bare Exception — auth/network errors propagate correctly.

Medium fixes:
- Add asyncio.Lock to _ensure_container() for concurrent-task safety.
- _batch_upsert catches only CosmosBatchOperationError for fallback;
  other exceptions (auth, network) now propagate instead of silently
  falling back to individual upserts.

Verified: ID round-trip, streaming write, no-id tables all pass
against Cosmos emulator. 317 unit/verb tests pass.

* chore: fix spellcheck and add semversioner change

- Add dictionary words: aiohttp, aiter, colls, serde, upserts, vnext
- Fix British spellings: serialisation→serialization, initialisation→initialization, behaviour→behavior
- Replace 'Unparameterized' with 'Non-parameterized'
- Add semversioner minor change file

* fix: update test_clear assertion for new clear() behavior

clear() now drops and recreates the container instead of deleting the
entire database. The container and database clients remain valid after
clear() — only the data is removed.

* refactor: extract Cosmos connection from Storage, not TableProviderConfig

Connection fields (connection_string, account_url, database_name) removed
from TableProviderConfig. The factory extracts them from the affiliated
AzureCosmosStorage instance when table_provider.type is cosmosdb.

This eliminates config duplication — credentials are defined once on
output_storage, and table_provider only carries table-specific fields
(container_name, batch_size, legacy_container).

Config example:
  output_storage:
    type: cosmosdb
    account_url: https://...
    database_name: graphrag
    container_name: graphrag-kv
  table_provider:
    type: cosmosdb
    container_name: graphrag-tables
    batch_size: 50

* perf: batch deletes in _delete_table to match write batching

Use transactional batches for delete operations instead of
one-at-a-time delete_item calls, mirroring the _batch_upsert pattern.
Falls back to individual deletes on CosmosBatchOperationError.
2026-05-13 12:25:45 -07:00
gaudyb 0da2a4dd3e Release v3.0.9 (#2321)
Co-authored-by: Gaudy Blanco <gaudy-microsoft@MacBook-Pro-m4-Gaudy-For-Work.local>
3.0.9
2026-04-13 13:21:05 -06:00
gaudyb 080e665c23 parquet reader implementation as a new input type (#2320)
parquet reader impl

Co-authored-by: Gaudy Blanco <gaudy-microsoft@MacBook-Pro-m4-Gaudy-For-Work.local>
2026-04-09 14:03:13 -06:00
Derek Worthen ebc8d61f46 Support client side json validation. (#2306)
- Addresses #2286
- Resolves #2263
2026-04-07 08:09:40 -07:00
Derek Worthen b1f0e6c345 Fix broken documentation links. (#2305)
- Addresses #2258 and #2287
- Resolves #2249

Co-authored-by: Br1an67 <932039080@qq.com>
2026-03-30 06:46:02 -07:00
Derek Worthen 74239e8e14 Release v3.0.8 (#2299) 2026-03-27 11:45:08 -07:00
Derek Worthen df2a8b32e0 bump nltk to resolve [CVE-2025-14009](https://github.com/advisories/GHSA-7p94-766c-hgjp) (#2298) 2026-03-27 08:52:22 -07:00
Derek Worthen ac142c5ed4 Release v3.0.7 (#2291) 2026-03-24 10:15:48 -07:00
Derek Worthen f0fd676729 Pin litellm dependency (#2290)
- Response to #2289
2026-03-24 09:30:11 -07:00
Dayenne Souza 3502c22209 reconfigure vector store size (#2281) 2026-03-17 14:09:55 -07:00
Dayenne Souza ae2508d37a Release v3.0.6 (#2267) 2026-03-06 17:02:49 -03:00
Dayenne Souza bb9afeb898 nlp streaming (#2264)
* fix cooccurences

* unused async fixes
2026-03-03 18:59:21 -03:00
Dayenne Souza bfd42c1ecd remove relationships with phantom entities (#2261)
* filter phantom relationships

* fix flush size
2026-03-03 10:18:34 -03:00
Dayenne Souza 1ceb00c4de Release v3.0.5 (#2252) v3.0.5 2026-02-27 18:17:11 -03:00
Dayenne Souza 6f26d0ec6f vector load_documents in batches (#2251)
* vectors bulk load_documents

* vector load

* add upsert work into dictionary

* fic dictionary
2026-02-27 17:59:11 -03:00
Dayenne Souza 64c55522fd fix csv file reader (#2248)
* fix

* fix test with inline content

* fix format
2026-02-24 22:10:59 -03:00
gaudyb a82d186fd2 Release v3.0.4 (#2247)
* Release v3.0.4

* release v3.0.4
v3.0.4
2026-02-24 16:51:02 -06:00
gaudyb 0a29d27825 Release v3.0.3 (#2245)
Co-authored-by: Gaudy Blanco <gaudy-microsoft@MacBook-Pro-m4-Gaudy-For-Work.local>
2026-02-24 14:54:28 -06:00
Dayenne Souza 47fae95393 write stats per workflow (#2244)
add stats write
2026-02-23 19:17:21 -03:00
Dayenne Souza 1cedb796b3 streaming create_final_documents (#2243)
* streaming create_final_documents

* add semversioner
2026-02-23 14:16:39 -03:00
Dayenne Souza ba9169a232 streaming finalize_graph (#2240)
* add streaming

* add patch

* fix spelling

* add improvements and test
2026-02-23 13:57:52 -03:00
Nathan Evans cd0c405887 feat(graphrag-vectors): add filtering, timestamps, and CRUD operations (#2236)
* feat(graphrag-vectors): add filtering, timestamps, and CRUD operations

Implement the vector store enhancements from the graphrag-vectors-design spec:

New modules:
- filtering.py: Pydantic-based filter expression system with F builder,
  operator overloads, JSON serialization, client-side evaluate(), and
  per-backend compilation (SQL for LanceDB/CosmosDB, OData for Azure AI Search)
- timestamp.py: ISO 8601 timestamp explosion into filterable component fields

Enhanced VectorStoreDocument:
- data: dict for user-defined metadata fields
- create_date / update_date: automatic ISO 8601 timestamps

Enhanced VectorStore base class:
- fields config for typed metadata columns
- insert / count / remove / update CRUD methods
- select, filters, include_vectors params on search methods
- Automatic timestamp explosion on insert/update
- User-defined date field explosion

Backend implementations (LanceDB, Azure AI Search, CosmosDB):
- Full filter compilation to native query languages
- Typed schema creation with user-defined fields
- All new CRUD operations

Breaking changes:
- search_by_id raises IndexError when document not found
- Updated indexer_adapters.py caller to handle the new exception

Tests:
- 54 unit tests for filtering and timestamp modules
- 28 LanceDB integration tests covering CRUD, filters, timestamps, select,
  include_vectors, and user-defined date field explosion

* fix: resolve CI build failures (formatting, lint, pyright, test mocks)

- Fix ruff formatting and lint errors across all changed files
- Refactor filtering.py: move operator overloads from monkey-patching to
  direct class methods for pyright visibility
- Use validation_alias/serialization_alias with populate_by_name for
  Pydantic AND/OR/NOT models (pyright + runtime compatible)
- Use Operator enum members instead of string literals in FieldRef
- Add missing abstract methods (insert, count, remove, update) to test
  mock VectorStore classes
- Update mock method signatures to match base class (select, filters,
  include_vectors params)
- Add docstrings to FieldRef magic methods (ruff D105)
- Fix noqa:S608 placement in cosmosdb.py

* feat: add top-level vector_size to VectorStoreConfig

Add a vector_size field (default 3072) to VectorStoreConfig so users
can set it once instead of on every individual index schema. The value
is propagated to new IndexSchema entries during validation.

* chore: add semversioner patch entry

* chore: add ismatch and ftype to spellcheck dictionary

* Add example notebooks for LanceDB, Azure AI Search, and CosmosDB vector stores

- Three notebooks demonstrating: document loading, similarity search, metadata
  filtering with F builder, timestamp filtering, document update/removal
- Sample data files (text_units.parquet, embeddings.text_unit_text.parquet)
- Add CPY001, SLF001, DTZ005 to notebook lint ignores in pyproject.toml

* refactor: extract model/tokenizer creation from generate_text_embeddings into callers
2026-02-20 15:39:08 -08:00
Dayenne Souza 97045b55fe generate_text_embeddings streaming (#2241)
* addd streaming

* fixes
2026-02-20 19:53:32 -03:00
Dayenne Souza bf1034a7eb Streaming create_final_text_units (#2238)
* addd streaming to create_final_text_units - also removed pandas from its internal workflow logic

* fix comment

* fix test

* fix typo

* add suggestion

* add csv tests data

* fix spell
2026-02-20 11:18:00 -03:00
Dayenne Souza ac7ce32b61 Streaming create communities (#2237)
* add manual release instructions

* create streaming

* fix deleted file

* addd file

* fix check

* add consistency

* fix logic
2026-02-19 15:39:58 -03:00
Dayenne Souza 6d9f0dcf30 add release doc (#2235)
* add release doc

* fix spellcheck
2026-02-18 21:14:38 -03:00
gaudyb 20d30fd93b Cosmosdb communities bug (#2232)
* work in progress

* cosmosdb output error fix

* semserver update

* remove unnecessary code

* clean code

* remove unnecessary prints
2026-02-17 15:59:36 -06:00
Dayenne Souza 79d7a70c94 modify smoke tests to include csv table provider (#2229)
* add smoke tests for output csv

* change text fixture test

* change test

* add semver

* run format

---------

Co-authored-by: Nathan Evans <github@talkswithnumbers.com>
2026-02-13 19:23:26 -03:00
Dayenne Souza 71445a3f44 load_input_documents and create_base_text_units streaming (#2221)
* add streaming read

* fix formatting

* create csv streaming write

* add parquettable to simulate streaming

* add sample rows return

* add load_input_documents and truncate mode to Table

* add semver

* addd csv output reader fix

* run formatter

* add csv config
2026-02-13 12:59:40 -08:00
Dayenne Souza 9032b79654 Release v3.0.2 (#2230) v3.0.2 2026-02-13 15:39:28 -03:00
Nathan Evans e1c92cc006 Remove networkx (#2228)
* Replace NX-based compute_degree with DataFrame-only implementation

- Add graphrag.graphs package with compute_degree operating directly on
  relationships DataFrames instead of building NetworkX graphs
- Update finalize_entities and finalize_relationships to use the new
  utility, eliminating NX graph construction in those paths
- Remove the old compute_degree operation from index/operations
- Add side-by-side tests validating parity with NetworkX degree output

* Add DataFrame-based connected components and LCC utilities

- Add connected_components and largest_connected_component to
  graphrag.graphs using union-find on edge list DataFrames
- Fix compute_degree to normalise edge direction so (A,B) and (B,A)
  are treated as the same undirected edge
- Replace NX largest_connected_component in prune_graph operation with
  the new DataFrame utility via graph_to_dataframes
- Add realistic A Christmas Carol graph fixture (529 nodes, 978 edges)
  converted from verb test parquet data
- Add side-by-side tests for connected components and fixture-based
  test for compute_degree, all validated against NetworkX

* Add DataFrame-based stable LCC utility with side-by-side tests

* Wire stable_lcc into cluster_graph, replacing NX stable_largest_connected_component

* Remove NetworkX from clustering pipeline

- cluster_graph now accepts a DataFrame instead of nx.Graph
- hierarchical_leiden now accepts list[tuple[str, str, float]] edge list
- create_communities passes relationships DataFrame directly, removing
  create_graph dependency
- Edge direction normalization and deduplication (keep='last') replaces
  implicit NX dedup behavior
- Modularity helper callers convert to edge list via _nx_to_edge_list

* Remove NetworkX from prune_graph

- prune_graph operation now accepts (entities, relationships) DataFrames
  instead of nx.Graph, returns pruned DataFrames directly
- Uses compute_degree for degree calculation, largest_connected_component
  for LCC filtering — no NetworkX
- Workflow no longer round-trips through create_graph/graph_to_dataframes
- Reset index on returned DataFrames to avoid downstream alignment errors

* Move old NX utilities out of production code

- Move stable_lcc (NX version) to tests/unit/graphs/nx_stable_lcc.py
  for side-by-side comparison tests only
- Delete graph_to_dataframes.py (dead code, zero imports)
- Update test imports to use the new test helper location

* Delete create_graph, inline into snapshot_graphml

- snapshot_graphml now accepts edges DataFrame directly and calls
  nx.from_pandas_edgelist internally
- finalize_graph workflow passes relationships DataFrame to snapshot
- Removed create_graph.py (no remaining callers)

* Move graph utilities from index/utils/graphs.py to graphrag/graphs/ modules

- hierarchical_leiden, first/final_level_hierarchical_clustering → graphs/hierarchical_leiden.py
- calculate_pmi/rrf_edge_weights → graphs/edge_weights.py
- calculate_* modularity functions, _df_to_edge_list → graphs/modularity.py
- NX-based modularity/LCC/edge-list helpers removed (replaced by DF-based equivalents)
- Delete index/utils/graphs.py (no remaining callers)
- Update cluster_graph.py and build_noun_graph.py to import from new locations
- Inline NX largest_connected_component into test helper nx_stable_lcc.py
- Add side-by-side modularity tests (9 tests comparing DF vs NX)

* Add semversioner patch for NetworkX removal

* Spelling

* Spelling config

* Fix British English spellings to American English
2026-02-13 09:28:32 -08:00
Dayenne Souza 8d4080c414 add memory profiling (#2227)
* add profiling

* add unit test for profiling

* fix property name
2026-02-11 20:15:07 -03:00
Nathan Evans 0321329a0f Add async iterator support to InputReader and use in load workflows (#2226)
* Add async iterator support to InputReader and use in load workflows

InputReader now implements __aiter__ so it can be used as `async for doc in reader`. The core iteration logic is in _iterate_files(), and read_files() delegates to the iterator for batch loading. Both load_input_documents and load_update_documents workflows now use the async iterator with dataclasses.asdict for DataFrame construction.

* Format
2026-02-11 14:34:04 -08:00
Nathan Evans e48bb04110 Streamline workflows (#2225)
* Move document ID, human_readable_id, and raw_data setup from create_final_documents into load workflows

Consolidates core document field initialization (id string cast, human_readable_id index, raw_data default) into load_input_documents and load_update_documents so that create_final_documents only handles the text unit join. Also applies the same setup in the run_pipeline input_documents bypass paths.

* Remove overzealous input document assignment

* Semver

* Format
2026-02-11 14:01:44 -08:00
gaudyb 8832370208 Add notebook example support for each package (#2205)
* add notebook example support for each package

* add notebook example support for each package

* semversioner change

* feedback implemented for notebooks

* feedback implemented for notebooks

* feedback implemented for notebooks

---------

Co-authored-by: Gaudy Blanco <gaudy-microsoft@MacBook-Pro-m4-Gaudy-For-Work.local>
2026-02-11 14:54:08 -06:00
Nathan Evans e3278c0357 Add DataReader class for typed dataframe loading (#2220)
* Add DataReader class for typed dataframe loading

Introduce DataReader that wraps TableProvider and applies type coercion
functions when loading dataframes from weakly-typed formats (e.g. CSV).

- Add DataReader class with methods for each table type: entities,
  relationships, communities, community_reports, covariates, text_units,
  and documents
- Add typed loading functions in dfs.py for community_reports, covariates,
  text_units, and documents (entities, relationships, communities already
  existed)
- Integrate DataReader into all 17 indexing workflows replacing raw
  read_dataframe calls
- Integrate DataReader into CLI query's _resolve_output_files for typed
  loading across all search types (global, local, drift, basic)
- Export DataReader from data_model package __init__

* Fix column check
2026-02-10 08:03:28 -08:00