Skip to content

Conversation

@Pn7Hao
Copy link

@Pn7Hao Pn7Hao commented Jul 7, 2025

No description provided.

@pull-checklist
Copy link

pull-checklist bot commented Jul 7, 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 Jul 7, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This update introduces a new FlagEmbedding engine and tokenizer, extends embedding engine selection, and improves file handling, graph operations, and retrieval instrumentation. It also enhances error handling, logging, and dataset management, while adding utility methods for graph metadata and related chunk export. Several debugging outputs are included.

Changes

File(s) Change Summary
cognee/infrastructure/databases/vector/embeddings/FlagEmbeddingEngine.py, cognee/infrastructure/llm/tokenizer/BAAI/adapter.py, cognee/infrastructure/llm/tokenizer/BAAI/__init__.py, cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py, cognee/infrastructure/databases/vector/embeddings/get_embedding_engine.py Added FlagEmbedding engine and tokenizer; integrated into embedding engine selection and tokenizer logic.
cognee/infrastructure/databases/vector/qdrant/QDrantAdapter.py Simplified QDrant client instantiation, improved search input validation, error handling, and logging.
cognee/infrastructure/files/storage/LocalStorage.py Enhanced directory existence check and error reporting in directory creation utility.
cognee/modules/graph/cognee_graph/CogneeGraph.py Added __repr__, metadata dump, and related chunk export methods to the graph class.
cognee/modules/ingestion/save_data_to_file.py Refined filename sanitization and length-limiting logic for data saving.
cognee/modules/pipelines/operations/run_tasks.py Ensured dataset existence by creating a placeholder if missing during pipeline task runs.
cognee/modules/retrieval/completion_retriever.py, cognee/modules/retrieval/utils/completion.py Added debugging output to log retrieved chunks and prompt content to files.
cognee/modules/retrieval/graph_completion_retriever.py Removed logger usage, adjusted node content logic, and added timing instrumentation.
cognee/modules/retrieval/utils/brute_force_triplet_search.py Added timing, logging, and output of search results and related chunks to files.
cognee/tasks/ingestion/save_data_item_to_storage.py Improved file path detection by checking file existence before processing as a file.
cognee/__init__.py No functional changes; only whitespace adjustments.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant App
    participant FlagEmbeddingEngine
    participant Tokenizer
    participant RemoteEndpoint

    User->>App: Request text embedding
    App->>FlagEmbeddingEngine: embed_text(texts)
    alt Local model available
        FlagEmbeddingEngine->>Tokenizer: Tokenize texts
        FlagEmbeddingEngine->>FlagEmbeddingEngine: Encode texts locally
        FlagEmbeddingEngine-->>App: Return embeddings
    else Remote endpoint fallback
        FlagEmbeddingEngine->>RemoteEndpoint: POST /embed texts
        RemoteEndpoint-->>FlagEmbeddingEngine: Return embeddings
        FlagEmbeddingEngine-->>App: Return embeddings
    end
    App-->>User: Return result
Loading
sequenceDiagram
    participant App
    participant QDrantAdapter
    participant QDrantClient

    App->>QDrantAdapter: search(collection_name, query, limit)
    QDrantAdapter->>QDrantClient: search(...)
    alt Collection not found
        QDrantClient-->>QDrantAdapter: UnexpectedResponse("Collection not found")
        QDrantAdapter-->>App: Raise CollectionNotFoundError
    else Limit <= 0
        QDrantAdapter-->>App: Return []
    else Success
        QDrantClient-->>QDrantAdapter: Return results
        QDrantAdapter-->>App: Return results
    end
Loading

Possibly related PRs

Suggested reviewers

  • borisarzentar
  • Vasilije1990

Poem

A rabbit hopped through code today,
Embeddings new, in BAAI array.
Graphs now write their tales to file,
And filenames sanitized with style.
With checks and logs, and chunks in tow,
This bunny cheers, "Release—let's go!"
🐇✨


📜 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 ef1aecd and 0106c33.

📒 Files selected for processing (16)
  • cognee/__init__.py (1 hunks)
  • cognee/infrastructure/databases/vector/embeddings/FlagEmbeddingEngine.py (1 hunks)
  • cognee/infrastructure/databases/vector/embeddings/LiteLLMEmbeddingEngine.py (2 hunks)
  • cognee/infrastructure/databases/vector/embeddings/get_embedding_engine.py (1 hunks)
  • cognee/infrastructure/databases/vector/qdrant/QDrantAdapter.py (4 hunks)
  • cognee/infrastructure/files/storage/LocalStorage.py (1 hunks)
  • cognee/infrastructure/llm/tokenizer/BAAI/__init__.py (1 hunks)
  • cognee/infrastructure/llm/tokenizer/BAAI/adapter.py (1 hunks)
  • cognee/modules/graph/cognee_graph/CogneeGraph.py (2 hunks)
  • cognee/modules/ingestion/save_data_to_file.py (2 hunks)
  • cognee/modules/pipelines/operations/run_tasks.py (1 hunks)
  • cognee/modules/retrieval/completion_retriever.py (1 hunks)
  • cognee/modules/retrieval/graph_completion_retriever.py (4 hunks)
  • cognee/modules/retrieval/utils/brute_force_triplet_search.py (4 hunks)
  • cognee/modules/retrieval/utils/completion.py (1 hunks)
  • cognee/tasks/ingestion/save_data_item_to_storage.py (2 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 auto-generate unit tests to generate unit tests for 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.

@Pn7Hao Pn7Hao closed this Jul 7, 2025
@Pn7Hao
Copy link
Author

Pn7Hao commented Jul 7, 2025

my dummy

@Pn7Hao Pn7Hao deleted the feat/migrate-from-site-packages branch July 7, 2025 04:25
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.

1 participant