Skip to content

Conversation

@owenkellyhilabs
Copy link

Description

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.

@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 May 29, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a new setup guide, enhances file and URL handling for add and delete endpoints, adds a health check API, includes a graph metrics calculation task, and updates the Dockerfile to install the PostgreSQL client library. The entrypoint script gains improved logging and process management. A notebook subproject reference is removed.

Changes

File(s) Change Summary
Dockerfile Adds installation of libpq5 for PostgreSQL client support in the runtime image.
SETUP_GUIDE.md Adds a detailed local setup guide covering prerequisites, environment variables, and troubleshooting.
entrypoint.sh Improves logging and uses exec for Gunicorn process management based on environment/debug mode.
notebooks/data/graphrag Removes subproject commit reference, deleting its inclusion from the repository.
cognee/api/client.py Modifies /health endpoint to return JSON; includes delete router under /api/v1/delete.
cognee/api/v1/health.py Adds a new router with a /health endpoint returning JSON status.
cognee/api/v1/add/routers/get_add_router.py Refactors to accept a single file or URL; adds logging and error handling for various input types.
cognee/api/v1/delete/routers/get_delete_router.py Refactors to accept a single file or URL; adds logic for GitHub URLs and improves error handling.
cognee/api/v1/search/routers/get_search_router.py Adds optional datasets parameter to search payload and endpoint.
cognee/api/v1/cognify/cognify.py Adds calculate_graph_metrics task to the default processing pipeline.
cognee/tasks/metrics/calculate_graph_metrics.py Introduces async function to compute and store graph metrics in the database.
cognee/tasks/metrics/init.py Adds a module-level docstring describing metrics tasks.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant API as FastAPI App
    participant AddRouter
    participant DeleteRouter
    participant GitHub
    participant HTTPServer

    Client->>API: POST /api/v1/add (file or url)
    API->>AddRouter: handle add()
    alt file upload
        AddRouter->>AddRouter: Read/decode file
    else url provided
        AddRouter->>AddRouter: Validate URL
        alt github url
            AddRouter->>GitHub: git clone
        else http url
            AddRouter->>HTTPServer: GET content
        end
    end
    AddRouter-->>API: Response
    API-->>Client: HTTP Response

    Client->>API: POST /api/v1/delete (file or url)
    API->>DeleteRouter: handle delete()
    alt file upload
        DeleteRouter->>DeleteRouter: Read/decode file
    else url provided
        DeleteRouter->>DeleteRouter: Validate URL
        alt github url
            DeleteRouter->>GitHub: git clone
        else http url
            DeleteRouter->>HTTPServer: GET content
        end
    end
    DeleteRouter-->>API: Response
    API-->>Client: HTTP Response

    Client->>API: GET /health
    API->>API: health_check()
    API-->>Client: {"status": "healthy"}
Loading
sequenceDiagram
    participant CognifyAPI
    participant TaskPipeline
    participant GraphEngine
    participant DB as Database

    CognifyAPI->>TaskPipeline: get_default_tasks()
    TaskPipeline->>GraphEngine: get_graph_metrics()
    GraphEngine-->>TaskPipeline: Metrics data
    TaskPipeline->>DB: Store GraphMetrics
    DB-->>TaskPipeline: Commit
    TaskPipeline-->>CognifyAPI: Continue pipeline
Loading

Possibly related PRs

  • topoteretes/cognee#172: Also modifies the Dockerfile for PostgreSQL support, focusing on development headers and dependency installation, complementing this PR's runtime library addition.

Poem

In the warren, code hops anew,
With health checks bright and metrics too!
Add or delete, just one at a time,
URLs or files—handled just fine.
PostgreSQL now finds its way,
As rabbits cheer this update day!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 822cc55 and b0b6ac8.

⛔ Files ignored due to path filters (3)
  • docker-compose.yml is excluded by !**/*.yml
  • poetry.lock is excluded by !**/*.lock, !**/*.lock
  • pyproject.toml is excluded by !**/*.toml
📒 Files selected for processing (12)
  • Dockerfile (1 hunks)
  • SETUP_GUIDE.md (1 hunks)
  • cognee/api/client.py (1 hunks)
  • cognee/api/v1/add/routers/get_add_router.py (2 hunks)
  • cognee/api/v1/cognify/cognify.py (2 hunks)
  • cognee/api/v1/delete/routers/get_delete_router.py (1 hunks)
  • cognee/api/v1/health.py (1 hunks)
  • cognee/api/v1/search/routers/get_search_router.py (3 hunks)
  • cognee/tasks/metrics/__init__.py (1 hunks)
  • cognee/tasks/metrics/calculate_graph_metrics.py (1 hunks)
  • entrypoint.sh (1 hunks)
  • notebooks/data/graphrag (0 hunks)
✨ 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.
    • Explain this complex logic.
    • 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 explain this code block.
    • @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 explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @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.

@gitguardian
Copy link

gitguardian bot commented May 29, 2025

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard.
Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
9573981 Triggered Generic Password 085b201 .github/workflows/relational_db_migration_tests.yml View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@almondbuttertoast almondbuttertoast deleted the TGV-53-alter-cognee-prompts-to-be-project-relevant branch May 29, 2025 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants