Skip to content

Conversation

@hajdul88
Copy link
Collaborator

@hajdul88 hajdul88 commented Dec 10, 2025

Description

This PR restructures/adds integration and unit tests for the retrieval module.

-Old integration tests were updated and moved under unit tests + fixtures added
-Added missing unit tests for all core retrieval business logic
-Covered 100% of the core retrievers with tests
-Minor changes (dead code deletion, typo fixed)

Type of Change

  • 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
  • Code refactoring
  • Performance improvement
  • Other (please specify):

Screenshots/Videos (if applicable)

Pre-submission Checklist

  • I have tested my changes thoroughly before submitting this PR
  • This PR contains minimal changes necessary to address the issue/feature
  • My code follows the project's coding standards and style guidelines
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if applicable)
  • All new and existing tests pass
  • I have searched existing PRs to ensure this change hasn't been submitted already
  • I have linked any relevant issues in the description
  • 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.

Summary by CodeRabbit

  • Changes

    • TripletRetriever now returns up to 5 results by default (was 1), providing richer context.
  • Tests

    • Reorganized test coverage: many unit tests removed and replaced with comprehensive integration tests across retrieval components (graph, chunks, RAG, summaries, temporal, triplets, structured output).
  • Chores

    • Simplified triplet formatting logic and removed debug output.

✏️ Tip: You can customize this high-level summary in your review settings.

@pull-checklist
Copy link

Please make sure all the checkboxes are checked:

  • I have tested these changes locally.
  • I have reviewed the code changes.
  • I have added end-to-end and unit tests (if applicable).
  • I have updated the documentation and README.md file (if necessary).
  • I have removed unnecessary code and debug statements.
  • PR title is clear and follows the convention.
  • I have tagged reviewers or team members for feedback.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 10, 2025

Walkthrough

Removes numerous unit tests, adds new integration tests for retrieval modules, changes TripletRetriever.default top_k from 1 to 5, and simplifies formatting in brute-force triplet search by removing a helper and a debug print.

Changes

Cohort / File(s) Summary
Deleted Unit Tests
cognee/tests/unit/modules/retrieval/chunks_retriever_test.py, cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py, cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py, cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py, cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py, cognee/tests/unit/modules/retrieval/summaries_retriever_test.py, cognee/tests/unit/modules/retrieval/conversation_history_test.py, cognee/tests/unit/modules/retrieval/temporal_retriever_test.py, cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py, cognee/tests/unit/modules/retrieval/triplet_retriever_test.py
Removed ten unit test modules (all test classes and functions deleted). These were end-to-end/integration-style unit tests for various retrievers and related utilities.
Added Integration Tests
cognee/tests/integration/retrieval/test_chunks_retriever.py, cognee/tests/integration/retrieval/test_graph_completion_retriever.py, cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py, cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py, cognee/tests/integration/retrieval/test_rag_completion_retriever.py, cognee/tests/integration/retrieval/test_summaries_retriever.py, cognee/tests/integration/retrieval/test_temporal_retriever.py, cognee/tests/integration/retrieval/test_triplet_retriever.py, cognee/tests/integration/retrieval/test_structured_output.py
Added nine integration test modules with pytest-asyncio fixtures for simple/complex/empty scenarios, seeding data, vector-engine integration, and assertions for retriever behaviors and edge cases.
TripletRetriever Default Parameter Update
cognee/modules/retrieval/triplet_retriever.py
Changed top_k default in TripletRetriever.__init__ from 1 to 5.
Brute-force Triplet Search Cleanup
cognee/modules/retrieval/utils/brute_force_triplet_search.py
Removed a debug print and a nested filter_attributes helper; replaced with inline comprehension-based filtering in format_triplets.
Test Fixture & Assertion Adjustments
cognee/tests/integration/retrieval/test_structured_output.py, cognee/tests/integration/retrieval/test_triplet_retriever.py, cognee/tests/unit/eval_framework/benchmark_adapters_test.py, cognee/tests/unit/eval_framework/corpus_builder_test.py, cognee/tests/unit/eval_framework/benchmark_adapters_test.py
Centralized setup/teardown into fixtures (setup_test_environment variants), added/adjusted assertions and mocks for Hotpot-style corpora in eval framework tests, and strengthened some triplet/structured-output test assertions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~35 minutes

  • Areas needing extra attention:
    • Ensure parity between deleted unit tests and newly added integration tests (no unintended coverage loss).
    • Validate callers of TripletRetriever for expectations tied to previous top_k=1.
    • Confirm inline filtering in format_triplets preserves previous behavior for nested attributes.
    • Review test fixtures' cleanup to avoid cross-test state leakage.

Possibly related PRs

Suggested reviewers

  • pazone
  • lxobr

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: reorganizing retriever tests and adding new integration tests, which aligns with the PR objectives of restructuring tests and achieving 100% coverage.
Description check ✅ Passed The description covers key aspects: restructuring/adding integration and unit tests, moving old tests into unit tests with fixtures, achieving 100% coverage, and minor code changes. Most required template sections are completed with checked boxes, though specific issue links are not explicitly shown.
Docstring Coverage ✅ Passed Docstring coverage is 97.49% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/cog-3532-empower-test_search-db-retrievers-tests-reorg

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@hajdul88 hajdul88 self-assigned this Dec 10, 2025
@hajdul88 hajdul88 marked this pull request as draft December 10, 2025 10:02
@hajdul88 hajdul88 changed the title chore: retriever test reorganization + adding new tests (unit + integration) (WIP) chore: retriever test reorganization + adding new tests (unit + integration) Dec 11, 2025
@hajdul88 hajdul88 marked this pull request as ready for review December 11, 2025 14:34
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py (1)

