Skip to content

Conversation

@lxobr
Copy link
Collaborator

@lxobr lxobr commented Apr 3, 2025

Description

  • Fixed get_no_summary_tasks and get_just_chunks_tasks to work with the new tasks and pipelines
  • Chore: fixed the pokemon example to work with the new tasks and pipelines

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.

@lxobr lxobr self-assigned this Apr 3, 2025
@pull-checklist
Copy link

pull-checklist bot commented Apr 3, 2025

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 Apr 3, 2025

Walkthrough

This pull request updates the task retrieval functions in the default task getter module. Both get_no_summary_tasks and get_just_chunks_tasks are modified to accept additional parameters and to create new tasks dynamically. In get_no_summary_tasks, new tasks for graph extraction and adding data points are introduced with specified dependencies. Similarly, get_just_chunks_tasks now accepts a user parameter and creates an add-data-points task based on chunk extraction. Additionally, the Pokémon data processing example is altered by removing a batch size configuration parameter from its task creation.

Changes

File Change Summary
cognee/.../get_default_tasks_by_indices.py Updated asynchronous functions get_no_summary_tasks and get_just_chunks_tasks to include new parameters (user, graph_model, ontology_file_path for the former and user for the latter). Expanded logic to create additional tasks (e.g., graph_task and add_data_points_task) with dependency configurations.
examples/python/pokemon_datapoints_example.py Modified the pokemon_cognify function by removing the task configuration (specifically the batch size) for the add_data_points task, thereby altering the processing behavior for Pokémon data.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant get_no_summary_tasks
    participant BaseTasks
    participant GraphTask
    participant AddDataPointsTask

    Client->>get_no_summary_tasks: Call get_no_summary_tasks(user, graph_model,\nontology_file_path, ...)
    get_no_summary_tasks->>BaseTasks: Retrieve base tasks (classify, check permissions, extract chunks)
    get_no_summary_tasks->>GraphTask: Create graph_task using extract_graph_from_data
    GraphTask->>TaskConfig: Configure dependencies
    get_no_summary_tasks->>AddDataPointsTask: Create add_data_points_task (dependency on extract_graph_from_data)
    get_no_summary_tasks-->>Client: Return combined tasks list
Loading
sequenceDiagram
    participant Client
    participant get_just_chunks_tasks
    participant BaseTasks
    participant AddDataPointsTask

    Client->>get_just_chunks_tasks: Call get_just_chunks_tasks(user, ...)
    get_just_chunks_tasks->>BaseTasks: Retrieve base tasks (classify, check permissions, extract chunks)
    get_just_chunks_tasks->>AddDataPointsTask: Create add_data_points_task (dependency on extract_chunks_from_documents)
    get_just_chunks_tasks-->>Client: Return combined tasks list
Loading

Suggested reviewers

  • borisarzentar

Poem

Hopping through fields of code, I spy,
New tasks and graphs that reach the sky.
Parameters change and dependencies align,
Like carrots in a row — a design so fine.
CodeRabbit cheers in a joyful bunny rhyme! 🐇🥕

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

🧹 Nitpick comments (5)
cognee/eval_framework/corpus_builder/task_getters/get_default_tasks_by_indices.py (5)

6-10: Remove unused imports
classify_documents and check_permissions_on_documents appear never used in this file. Consider removing them for cleanliness.

🧰 Tools
🪛 Ruff (0.8.2)

7-7: cognee.tasks.documents.classify_documents imported but unused

Remove unused import

(F401)


8-8: cognee.tasks.documents.check_permissions_on_documents imported but unused

Remove unused import

(F401)


13-13: Unused import
get_default_user is not referenced in this file. Consider removing it.

🧰 Tools
🪛 Ruff (0.8.2)

13-13: cognee.modules.users.methods.get_default_user imported but unused

Remove unused import: cognee.modules.users.methods.get_default_user

(F401)


15-15: Remove unused imports
run_tasks and merge_needs are unused here. Consider removing these imports.

🧰 Tools
🪛 Ruff (0.8.2)

15-15: cognee.modules.pipelines.run_tasks imported but unused

Remove unused import

(F401)


15-15: cognee.modules.pipelines.merge_needs imported but unused

Remove unused import

(F401)


16-16: Unused import
get_cognify_config is never used in this file. Removing it would reduce clutter.

🧰 Tools
🪛 Ruff (0.8.2)

16-16: cognee.modules.cognify.config.get_cognify_config imported but unused

Remove unused import: cognee.modules.cognify.config.get_cognify_config

(F401)


18-18: Unused import
get_max_chunk_tokens is not invoked here. Please remove it.

🧰 Tools
🪛 Ruff (0.8.2)

