GraphRAG-SDK icon indicating copy to clipboard operation
GraphRAG-SDK copied to clipboard

History to Cypher generation prompt

Open galshubeli opened this issue 1 year ago • 1 comments

Add history of answers to Cypher generation prompt

Summary by CodeRabbit

  • New Features

    • Updated the .gitignore to exclude the .vscode directory.
    • Enhanced prompt templates for ontology and data extraction processes.
    • Improved output content in demo notebooks for better user engagement and clarity.
  • Bug Fixes

    • Adjusted kernel specifications in the demo notebooks for better compatibility.
    • Modified the return type in the KnowledgeGraph class to include chat session context.
  • Chores

    • Updated project dependencies in pyproject.toml to ensure compatibility and performance improvements.

galshubeli avatar Oct 01 '24 07:10 galshubeli

Walkthrough

The pull request introduces various changes across multiple files, primarily focusing on enhancing the functionality and structure of the GraphRAG-SDK. Key modifications include updates to Jupyter notebooks for improved code execution and documentation, modifications to agent classes by simplifying method signatures, and enhancements to prompt templates for ontology and data extraction. Additionally, kernel specifications have been updated, and new entries have been added to JSON data files. The overall aim is to streamline interactions and improve clarity in both code and documentation.

Changes

File Change Summary
examples/movies/demo-movies.ipynb Updated execution counts, added markdown for GraphRAG-SDK usage, included new variable boundaries, modified kernel specifications (display name and Python version).
examples/trip/demo_orchestrator_trip.ipynb Added markdown overview, updated installation command, modified execution counts, updated file paths, expanded ontology definitions, enhanced knowledge graph creation, refined orchestrator functionality, and updated kernel specifications.
graphrag_sdk/agents/agent.py Modified run method signature to remove session parameter, changed return type to a single string, minor formatting adjustments.
graphrag_sdk/agents/kg_agent.py Updated run method to remove session parameter, introduced chat_session variable, simplified internal logic.
graphrag_sdk/fixtures/prompts.py Expanded prompt templates for ontology and data extraction, clarified guidelines for entity and relationship extraction, reinforced consistency in entity references.
graphrag_sdk/kg.py Modified ask method to return a tuple instead of a string, updated logic for empty cypher variable.
graphrag_sdk/orchestrator/steps/agent.py Updated run method signature to remove session parameter, simplifying call to agent.run.
README.md Enhanced SDK introduction, updated installation instructions, refined basic usage examples, expanded tools section, clarified ontology management, and updated knowledge graph section.
examples/trip/data/restaurants.json Added new restaurant entry "Tonnarello" with details.
examples/ufc/demo-ufc.ipynb Updated execution counts, modified file paths, significantly altered ontology structure, and updated kernel specifications.
graphrag_sdk/models/gemini.py Removed ask method, updated _get_model method, introduced start_chat method, modified send_message method in GeminiChatSession.
graphrag_sdk/models/model.py Removed ask method from GenerativeModel class.
graphrag_sdk/models/ollama.py Removed ask method, added _connect_to_client, introduced start_chat method in OllamaGenerativeModel.
graphrag_sdk/models/openai.py Removed ask method, updated with_system_instruction method.
graphrag_sdk/orchestrator/orchestrator_runner.py Removed _config parameter from run, _handle_continue_decision, and _handle_update_step_decision methods.
graphrag_sdk/orchestrator/step.py Updated run method signature to require config parameter.
graphrag_sdk/orchestrator/steps/summary.py Removed optional config parameter from run method signature.
graphrag_sdk/orchestrator/steps/user_input.py Removed optional config parameter from run method signature.
tests/test_kg_gemini.py Modified test_kg_creation to use chat session for querying KG instead of ask method.
tests/test_kg_ollama.py Updated test_kg_creation to initiate chat session for querying KG.
tests/test_kg_openai.py Changed test_kg_creation to use chat session for querying KG instead of ask method.

Possibly related PRs

  • #21: The changes in graphrag_sdk/fixtures/prompts.py regarding the restructuring of prompts for data extraction are related to the main PR's updates in examples/movies/demo-movies.ipynb, which also involves enhancing the extraction of relevant information about movies, actors, and directors.

Suggested reviewers

  • gkorland
  • swilly22

Poem

In the burrows deep, where changes bloom,
New paths in code, dispelling gloom.
With agents swift and prompts refined,
A chat with knowledge, intertwined.
Hops of joy in every line,
Celebrate the code, let it shine! 🐇✨


📜 Recent review details

Configuration used: CodeRabbit UI Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 333b9e24c02bd4b22f9a875325ecf910d65cc1e5 and 7baace77b1c060524ee7f6d7955cff4c0839ea6d.

📒 Files selected for processing (2)
  • graphrag_sdk/models/ollama.py (0 hunks)
  • tests/test_kg_ollama.py (1 hunks)
💤 Files with no reviewable changes (1)
  • graphrag_sdk/models/ollama.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tests/test_kg_ollama.py

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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 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.

coderabbitai[bot] avatar Oct 01 '24 07:10 coderabbitai[bot]