385-398: Test setup does not match implementation behavior.

Looking at the get_memory_fragment implementation, the code calls memory_fragment.project_graph_from_db(graph_engine, ...) on the CogneeGraph instance, not on the graph_engine itself. Setting mock_graph_engine.project_graph_from_db to raise an exception won't trigger the error path being tested.

This test should patch CogneeGraph to return a mock that raises an exception, similar to the test above it.

 @pytest.mark.asyncio
 async def test_get_memory_fragment_returns_empty_graph_on_error():
     """Test that get_memory_fragment returns empty graph on generic error."""
     mock_graph_engine = AsyncMock()
-    mock_graph_engine.project_graph_from_db = AsyncMock(side_effect=Exception("Generic error"))
+    
+    mock_fragment = MagicMock(spec=CogneeGraph)
+    mock_fragment.project_graph_from_db = AsyncMock(side_effect=Exception("Generic error"))
+    mock_fragment.nodes = []
 
-    with patch(
-        "cognee.modules.retrieval.utils.brute_force_triplet_search.get_graph_engine",
-        return_value=mock_graph_engine,
+    with (
+        patch(
+            "cognee.modules.retrieval.utils.brute_force_triplet_search.get_graph_engine",
+            return_value=mock_graph_engine,
+        ),
+        patch(
+            "cognee.modules.retrieval.utils.brute_force_triplet_search.CogneeGraph",
+            return_value=mock_fragment,
+        ),
     ):
         fragment = await get_memory_fragment()
 
-        assert isinstance(fragment, CogneeGraph)
-        assert len(fragment.nodes) == 0
+        assert fragment == mock_fragment
+        mock_fragment.project_graph_from_db.assert_awaited_once()
cognee/tests/integration/retrieval/test_triplet_retriever.py (1)

44-48: Avoid bare except in cleanup handlers.

Same issue as in test_temporal_retriever.py: bare except Exception suppresses all exceptions, including those that might indicate cleanup failures requiring attention.

Be more specific or at minimum log the exception:

     try:
         await cognee.prune.prune_data()
         await cognee.prune.prune_system(metadata=True)
-    except Exception:
-        pass
+    except Exception as e:
+        print(f"Cleanup warning: {e}")

Also applies to: 70-74

♻️ Duplicate comments (2)
cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py (1)

16-60: Consider extracting common fixture setup logic.

These three fixtures share the same setup/teardown pattern seen in test_temporal_retriever.py. Consider using a shared helper function as suggested in that file's review.

Also applies to: 62-134, 136-161

cognee/tests/integration/retrieval/test_graph_completion_retriever.py (1)

14-74: Consider extracting common fixture setup logic.

These fixtures share the same setup/teardown pattern seen across multiple integration test files. Consider creating a shared helper to reduce duplication.

Also applies to: 76-144, 146-171

🧹 Nitpick comments (21)
cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py (2)

663-663: Simplify redundant assertion logic.

The assertion assert "None" not in result or result.count("None") == 0 is logically redundant. If "None" not in result is True, the assertion passes. If "None" is in the result, then result.count("None") will always be > 0, making the second condition False. This simplifies to just checking if "None" is not in the result.

-    assert "None" not in result or result.count("None") == 0
+    assert "None" not in result

359-359: Consider removing implementation line number references from docstrings.

References to specific line numbers in the implementation (e.g., "line 85", "lines 145-147") are brittle and will become stale as the codebase evolves. The test names and descriptions already clearly communicate the behavior being tested.

For example:

-    """Test that get_memory_fragment returns empty graph when entity not found (line 85)."""
+    """Test that get_memory_fragment returns empty graph when entity not found."""

Similar changes apply to docstrings at lines 667, 689, 703, 736, 756, and 789.

cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py (1)

30-47: Consider asserting all passed parameters.

The test passes wide_search_top_k, triplet_distance_penalty, and system_prompt but doesn't assert their values. If these are accessible as instance attributes (even if stored by the parent class), consider adding assertions to ensure they're properly set.

Example additions:

     assert retriever.top_k == 10
     assert retriever.save_interaction is True
+    assert retriever.system_prompt == "Custom system prompt"
+    assert retriever.wide_search_top_k == 200
+    assert retriever.triplet_distance_penalty == 2.5
cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py (1)

30-311: Consider adding error handling and edge case tests.

While the current tests provide excellent coverage of success paths, consider adding:

  1. Error handling tests (LLM failures, graph engine exceptions)
  2. Edge case tests (empty feedback text, special characters, very long input)

These additions would improve test robustness and catch potential failure scenarios.

cognee/tests/unit/modules/retrieval/test_completion.py (2)

6-228: Generate completion tests look solid; consider tightening read_query_prompt assertions and DRYing setup

This suite exercises the key branches of generate_completion (system prompt vs file, conversation history, response_model, and prompt rendering) and matches the implementation behavior well.

Two optional improvements:

  • Where you patch read_query_prompt (e.g., Lines 45-58, 81-94, 163-171, 200-208), also assert its call signature (assert_called_once_with(system_prompt_path)) to lock in the expected prompt-path wiring, similar to what you already do for summarize_text.
  • The repeated patch setup for render_prompt and LLMGateway.acreate_structured_output across these tests could be factored into pytest fixtures or helper functions to reduce duplication and keep individual tests more focused on behavior.

You could also add a short class-level docstring on TestGenerateCompletion summarizing the scenarios covered, but that’s purely stylistic.


230-343: Summarize text tests cover main paths; consider adding a custom response_model case and reusing setup

These tests nicely validate summarize_text behavior for:

  • Provided vs file-based system prompts
  • Default vs custom system_prompt_path
  • Forwarding of text_input to the LLM gateway

Two optional extensions:

  • Add a test variant that passes a non-default response_model (e.g., a MagicMock or a simple model type) and asserts it’s forwarded to LLMGateway.acreate_structured_output, mirroring what you do for generate_completion.
  • As with the previous class, you can reduce repetition by introducing shared fixtures/helpers for the read_query_prompt and LLM patches, and optionally add a brief class docstring for TestSummarizeText.
cognee/modules/retrieval/triplet_retriever.py (1)

34-39: Redundant None check due to default value.

The parameter top_k already defaults to 5 in the signature (line 34), so the conditional on line 39 only guards against explicit None being passed. If the intent is to allow callers to explicitly pass None to reset to default, this is acceptable. Otherwise, consider simplifying:

     def __init__(
         self,
         user_prompt_path: str = "context_for_question.txt",
         system_prompt_path: str = "answer_simple_question.txt",
         system_prompt: Optional[str] = None,
-        top_k: Optional[int] = 5,
+        top_k: int = 5,
     ):
         """Initialize retriever with optional custom prompt paths."""
         self.user_prompt_path = user_prompt_path
         self.system_prompt_path = system_prompt_path
-        self.top_k = top_k if top_k is not None else 5
+        self.top_k = top_k
         self.system_prompt = system_prompt
cognee/tests/unit/modules/retrieval/temporal_retriever_test.py (1)

1-9: Unused import os.

The os module is imported on line 3 but does not appear to be used anywhere in the test file. Consider removing it.

 from types import SimpleNamespace
 import pytest
-import os
 from unittest.mock import AsyncMock, patch, MagicMock
 from datetime import datetime
cognee/tests/integration/retrieval/test_structured_output.py (2)

1-6: Unused imports asyncio and os.

Neither asyncio nor os appear to be used in this test file. Consider removing them.

-import asyncio
-import os
 import pytest
 import pathlib
 import pytest_asyncio
 import cognee

199-203: Bare exception handler silences cleanup failures.

The teardown uses a broad except Exception: pass which may hide important errors during cleanup. Consider logging the exception or being more selective about which exceptions to ignore.

     try:
         await cognee.prune.prune_data()
         await cognee.prune.prune_system(metadata=True)
-    except Exception:
-        pass
+    except Exception as e:
+        import logging
+        logging.getLogger(__name__).warning(f"Cleanup failed during teardown: {e}")
cognee/tests/integration/retrieval/test_summaries_retriever.py (2)

1-5: Unused import os.

The os module is imported but not used in this test file.

-import os
 import pytest
 import pathlib
 import pytest_asyncio
 import cognee

131-135: Bare exception handler in teardown.

Same issue as other fixtures - consider logging cleanup failures rather than silently ignoring them.

     try:
         await cognee.prune.prune_data()
         await cognee.prune.prune_system(metadata=True)
-    except Exception:
-        pass
+    except Exception as e:
+        import logging
+        logging.getLogger(__name__).warning(f"Cleanup failed: {e}")
cognee/tests/unit/modules/retrieval/conversation_history_test.py (1)

22-38: Consider import placement for consistency.

The test imports get_conversation_history inside the with block context. While this ensures the patch is active during import, it's an unconventional pattern. This is acceptable for testing scenarios where the module caches references at import time, but consider adding a brief comment explaining this choice for future maintainers.

cognee/tests/integration/retrieval/test_temporal_retriever.py (1)

15-128: Consider extracting common fixture setup logic to reduce duplication.

The three fixtures share nearly identical setup and teardown patterns (configuring directories, pruning, setup, yield, cleanup). This duplication increases maintenance burden.

Consider creating a helper function or a parameterized fixture to reduce duplication:

async def setup_test_env(test_name: str):
    """Helper to set up test environment with custom paths."""
    base_dir = pathlib.Path(__file__).parent.parent.parent.parent
    system_directory_path = str(base_dir / f".cognee_system/{test_name}")
    data_directory_path = str(base_dir / f".data_storage/{test_name}")
    
    cognee.config.system_root_directory(system_directory_path)
    cognee.config.data_root_directory(data_directory_path)
    
    await cognee.prune.prune_data()
    await cognee.prune.prune_system(metadata=True)
    await setup()

async def teardown_test_env():
    """Helper to tear down test environment."""
    try:
        await cognee.prune.prune_data()
        await cognee.prune.prune_system(metadata=True)
    except Exception:
        pass

Then simplify each fixture to focus on its unique data setup.

cognee/tests/integration/retrieval/test_triplet_retriever.py (1)

112-119: Redundant setup() call in test.

Line 114 explicitly calls await setup() after the fixture has already set up the environment. The setup_test_environment_empty fixture should handle all necessary setup, making this call redundant and potentially confusing.

Remove the redundant setup call:

 @pytest.mark.asyncio
 async def test_triplet_retriever_context_empty(setup_test_environment_empty):
     """Integration test: verify TripletRetriever handles empty graph correctly."""
-    await setup()
-
     retriever = TripletRetriever()
 
     with pytest.raises(NoDataError):
         await retriever.get_context("Alice")

If the explicit setup is needed, this suggests the fixture might not be working as intended and should be investigated.

cognee/tests/integration/retrieval/test_graph_completion_retriever.py (1)

173-237: Consider parameterizing repeated assertion patterns.

Lines 180-236 contain many similar assertions checking for node headers, content blocks, and connections. This repetitive pattern could be refactored for maintainability.

Consider using parameterized checks:

expected_nodes = ["Steve Rodger", "Figma", "Ike Loma", "Jason Statham", "Mike Broski", "Canva", "Christina Mayer"]
for node_name in expected_nodes:
    assert f"Node: {node_name}" in context, f"Missing node header for {node_name}"

expected_descriptions = [
    ("Steve Rodger", "This is description about Steve Rodger"),
    ("Figma", "Figma is a company"),
    # ... more entries
]
for name, desc in expected_descriptions:
    expected_block = f"__node_content_start__\n{desc}\n__node_content_end__"
    assert expected_block in context, f"Description block for {name} altered"

expected_connections = [
    ("Steve Rodger", "works_for", "Figma"),
    # ... more entries
]
for from_node, rel, to_node in expected_connections:
    expected_conn = f"{from_node} --[{rel}]--> {to_node}"
    assert expected_conn in context, f"Connection {from_node}{to_node} missing or changed"

This reduces duplication and makes it easier to maintain the test.

cognee/tests/integration/retrieval/test_chunks_retriever.py (2)

20-28: Consider extracting DocumentChunkWithEntities to shared test utilities.

This test data model is duplicated in cognee/tests/integration/retrieval/test_rag_completion_retriever.py (lines 20-28). Extract it to a shared test utilities module (e.g., cognee/tests/fixtures/models.py) to follow the DRY principle and ensure consistency across integration tests.


31-200: Consider refactoring duplicated fixture setup/teardown logic.

The three fixtures (setup_test_environment_with_chunks_simple, setup_test_environment_with_chunks_complex, setup_test_environment_empty) share significant setup and teardown code:

  • Path configuration (lines 34-36, 93-95, 184-186)
  • System/data directory setup (lines 38-39, 97-98, 188-189)
  • Prune and setup calls (lines 41-43, 100-102, 191-192)
  • Cleanup logic (lines 83-87, 174-178, 196-200)

Consider extracting common fixture logic into a base fixture or helper function to reduce code duplication and improve maintainability.

cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py (1)

14-154: Consider refactoring duplicated fixture setup/teardown logic.

Similar to test_chunks_retriever.py, these fixtures share significant setup and teardown code. The path configuration, prune/setup calls, and cleanup logic are repeated across all three fixtures. Consider extracting common patterns into a base fixture or helper function.

cognee/tests/integration/retrieval/test_rag_completion_retriever.py (2)

20-28: Consider extracting DocumentChunkWithEntities to shared test utilities.

This test data model is duplicated from cognee/tests/integration/retrieval/test_chunks_retriever.py (lines 20-28). Extract it to a shared test utilities module to follow the DRY principle.


31-204: Consider refactoring duplicated fixture setup/teardown logic.

The three fixtures share significant setup and teardown code that could be extracted into a base fixture or helper function, similar to the patterns in other integration test files in this PR.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7961e96 and 994d802.

📒 Files selected for processing (24)
  • cognee/modules/retrieval/triplet_retriever.py (1 hunks)
  • cognee/modules/retrieval/utils/brute_force_triplet_search.py (0 hunks)
  • cognee/tests/integration/retrieval/test_chunks_retriever.py (1 hunks)
  • cognee/tests/integration/retrieval/test_graph_completion_retriever.py (1 hunks)
  • cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py (1 hunks)
  • cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py (1 hunks)
  • cognee/tests/integration/retrieval/test_rag_completion_retriever.py (1 hunks)
  • cognee/tests/integration/retrieval/test_structured_output.py (2 hunks)
  • cognee/tests/integration/retrieval/test_summaries_retriever.py (1 hunks)
  • cognee/tests/integration/retrieval/test_temporal_retriever.py (1 hunks)
  • cognee/tests/integration/retrieval/test_triplet_retriever.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/chunks_retriever_test.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/conversation_history_test.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/summaries_retriever_test.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/temporal_retriever_test.py (2 hunks)
  • cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py (3 hunks)
  • cognee/tests/unit/modules/retrieval/test_completion.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py (1 hunks)
  • cognee/tests/unit/modules/retrieval/triplet_retriever_test.py (1 hunks)
💤 Files with no reviewable changes (1)
  • cognee/modules/retrieval/utils/brute_force_triplet_search.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • cognee/tests/unit/modules/retrieval/summaries_retriever_test.py
🧰 Additional context used
📓 Path-based instructions (4)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use 4-space indentation in Python code
Use snake_case for Python module and function names
Use PascalCase for Python class names
Use ruff format before committing Python code
Use ruff check for import hygiene and style enforcement with line-length 100 configured in pyproject.toml
Prefer explicit, structured error handling in Python code

Files:

  • cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py
  • cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py
  • cognee/tests/unit/modules/retrieval/temporal_retriever_test.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever.py
  • cognee/tests/unit/modules/retrieval/chunks_retriever_test.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py
  • cognee/tests/integration/retrieval/test_summaries_retriever.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py
  • cognee/tests/integration/retrieval/test_rag_completion_retriever.py
  • cognee/tests/integration/retrieval/test_chunks_retriever.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py
  • cognee/tests/integration/retrieval/test_triplet_retriever.py
  • cognee/tests/unit/modules/retrieval/triplet_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py
  • cognee/tests/unit/modules/retrieval/conversation_history_test.py
  • cognee/tests/integration/retrieval/test_structured_output.py
  • cognee/modules/retrieval/triplet_retriever.py
  • cognee/tests/unit/modules/retrieval/test_completion.py
  • cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py
  • cognee/tests/integration/retrieval/test_temporal_retriever.py

⚙️ CodeRabbit configuration file

**/*.py: When reviewing Python code for this project:

  1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.
  2. As a general guideline, consider the code style advocated in the PEP 8 standard (excluding the use of spaces for indentation) and evaluate suggested changes for code style compliance.
  3. As a style convention, consider the code style advocated in CEP-8 and evaluate suggested changes for code style compliance.
  4. As a general guideline, try to provide any relevant, official, and supporting documentation links to any tool's suggestions in review comments. This guideline is important for posterity.
  5. As a general rule, undocumented function definitions and class definitions in the project's Python code are assumed incomplete. Please consider suggesting a short summary of the code for any of these incomplete definitions as docstrings when reviewing.

Files:

  • cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py
  • cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py
  • cognee/tests/unit/modules/retrieval/temporal_retriever_test.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever.py
  • cognee/tests/unit/modules/retrieval/chunks_retriever_test.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py
  • cognee/tests/integration/retrieval/test_summaries_retriever.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py
  • cognee/tests/integration/retrieval/test_rag_completion_retriever.py
  • cognee/tests/integration/retrieval/test_chunks_retriever.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py
  • cognee/tests/integration/retrieval/test_triplet_retriever.py
  • cognee/tests/unit/modules/retrieval/triplet_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py
  • cognee/tests/unit/modules/retrieval/conversation_history_test.py
  • cognee/tests/integration/retrieval/test_structured_output.py
  • cognee/modules/retrieval/triplet_retriever.py
  • cognee/tests/unit/modules/retrieval/test_completion.py
  • cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py
  • cognee/tests/integration/retrieval/test_temporal_retriever.py
cognee/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Use shared logging utilities from cognee.shared.logging_utils in Python code

Files:

  • cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py
  • cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py
  • cognee/tests/unit/modules/retrieval/temporal_retriever_test.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever.py
  • cognee/tests/unit/modules/retrieval/chunks_retriever_test.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py
  • cognee/tests/integration/retrieval/test_summaries_retriever.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py
  • cognee/tests/integration/retrieval/test_rag_completion_retriever.py
  • cognee/tests/integration/retrieval/test_chunks_retriever.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py
  • cognee/tests/integration/retrieval/test_triplet_retriever.py
  • cognee/tests/unit/modules/retrieval/triplet_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py
  • cognee/tests/unit/modules/retrieval/conversation_history_test.py
  • cognee/tests/integration/retrieval/test_structured_output.py
  • cognee/modules/retrieval/triplet_retriever.py
  • cognee/tests/unit/modules/retrieval/test_completion.py
  • cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py
  • cognee/tests/integration/retrieval/test_temporal_retriever.py
cognee/tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

cognee/tests/**/*.py: Place Python tests under cognee/tests/ organized by type (unit, integration, cli_tests)
Name Python test files test_*.py and use pytest.mark.asyncio for async tests

Files:

  • cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py
  • cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py
  • cognee/tests/unit/modules/retrieval/temporal_retriever_test.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever.py
  • cognee/tests/unit/modules/retrieval/chunks_retriever_test.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py
  • cognee/tests/integration/retrieval/test_summaries_retriever.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_context_extension_test.py
  • cognee/tests/integration/retrieval/test_rag_completion_retriever.py
  • cognee/tests/integration/retrieval/test_chunks_retriever.py
  • cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py
  • cognee/tests/integration/retrieval/test_triplet_retriever.py
  • cognee/tests/unit/modules/retrieval/triplet_retriever_test.py
  • cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py
  • cognee/tests/unit/modules/retrieval/conversation_history_test.py
  • cognee/tests/integration/retrieval/test_structured_output.py
  • cognee/tests/unit/modules/retrieval/test_completion.py
  • cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py
  • cognee/tests/integration/retrieval/test_temporal_retriever.py
cognee/{modules,infrastructure,tasks}/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Co-locate feature-specific helpers under their respective package (modules/, infrastructure/, or tasks/)

Files:

  • cognee/modules/retrieval/triplet_retriever.py
🧠 Learnings (2)
📚 Learning: 2025-11-24T16:45:09.996Z
Learnt from: CR
Repo: topoteretes/cognee PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-24T16:45:09.996Z
Learning: Applies to cognee/tests/**/*.py : Name Python test files test_*.py and use pytest.mark.asyncio for async tests

Applied to files:

  • cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py
  • cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py
  • cognee/tests/integration/retrieval/test_structured_output.py
📚 Learning: 2024-11-13T14:55:05.912Z
Learnt from: 0xideas
Repo: topoteretes/cognee PR: 205
File: cognee/tests/unit/processing/chunks/chunk_by_paragraph_test.py:7-7
Timestamp: 2024-11-13T14:55:05.912Z
Learning: When changes are made to the chunking implementation in `cognee/tasks/chunks`, the ground truth values in the corresponding tests in `cognee/tests/unit/processing/chunks` need to be updated accordingly.

Applied to files:

  • cognee/tests/unit/modules/retrieval/chunks_retriever_test.py
  • cognee/tests/integration/retrieval/test_rag_completion_retriever.py
  • cognee/tests/integration/retrieval/test_chunks_retriever.py
🧬 Code graph analysis (18)
cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py (4)
cognee/infrastructure/engine/models/DataPoint.py (1)
  • DataPoint (20-220)
cognee/modules/retrieval/graph_completion_cot_retriever.py (1)
  • GraphCompletionCotRetriever (39-239)
cognee/api/v1/config/config.py (1)
  • system_root_directory (18-33)
cognee/modules/retrieval/graph_completion_retriever.py (1)
  • get_triplets (80-116)
cognee/tests/unit/modules/retrieval/test_brute_force_triplet_search.py (1)
cognee/modules/retrieval/utils/brute_force_triplet_search.py (3)
  • brute_force_triplet_search (76-199)
  • get_memory_fragment (39-73)
  • format_triplets (18-36)
cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py (1)
cognee/modules/retrieval/graph_completion_context_extension_retriever.py (1)
  • GraphCompletionContextExtensionRetriever (17-178)
cognee/tests/integration/retrieval/test_graph_completion_retriever.py (2)
cognee/infrastructure/engine/models/DataPoint.py (1)
  • DataPoint (20-220)
cognee/modules/retrieval/graph_completion_retriever.py (2)
  • GraphCompletionRetriever (28-294)
  • get_triplets (80-116)
cognee/tests/unit/modules/retrieval/graph_completion_retriever_cot_test.py (1)
cognee/modules/retrieval/graph_completion_cot_retriever.py (4)
  • GraphCompletionCotRetriever (39-239)
  • _as_answer_text (25-36)
  • _run_cot_completion (87-169)
  • get_completion (171-239)
cognee/tests/integration/retrieval/test_summaries_retriever.py (2)
cognee/modules/retrieval/exceptions/exceptions.py (1)
  • NoDataError (25-32)
cognee/modules/retrieval/summaries_retriever.py (1)
  • SummariesRetriever (12-101)
cognee/tests/integration/retrieval/test_rag_completion_retriever.py (5)
cognee/modules/data/processing/document_types/TextDocument.py (1)
  • TextDocument (6-22)
cognee/modules/retrieval/exceptions/exceptions.py (1)
  • NoDataError (25-32)
cognee/modules/retrieval/completion_retriever.py (1)
  • CompletionRetriever (20-147)
cognee/infrastructure/engine/models/DataPoint.py (1)
  • DataPoint (20-220)
cognee/api/v1/config/config.py (2)
  • system_root_directory (18-33)
  • data_root_directory (36-38)
cognee/tests/integration/retrieval/test_chunks_retriever.py (5)
cognee/modules/data/processing/document_types/TextDocument.py (1)
  • TextDocument (6-22)
cognee/modules/retrieval/exceptions/exceptions.py (1)
  • NoDataError (25-32)
cognee/modules/retrieval/chunks_retriever.py (1)
  • ChunksRetriever (12-101)
cognee/infrastructure/engine/models/DataPoint.py (1)
  • DataPoint (20-220)
cognee/api/v1/config/config.py (2)
  • system_root_directory (18-33)
  • data_root_directory (36-38)
cognee/tests/unit/modules/retrieval/graph_completion_retriever_test.py (4)
cognee/modules/retrieval/graph_completion_retriever.py (7)
  • GraphCompletionRetriever (28-294)
  • get_triplets (80-116)
  • get_context (118-148)
  • resolve_edges_to_text (64-78)
  • convert_retrieved_objects_to_context (150-152)
  • get_completion (154-228)
  • save_qa (230-294)
cognee/modules/retrieval/base_graph_retriever.py (2)
  • get_context (11-13)
  • get_completion (16-24)
cognee/modules/retrieval/base_retriever.py (2)
  • get_context (9-11)
  • get_completion (14-22)
cognee/modules/retrieval/completion_retriever.py (2)
  • get_context (42-75)
  • get_completion (77-147)
cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py (2)
cognee/modules/retrieval/graph_summary_completion_retriever.py (1)
  • GraphSummaryCompletionRetriever (7-66)
cognee-mcp/src/server.py (1)
  • save_interaction (260-315)
cognee/tests/integration/retrieval/test_triplet_retriever.py (2)
cognee/modules/retrieval/triplet_retriever.py (1)
  • get_context (42-80)
cognee/modules/retrieval/exceptions/exceptions.py (1)
  • NoDataError (25-32)
cognee/tests/unit/modules/retrieval/triplet_retriever_test.py (1)
cognee/modules/retrieval/triplet_retriever.py (2)
  • get_context (42-80)
  • get_completion (82-132)
cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py (2)
cognee/modules/retrieval/user_qa_feedback.py (1)
  • UserQAFeedback (16-84)
cognee/modules/retrieval/utils/models.py (2)
  • UserFeedbackEvaluation (34-40)
  • UserFeedbackSentiment (26-31)
cognee/tests/unit/modules/retrieval/conversation_history_test.py (2)
cognee/modules/retrieval/utils/session_cache.py (2)
  • save_conversation_history (10-75)
  • get_conversation_history (78-156)
cognee/infrastructure/databases/exceptions/exceptions.py (1)
  • CacheConnectionError (137-150)
cognee/tests/integration/retrieval/test_structured_output.py (3)
cognee/api/v1/config/config.py (2)
  • system_root_directory (18-33)
  • data_root_directory (36-38)
cognee/infrastructure/engine/models/DataPoint.py (1)
  • DataPoint (20-220)
cognee/modules/data/processing/document_types/TextDocument.py (1)
  • TextDocument (6-22)
cognee/tests/unit/modules/retrieval/test_completion.py (1)
cognee/modules/retrieval/utils/completion.py (1)
  • generate_completion (6-28)
cognee/tests/unit/modules/retrieval/rag_completion_retriever_test.py (3)
cognee/modules/retrieval/completion_retriever.py (3)
  • CompletionRetriever (20-147)
  • get_context (42-75)
  • get_completion (77-147)
cognee/modules/retrieval/exceptions/exceptions.py (1)
  • NoDataError (25-32)
cognee/infrastructure/databases/vector/exceptions/exceptions.py (1)
  • CollectionNotFoundError (5-22)
cognee/tests/integration/retrieval/test_temporal_retriever.py (2)
cognee/infrastructure/engine/models/DataPoint.py (1)
  • DataPoint (20-220)
cognee/api/v1/config/config.py (2)
  • system_root_directory (18-33)
  • data_root_directory (36-38)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (199)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: CLI Tests / CLI Integration Tests
  • GitHub Check: CLI Tests / CLI Functionality Tests

coderabbitai bot added a commit that referenced this pull request Dec 11, 2025
…rs-tests-reorg`

Docstrings generation was requested by @hajdul88.

* #1881 (comment)

The following files were modified:

* `cognee/modules/retrieval/triplet_retriever.py`
* `cognee/modules/retrieval/utils/brute_force_triplet_search.py`
* `cognee/tests/integration/retrieval/test_chunks_retriever.py`
* `cognee/tests/integration/retrieval/test_graph_completion_retriever.py`
* `cognee/tests/integration/retrieval/test_graph_completion_retriever_context_extension.py`
* `cognee/tests/integration/retrieval/test_graph_completion_retriever_cot.py`
* `cognee/tests/integration/retrieval/test_rag_completion_retriever.py`
* `cognee/tests/integration/retrieval/test_structured_output.py`
* `cognee/tests/integration/retrieval/test_summaries_retriever.py`
* `cognee/tests/integration/retrieval/test_temporal_retriever.py`
* `cognee/tests/unit/modules/retrieval/test_graph_summary_completion_retriever.py`
* `cognee/tests/unit/modules/retrieval/test_user_qa_feedback.py`
@topoteretes topoteretes deleted a comment from coderabbitai bot Dec 11, 2025
@hajdul88 hajdul88 requested review from lxobr and pazone December 11, 2025 14:51
@hajdul88 hajdul88 changed the title chore: retriever test reorganization + adding new tests (unit + integration) chore: retriever test reorganization + adding new tests (unit) Dec 12, 2025
@hajdul88 hajdul88 changed the title chore: retriever test reorganization + adding new tests (unit) chore: retriever test reorganization + adding new tests (integration) Dec 12, 2025
@hajdul88 hajdul88 changed the title chore: retriever test reorganization + adding new tests (integration) chore: retriever test reorganization + adding new tests (integration) (STEP 1) Dec 12, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
cognee/tests/unit/eval_framework/corpus_builder_test.py (1)

9-23: Consider sharing MOCK_HOTPOT_CORPUS across test modules to avoid drift.

You now define an identical MOCK_HOTPOT_CORPUS in multiple files. A small shared fixture/helper (e.g., cognee/tests/unit/eval_framework/fixtures.py) would reduce duplication and keep Hotpot/TwoWiki expectations aligned.
(If you want an “official” pattern: pytest fixtures docs are here.)

https://docs.pytest.org/en/stable/how-to/fixtures.html
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 499c717 and fc89f71.

📒 Files selected for processing (2)
  • cognee/tests/unit/eval_framework/benchmark_adapters_test.py (3 hunks)
  • cognee/tests/unit/eval_framework/corpus_builder_test.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

**/*.py: Use 4-space indentation in Python code
Use snake_case for Python module and function names
Use PascalCase for Python class names
Use ruff format before committing Python code
Use ruff check for import hygiene and style enforcement with line-length 100 configured in pyproject.toml
Prefer explicit, structured error handling in Python code

Files:

  • cognee/tests/unit/eval_framework/corpus_builder_test.py
  • cognee/tests/unit/eval_framework/benchmark_adapters_test.py

⚙️ CodeRabbit configuration file

**/*.py: When reviewing Python code for this project:

  1. Prioritize portability over clarity, especially when dealing with cross-Python compatibility. However, with the priority in mind, do still consider improvements to clarity when relevant.
  2. As a general guideline, consider the code style advocated in the PEP 8 standard (excluding the use of spaces for indentation) and evaluate suggested changes for code style compliance.
  3. As a style convention, consider the code style advocated in CEP-8 and evaluate suggested changes for code style compliance.
  4. As a general guideline, try to provide any relevant, official, and supporting documentation links to any tool's suggestions in review comments. This guideline is important for posterity.
  5. As a general rule, undocumented function definitions and class definitions in the project's Python code are assumed incomplete. Please consider suggesting a short summary of the code for any of these incomplete definitions as docstrings when reviewing.

Files:

  • cognee/tests/unit/eval_framework/corpus_builder_test.py
  • cognee/tests/unit/eval_framework/benchmark_adapters_test.py
cognee/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

Use shared logging utilities from cognee.shared.logging_utils in Python code

Files:

  • cognee/tests/unit/eval_framework/corpus_builder_test.py
  • cognee/tests/unit/eval_framework/benchmark_adapters_test.py
cognee/tests/**/*.py

📄 CodeRabbit inference engine (AGENTS.md)

cognee/tests/**/*.py: Place Python tests under cognee/tests/ organized by type (unit, integration, cli_tests)
Name Python test files test_*.py and use pytest.mark.asyncio for async tests

Files:

  • cognee/tests/unit/eval_framework/corpus_builder_test.py
  • cognee/tests/unit/eval_framework/benchmark_adapters_test.py
🧬 Code graph analysis (2)
cognee/tests/unit/eval_framework/corpus_builder_test.py (1)
cognee/eval_framework/corpus_builder/corpus_builder_executor.py (3)
  • CorpusBuilderExecutor (13-67)
  • load_corpus (32-41)
  • build_corpus (43-55)
cognee/tests/unit/eval_framework/benchmark_adapters_test.py (1)
cognee/eval_framework/corpus_builder/corpus_builder_executor.py (1)
  • load_corpus (32-41)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (21)
  • GitHub Check: End-to-End Tests / Concurrent Subprocess access test
  • GitHub Check: End-to-End Tests / Test multi tenancy with different situations in Cognee
  • GitHub Check: End-to-End Tests / Test Cognify - Edge Centered Payload
  • GitHub Check: End-to-End Tests / Test Entity Extraction
  • GitHub Check: End-to-End Tests / Conversation sessions test (FS)
  • GitHub Check: End-to-End Tests / Test Feedback Enrichment
  • GitHub Check: End-to-End Tests / S3 Bucket Test
  • GitHub Check: End-to-End Tests / Test dataset database handlers in Cognee
  • GitHub Check: End-to-End Tests / Server Start Test
  • GitHub Check: Basic Tests / Run Integration Tests
  • GitHub Check: End-to-End Tests / Run Telemetry Pipeline Test
  • GitHub Check: End-to-End Tests / Deduplication Test
  • GitHub Check: End-to-End Tests / Test graph edge ingestion
  • GitHub Check: End-to-End Tests / Conversation sessions test (Redis)
  • GitHub Check: End-to-End Tests / Test using different async databases in parallel in Cognee
  • GitHub Check: End-to-End Tests / Test permissions with different situations in Cognee
  • GitHub Check: Basic Tests / Run Simple Examples BAML
  • GitHub Check: Basic Tests / Run Unit Tests
  • GitHub Check: Basic Tests / Run Simple Examples
  • GitHub Check: CLI Tests / CLI Functionality Tests
  • GitHub Check: CLI Tests / CLI Integration Tests
🔇 Additional comments (1)
cognee/tests/unit/eval_framework/benchmark_adapters_test.py (1)

54-58: Adapter-specific patching is correct; both _get_raw_corpus and load_corpus() are properly handled.

The patching strategy is sound: _get_raw_corpus() is synchronous in both HotpotQAAdapter and TwoWikiMultihopAdapter, so using patch.object() with return_value (not AsyncMock) is correct. The load_corpus() method returns Tuple[List[str], List[dict[str, Any]]] as expected, and test assertions at lines 63–70 and 96–100 correctly unpack and validate this structure. No type mismatches or flakes are present.

Copy link
Contributor

@pazone pazone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Collaborator

@lxobr lxobr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks alright, nice work

@hajdul88
Copy link
Collaborator Author

Looks alright, nice work

Thanks lets merge this after the release because its connected to step 1.5 and 2.

@hajdul88 hajdul88 merged commit 4e8845c into dev Dec 16, 2025
159 of 162 checks passed
@hajdul88 hajdul88 deleted the feature/cog-3532-empower-test_search-db-retrievers-tests-reorg branch December 16, 2025 10:11
@coderabbitai coderabbitai bot mentioned this pull request Jan 6, 2026
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants