-
Notifications
You must be signed in to change notification settings - Fork 8
DA-1318 Updated the CrewAI Short Term Mem tutorial according to the latest docs #87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Caution Notebooks or Frontmatter Files Have Been Modified
5 Notebook Files Modified:
5 Frontmatter Files Modified:
|
Summary of ChangesHello @azaddhirajkumar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly updates and reorganizes the CrewAI Short Term Memory tutorials for Couchbase. It introduces a new, more advanced tutorial showcasing the use of Couchbase's Hyperscale and Composite Vector Indexes for efficient memory storage and retrieval in AI agents. Concurrently, the existing tutorial, which previously used FTS, has been refined and renamed to align with the concept of Search Vector Index, ensuring all examples leverage the most current and performant Couchbase vector search capabilities. These changes aim to provide clearer, more up-to-date guidance for integrating Couchbase as a memory backend for CrewAI. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request provides a significant update to the CrewAI short-term memory tutorials, aligning them with the latest documentation by replacing the previous gsi and fts based examples with new query_based (Hyperscale/Composite indexes) and search_based (Search Vector Index) tutorials. The restructuring and content updates are well-executed and improve the overall quality and clarity of the documentation. I've included a few review comments to enhance code robustness, ensure consistency in configuration, and correct a minor inaccuracy in the documentation.
| " ping_result = self.cluster.ping()\n", | ||
| " query_available = False\n", | ||
| " for service_type, endpoints in ping_result.endpoints.items():\n", | ||
| " if service_type.name == 'Query': # Query Service for Hyperscale and Composite Vector Indexes\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking the service type by its string name (service_type.name == 'Query') is less robust than comparing with the enum member directly. Using service_type == ServiceType.Query is safer against potential future changes and is more consistent with the approach in the search_based notebook.
if service_type == ServiceType.Query: # Query Service for Hyperscale and Composite Vector Indexes
crewai-short-term-memory/query_based/CouchbaseStorage_Demo.ipynb
Outdated
Show resolved
Hide resolved
| " print(\"Waiting for index to become available...\")\n", | ||
| " time.sleep(5)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a fixed time.sleep(5) to wait for the index to become available is not robust and can lead to flaky behavior, as index creation time can vary. A more reliable approach is to poll for the index status until it's ready. For a production-ready example, you could implement a loop that periodically checks the index status using the Couchbase SDK's QueryIndexManager.
VirajAgarwal1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Just a couple of minor changes are needed before merging.
| " \n", | ||
| "except Exception as e:\n", | ||
| " if \"already exists\" in str(e).lower():\n", | ||
| " print(f\"Vector index '{storage.index_name}' already exists, proceeding...\")\n", | ||
| " else:\n", | ||
| " print(f\"Error creating vector index: {str(e)}\")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is better to have the output of the test performance section code blocks.
| "id": "fa3af5ad", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "## Introduction" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add some text under the Introduction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The titles shouldn't be in H1. The title "Memory in AI Agents" is in H1.
Refer:
- https://confluence.issues.couchbase.com/wiki/spaces/~712020fe4af18cd5c24ed48c629eff8c305e34/pages/3337125907/Terminology+and+Folder+Structure+Proposal#Idea---01-%5BFINALIZED%5D
- https://confluence.issues.couchbase.com/wiki/spaces/~712020fe4af18cd5c24ed48c629eff8c305e34/pages/3337125907/Terminology+and+Folder+Structure+Proposal#Appendix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to H2
No description provided.