cognee/cognee/modules
hajdul88 508165e883
feature: Introduces wide subgraph search in graph completion and improves QA speed (#1736)
<!-- .github/pull_request_template.md -->

This PR introduces wide vector and graph structure filtering
capabilities. With these changes, the graph completion retriever and all
retrievers that inherit from it will now filter relevant vector elements
and subgraphs based on the query. This improvement significantly
increases search speed for large graphs while maintaining—and in some
cases slightly improving—accuracy.

Changes in This PR:

-Introduced new wide_search_top_k parameter: Controls the initial search
space size

-Added graph adapter level filtering method: Enables relevant subgraph
filtering while maintaining backward compatibility. For community or
custom graph adapters that don't implement this method, the system
gracefully falls back to the original search behavior.

-Updated modal dashboard and evaluation framework: Fixed compatibility
issues.
Added comprehensive unit tests: Introduced unit tests for
brute_force_triplet_search (previously untested) and expanded the
CogneeGraph test suite.

Integration tests: Existing integration tests verify end-to-end search
functionality (no changes required).

Acceptance Criteria and Testing

To verify the new search behavior, run search queries with different
wide_search_top_k parameters while logging is enabled:
None: Triggers a full graph search (default behavior)
1: Projects a minimal subgraph (demonstrates maximum filtering)
Custom values: Test intermediate levels of filtering

Internal Testing and results:
Performance and accuracy benchmarks are available upon request. The
implementation demonstrates measurable improvements in query latency for
large graphs without sacrificing result quality.

## Type of Change
<!-- Please check the relevant option -->
- [ ] Bug fix (non-breaking change that fixes an issue)
- [ ] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
- [x] Code refactoring
- [x] Performance improvement
- [ ] Other (please specify):

## Screenshots/Videos (if applicable)
None

## Pre-submission Checklist
<!-- Please check all boxes that apply before submitting your PR -->
- [x] **I have tested my changes thoroughly before submitting this PR**
- [x] **This PR contains minimal changes necessary to address the
issue/feature**
- [x] My code follows the project's coding standards and style
guidelines
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have added necessary documentation (if applicable)
- [x] All new and existing tests pass
- [x] I have searched existing PRs to ensure this change hasn't been
submitted already
- [x] I have linked any relevant issues in the description
- [x] My commits have clear and descriptive messages

## DCO Affirmation
I affirm that all code in every commit of this pull request conforms to
the terms of the Topoteretes Developer Certificate of Origin.

---------

Co-authored-by: Pavel Zorin <pazonec@yandex.ru>
2025-11-26 15:18:53 +01:00
..
chunking Merge branch 'dev' into feat/csv-ingestion 2025-11-14 14:46:11 +08:00
cloud feat: add welcome tutorial notebook for new users (#1425) 2025-09-18 18:07:05 +02:00
cognify
data Merge branch 'dev' into feat/csv-ingestion 2025-11-14 14:46:11 +08:00
engine fix: fixes distributed pipeline (#1454) 2025-10-09 14:06:25 +02:00
graph feature: Introduces wide subgraph search in graph completion and improves QA speed (#1736) 2025-11-26 15:18:53 +01:00
ingestion feat: Add dataset_id calculation that handles legacy dataset_id 2025-11-04 13:11:57 +01:00
memify feat: Enable multi-user mode to work with memify 2025-09-04 20:59:00 +02:00
metrics/operations
notebooks fix: add cognee to the local run environment 2025-11-06 13:03:11 +01:00
observability add none to default as observability 2025-09-18 10:41:25 +02:00
ontology feat: enhance ontology handling to support multiple uploads and retrievals 2025-11-14 22:13:00 +05:00
pipelines refactor: Account for async change for identify function 2025-11-04 13:13:42 +01:00
retrieval feature: Introduces wide subgraph search in graph completion and improves QA speed (#1736) 2025-11-26 15:18:53 +01:00
run_custom_pipeline feat: Add initial custom pipeline (#1716) 2025-11-04 17:58:34 +01:00
search feature: Introduces wide subgraph search in graph completion and improves QA speed (#1736) 2025-11-26 15:18:53 +01:00
settings Added Mistral support as LLM provider using litellm 2025-10-12 11:44:33 +02:00
storage/utils
sync feat: update sync to be two way (#1359) 2025-09-11 15:34:43 +02:00
users feat: enable multi user for falkor (#1689) 2025-11-11 17:03:48 +01:00
visualization add fix 2025-10-29 10:28:10 +01:00
__init__.py