18-18: cognee.infrastructure.llm.get_max_chunk_tokens imported but unused

Remove unused import: cognee.infrastructure.llm.get_max_chunk_tokens

(F401)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8207dc8 and 190c986.

📒 Files selected for processing (2)
  • cognee/eval_framework/corpus_builder/task_getters/get_default_tasks_by_indices.py (2 hunks)
  • examples/python/pokemon_datapoints_example.py (1 hunks)
🧰 Additional context used
🧬 Code Definitions (1)
cognee/eval_framework/corpus_builder/task_getters/get_default_tasks_by_indices.py (2)
cognee/api/v1/cognify/cognify.py (1)
  • cognify (35-69)
cognee/api/v1/cognify/routers/get_cognify_router.py (1)
  • cognify (20-27)
🪛 Ruff (0.8.2)
cognee/eval_framework/corpus_builder/task_getters/get_default_tasks_by_indices.py

7-7: cognee.tasks.documents.classify_documents imported but unused

Remove unused import

(F401)


8-8: cognee.tasks.documents.check_permissions_on_documents imported but unused

Remove unused import

(F401)


13-13: cognee.modules.users.methods.get_default_user imported but unused

Remove unused import: cognee.modules.users.methods.get_default_user

(F401)


15-15: cognee.modules.pipelines.run_tasks imported but unused

Remove unused import

(F401)


15-15: cognee.modules.pipelines.merge_needs imported but unused

Remove unused import

(F401)


16-16: cognee.modules.cognify.config.get_cognify_config imported but unused

Remove unused import: cognee.modules.cognify.config.get_cognify_config

(F401)


18-18: cognee.infrastructure.llm.get_max_chunk_tokens imported but unused

Remove unused import: cognee.infrastructure.llm.get_max_chunk_tokens

(F401)

⏰ Context from checks skipped due to timeout of 90000ms (35)
  • GitHub Check: Test on macos-15
  • GitHub Check: run_networkx_metrics_test / test
  • GitHub Check: Test on macos-13
  • GitHub Check: run_notebook_test / test
  • GitHub Check: run_eval_framework_test / test
  • GitHub Check: run_dynamic_steps_example_test / test
  • GitHub Check: run_simple_example_test / test
  • GitHub Check: run_multimedia_example_test / test
  • GitHub Check: Test on ubuntu-22.04
  • GitHub Check: test
  • GitHub Check: Test on macos-15
  • GitHub Check: run_simple_example_test / test
  • GitHub Check: chromadb test
  • GitHub Check: run_notebook_test / test
  • GitHub Check: run_notebook_test / test
  • GitHub Check: Test on macos-15
  • GitHub Check: run_notebook_test / test
  • GitHub Check: Test on macos-13
  • GitHub Check: test
  • GitHub Check: Test on macos-13
  • GitHub Check: Test on ubuntu-22.04
  • GitHub Check: test
  • GitHub Check: Test on ubuntu-22.04
  • GitHub Check: test
  • GitHub Check: windows-latest
  • GitHub Check: test
  • GitHub Check: lint (ubuntu-latest, 3.11.x)
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: Test on ubuntu-22.04
  • GitHub Check: run_simple_example_test
  • GitHub Check: lint (ubuntu-latest, 3.10.x)
  • GitHub Check: test
  • GitHub Check: docker-compose-test
  • GitHub Check: Build Cognee Backend Docker App Image
🔇 Additional comments (5)
examples/python/pokemon_datapoints_example.py (1)

178-179: Potential performance impact due to removal of batch_size
By removing the task_config={"batch_size": 50} parameter, tasks now process data in a single unbatched manner, which may affect memory usage or performance if the dataset is large. Consider reintroducing a batching approach if needed or confirm that single-batch processing is sufficient for your use case.

cognee/eval_framework/corpus_builder/task_getters/get_default_tasks_by_indices.py (4)

35-41: Unused parameter 'user'
user is never utilized in get_no_summary_tasks. Confirm if this is intentional or remove it to keep the signature concise.


43-60: Function logic looks good
The flow for adding new tasks and their dependencies appears correct.


63-65: Unused parameter 'user'
user is not employed in get_just_chunks_tasks. Please verify if needed or consider removing it.


67-75: Implementation looks consistent
The approach to creating add_data_points_task with the needed dependency is properly structured.

@lxobr lxobr requested review from borisarzentar and hajdul88 April 3, 2025 15:30
@lxobr lxobr merged commit e12242b into dev Apr 7, 2025
36 of 37 checks passed
@lxobr lxobr deleted the fix/cog-1790-get-default-task-by-indices branch April 7, 2025 06:46
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.

3 participants