-
-
Notifications
You must be signed in to change notification settings - Fork 688
Add crypto research agent intelligence agent #676
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?
Add crypto research agent intelligence agent #676
Conversation
WalkthroughA new Jupyter notebook, "Crypto Research Agent: Intelligence Agent," has been added. It sets up dependencies, configures an OpenAI API key, and uses PraisonAI Agents to create an agent for analyzing cryptocurrencies. The agent researches Render Token (RNDR), generating a detailed markdown report on its fundamentals, risks, and potential. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Notebook
participant PraisonAIAgents
participant Agent
participant OpenAI_API
User->>Notebook: Provide OpenAI API key
User->>Notebook: Run research prompt on RNDR
Notebook->>PraisonAIAgents: Initialize with Agent and Task
PraisonAIAgents->>Agent: Assign research task
Agent->>OpenAI_API: Query with research instructions
OpenAI_API-->>Agent: Return analysis
Agent->>PraisonAIAgents: Submit markdown report
PraisonAIAgents->>Notebook: Output report
Notebook->>User: Display markdown report
Suggested labels
Poem
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Summary of Changes
Hello @DhivyaBharathy-web, 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 introduces a specialized AI agent focused on cryptocurrency research, packaged as a new Jupyter Notebook example. The agent is designed to analyze the crypto ecosystem, track trends, and deliver fundamental insights into tokens, projects, and market movements, providing a practical demonstration of how to leverage AI for in-depth financial analysis within the blockchain space.
Highlights
- New Crypto Research Agent: Introduces a new Jupyter Notebook example (
examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb
) for a 'Crypto Research Agent' using the PraisonAI framework, designed to provide in-depth intelligence on cryptocurrencies and blockchain trends. - Agent Configuration and Capabilities: Demonstrates how to configure an AI agent with a specific role ('Cryptocurrency Intelligence Agent'), goal, backstory, and skills tailored for comprehensive cryptocurrency analysis, including tokenomics, risk evaluation, scam identification, and fundamental summarization.
- Practical Research Example: Provides a runnable example within the notebook where the agent performs a detailed research task on a specific token (e.g., 'Render Token (RNDR)'), showcasing its ability to generate structured markdown reports covering utility, tokenomics, risks, growth outlook, and red flags.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
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 .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and 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 to provide feedback.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here. PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #676 +/- ##
=======================================
Coverage 14.50% 14.50%
=======================================
Files 25 25
Lines 2517 2517
Branches 357 357
=======================================
Hits 365 365
Misses 2136 2136
Partials 16 16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Actionable comments posted: 4
🧹 Nitpick comments (4)
examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb (4)
22-22
: Update Colab badge URL to point to the main repository.The Colab badge currently points to a user's fork (
DhivyaBharathy-web
) rather than the main repository. This should reference the canonical repository location.-"[](https://colab.research.google.com/github/DhivyaBharathy-web/PraisonAI/blob/main/examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb)\n", +"[](https://colab.research.google.com/github/MervinPraison/PraisonAI/blob/main/examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb)\n",
61-61
: Consider adding version pinning for better reproducibility.Installing packages without version constraints may lead to compatibility issues as dependencies evolve.
-"!pip install -q praisonaiagents openai duckduckgo_search" +"!pip install -q praisonaiagents>=0.1.0 openai>=1.0.0 duckduckgo_search>=3.8.0"
38-45
: Remove or clean up execution metadata.The notebook contains hardcoded execution metadata (execution_count, outputId, etc.) that should be cleared for a clean distribution.
Consider clearing all outputs and execution metadata before committing the notebook to maintain a clean state for users. This can be done with:
- Jupyter: Kernel → Restart & Clear Output
- Command line:
jupyter nbconvert --clear-output --inplace notebook.ipynb
1-570
: Consider adding input validation and user guidance.The notebook would benefit from additional user guidance and input validation to improve the user experience.
Consider adding:
- A requirements check cell to verify all dependencies are properly installed
- Clear instructions on obtaining and using OpenAI API keys
- Example queries users can try beyond the hardcoded RNDR example
- Rate limiting considerations for API usage
- Cost estimation warnings for OpenAI API usage
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: performance-test
- GitHub Check: Run tests and collect coverage
- GitHub Check: quick-test
- GitHub Check: test-core (3.11)
"yaml_prompt = \"\"\"\n", | ||
"name: CryptoResearcherAgent\n", | ||
"role: Cryptocurrency Intelligence Agent\n", | ||
"goal: Provide accurate, timely, and insightful research on cryptocurrency projects, trends, and risks.\n", | ||
"backstory: You are a professional crypto analyst, skilled in assessing coins, tokens, and DeFi protocols using web research and market trends.\n", | ||
"skills:\n", | ||
" - Analyze tokenomics and utility\n", | ||
" - Evaluate risk factors\n", | ||
" - Identify scams or red flags\n", | ||
" - Summarize project fundamentals\n", | ||
"llm: gpt-4o\n", | ||
"verbosity: true\n", | ||
"format: markdown\n", | ||
"\"\"\"\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.
🛠️ Refactor suggestion
Remove unused YAML prompt configuration.
The yaml_prompt
variable is defined but never used in the code. This creates confusion and should be removed or properly integrated.
This YAML configuration is not utilized anywhere in the notebook. Either remove it or integrate it with the Agent configuration if it's intended to be used.
-"yaml_prompt = \"\"\"\n",
-"name: CryptoResearcherAgent\n",
-"role: Cryptocurrency Intelligence Agent\n",
-"goal: Provide accurate, timely, and insightful research on cryptocurrency projects, trends, and risks.\n",
-"backstory: You are a professional crypto analyst, skilled in assessing coins, tokens, and DeFi protocols using web research and market trends.\n",
-"skills:\n",
-" - Analyze tokenomics and utility\n",
-" - Evaluate risk factors\n",
-" - Identify scams or red flags\n",
-" - Summarize project fundamentals\n",
-"llm: gpt-4o\n",
-"verbosity: true\n",
-"format: markdown\n",
-"\"\"\"\n"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"yaml_prompt = \"\"\"\n", | |
"name: CryptoResearcherAgent\n", | |
"role: Cryptocurrency Intelligence Agent\n", | |
"goal: Provide accurate, timely, and insightful research on cryptocurrency projects, trends, and risks.\n", | |
"backstory: You are a professional crypto analyst, skilled in assessing coins, tokens, and DeFi protocols using web research and market trends.\n", | |
"skills:\n", | |
" - Analyze tokenomics and utility\n", | |
" - Evaluate risk factors\n", | |
" - Identify scams or red flags\n", | |
" - Summarize project fundamentals\n", | |
"llm: gpt-4o\n", | |
"verbosity: true\n", | |
"format: markdown\n", | |
"\"\"\"\n" |
🤖 Prompt for AI Agents
In examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb around
lines 145 to 158, the yaml_prompt variable is defined but never used, causing
confusion. Remove the entire yaml_prompt variable definition if it is not
needed, or if it is intended to configure the Agent, integrate it properly by
passing it to the Agent initialization or relevant configuration section.
"query = \"Research Render Token (RNDR), its tokenomics, risks, and growth potential.\"\n", | ||
"output = crypto_team.start(input=query)\n", | ||
"\n", | ||
"# 📄 Output the result\n", | ||
"print(\"🪙 Crypto Research Report:\\n\", output)\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.
🛠️ Refactor suggestion
Add error handling for query execution.
The query execution lacks error handling and could fail silently or with unclear error messages.
-"query = \"Research Render Token (RNDR), its tokenomics, risks, and growth potential.\"\n",
-"output = crypto_team.start(input=query)\n",
-"\n",
-"# 📄 Output the result\n",
-"print(\"🪙 Crypto Research Report:\\n\", output)\n"
+"query = \"Research Render Token (RNDR), its tokenomics, risks, and growth potential.\"\n",
+"try:\n",
+" print(\"🔍 Starting crypto research...\")\n",
+" output = crypto_team.start(input=query)\n",
+" \n",
+" # 📄 Output the result\n",
+" print(\"🪙 Crypto Research Report:\\n\", output)\n",
+"except Exception as e:\n",
+" print(f\"❌ Research failed: {e}\")\n",
+" print(\"💡 Check your API key and internet connection\")\n"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"query = \"Research Render Token (RNDR), its tokenomics, risks, and growth potential.\"\n", | |
"output = crypto_team.start(input=query)\n", | |
"\n", | |
"# 📄 Output the result\n", | |
"print(\"🪙 Crypto Research Report:\\n\", output)\n" | |
query = "Research Render Token (RNDR), its tokenomics, risks, and growth potential." | |
try: | |
print("🔍 Starting crypto research...") | |
output = crypto_team.start(input=query) | |
# 📄 Output the result | |
print("🪙 Crypto Research Report:\n", output) | |
except Exception as e: | |
print(f"❌ Research failed: {e}") | |
print("💡 Check your API key and internet connection") |
🤖 Prompt for AI Agents
In examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb around
lines 551 to 555, the code executes a query without any error handling, which
may cause silent failures or unclear errors. Wrap the query execution and output
printing in a try-except block to catch exceptions, log or print a clear error
message, and prevent the program from crashing unexpectedly.
"source": [ | ||
"import os\n", | ||
"from getpass import getpass\n", | ||
"\n", | ||
"# 🔑 Prompt user to input API Key securely\n", | ||
"os.environ[\"OPENAI_API_KEY\"] = getpass(\"Enter your OpenAI API key: \")\n", | ||
"import openai\n", | ||
"openai.api_key = os.getenv(\"OPENAI_API_KEY\")\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.
🛠️ Refactor suggestion
Add validation for OpenAI API key and improve user guidance.
The current implementation doesn't validate the API key format or provide guidance on where to obtain it.
"import os\n",
"from getpass import getpass\n",
"\n",
+"# 📖 Get your OpenAI API key from: https://platform.openai.com/api-keys\n",
"# 🔑 Prompt user to input API Key securely\n",
-"os.environ[\"OPENAI_API_KEY\"] = getpass(\"Enter your OpenAI API key: \")\n",
+"api_key = getpass(\"Enter your OpenAI API key: \")\n",
+"if not api_key.startswith('sk-'):\n",
+" print(\"⚠️ Warning: API key should start with 'sk-'. Please verify your key.\")\n",
+"os.environ[\"OPENAI_API_KEY\"] = api_key\n",
"import openai\n",
"openai.api_key = os.getenv(\"OPENAI_API_KEY\")\n"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"source": [ | |
"import os\n", | |
"from getpass import getpass\n", | |
"\n", | |
"# 🔑 Prompt user to input API Key securely\n", | |
"os.environ[\"OPENAI_API_KEY\"] = getpass(\"Enter your OpenAI API key: \")\n", | |
"import openai\n", | |
"openai.api_key = os.getenv(\"OPENAI_API_KEY\")\n" | |
] | |
import os | |
from getpass import getpass | |
# 📖 Get your OpenAI API key from: https://platform.openai.com/api-keys | |
# 🔑 Prompt user to input API Key securely | |
api_key = getpass("Enter your OpenAI API key: ") | |
if not api_key.startswith('sk-'): | |
print("⚠️ Warning: API key should start with 'sk-'. Please verify your key.") | |
os.environ["OPENAI_API_KEY"] = api_key | |
import openai | |
openai.api_key = os.getenv("OPENAI_API_KEY") |
🤖 Prompt for AI Agents
In examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb around
lines 94 to 102, the code sets the OpenAI API key from user input without
validating its format or guiding the user. Add validation to check if the
entered key matches the expected pattern (e.g., starts with "sk-" and has the
correct length) and provide a clear message on how to obtain a valid API key if
the input is invalid or empty. This ensures the user inputs a proper key before
proceeding.
"crypto_agent = Agent(\n", | ||
" name=\"CryptoResearcherAgent\",\n", | ||
" instructions=\"\"\"\n", | ||
"You are a cryptocurrency intelligence agent. Use your analytical skills to evaluate coins, blockchain protocols, tokenomics,\n", | ||
"and market trends. Provide critical insight into legitimacy, potential growth, and associated risks.\n", | ||
"Use markdown formatting and structure your research clearly.\n", | ||
"\"\"\",\n", | ||
" llm=\"gpt-4o\",\n", | ||
" verbose=True,\n", | ||
" markdown=True\n", | ||
")\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.
🛠️ Refactor suggestion
Add error handling for Agent creation.
The Agent creation lacks error handling which could lead to unclear failures if the configuration is invalid.
-"crypto_agent = Agent(\n",
-" name=\"CryptoResearcherAgent\",\n",
-" instructions=\"\"\"\n",
-"You are a cryptocurrency intelligence agent. Use your analytical skills to evaluate coins, blockchain protocols, tokenomics,\n",
-"and market trends. Provide critical insight into legitimacy, potential growth, and associated risks.\n",
-"Use markdown formatting and structure your research clearly.\n",
-"\"\"\",\n",
-" llm=\"gpt-4o\",\n",
-" verbose=True,\n",
-" markdown=True\n",
-")\n"
+"try:\n",
+" crypto_agent = Agent(\n",
+" name=\"CryptoResearcherAgent\",\n",
+" instructions=\"\"\"\n",
+"You are a cryptocurrency intelligence agent. Use your analytical skills to evaluate coins, blockchain protocols, tokenomics,\n",
+"and market trends. Provide critical insight into legitimacy, potential growth, and associated risks.\n",
+"Use markdown formatting and structure your research clearly.\n",
+"\"\"\",\n",
+" llm=\"gpt-4o\",\n",
+" verbose=True,\n",
+" markdown=True\n",
+" )\n",
+" print(\"✅ Agent created successfully\")\n",
+"except Exception as e:\n",
+" print(f\"❌ Failed to create agent: {e}\")\n",
+" raise\n"
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
"crypto_agent = Agent(\n", | |
" name=\"CryptoResearcherAgent\",\n", | |
" instructions=\"\"\"\n", | |
"You are a cryptocurrency intelligence agent. Use your analytical skills to evaluate coins, blockchain protocols, tokenomics,\n", | |
"and market trends. Provide critical insight into legitimacy, potential growth, and associated risks.\n", | |
"Use markdown formatting and structure your research clearly.\n", | |
"\"\"\",\n", | |
" llm=\"gpt-4o\",\n", | |
" verbose=True,\n", | |
" markdown=True\n", | |
")\n" | |
try: | |
crypto_agent = Agent( | |
name="CryptoResearcherAgent", | |
instructions=\"\"\"\nYou are a cryptocurrency intelligence agent. Use your analytical skills to evaluate coins, blockchain protocols, tokenomics,\nand market trends. Provide critical insight into legitimacy, potential growth, and associated risks.\nUse markdown formatting and structure your research clearly.\n\"\"\",\n | |
llm="gpt-4o", | |
verbose=True, | |
markdown=True | |
) | |
print("✅ Agent created successfully") | |
except Exception as e: | |
print(f"❌ Failed to create agent: {e}") | |
raise |
🤖 Prompt for AI Agents
In examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb around
lines 180 to 190, the Agent creation does not include error handling, which may
cause unclear failures if the configuration is invalid. Wrap the Agent
instantiation in a try-except block to catch exceptions, log or print a clear
error message, and handle the failure gracefully to improve robustness.
You are nearing your monthly Qodo Merge usage quota. For more information, please visit here. PR Code Suggestions ✨Explore these optional code suggestions:
|
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
The pull request introduces a new Jupyter notebook that implements a Crypto Research Agent. The agent leverages the PraisonAI framework to analyze cryptocurrencies, assess risks, and provide market insights. The notebook includes an example analysis of Render Token (RNDR). The review suggests improvements to the clarity of role display and task instructions, as well as adding a description of the output.
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #ff9b9b; text-decoration-color: #ff9b9b; font-weight: bold\">👤 Agent:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">CryptoResearcherAgent</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\n", | ||
"<span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span> <span style=\"color: #b4b4b3; text-decoration-color: #b4b4b3; font-weight: bold\">Role:</span> <span style=\"color: #ffe5e5; text-decoration-color: #ffe5e5\">Assistant</span> <span style=\"color: #d2e3c8; text-decoration-color: #d2e3c8\">│</span>\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.
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> You need to do the following task: Research and summarize the fundamentals, risks, and potential of the 'Render <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n", | ||
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> Token (RNDR)'. Expected Output: A detailed markdown report covering utility, tokenomics, risks, growth outlook, <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n", | ||
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> and red flags.. Please provide only the final result of your work. Do not add any conversation or extra <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\n", | ||
"<span style=\"color: #008080; text-decoration-color: #008080\">│</span> explanation. <span style=\"color: #008080; text-decoration-color: #008080\">│</span>\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.
"🪙 Crypto Research Report:\n", | ||
" # Render Token (RNDR) Analysis\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.
User description
A dynamic agent focused on the crypto ecosystem. It researches cryptocurrencies, tracks trends, and provides fundamental insights into tokens, projects, and market movements.
PR Type
Enhancement
Description
Add new Crypto Research Agent Intelligence Agent notebook
Provides comprehensive cryptocurrency analysis and research capabilities
Includes tokenomics evaluation, risk assessment, and market insights
Features interactive Jupyter notebook with PraisonAI integration
Changes walkthrough 📝
Crypto_Research_Agent_Intelligence_Agent.ipynb
New crypto research agent notebook implementation
examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb
analysis
Summary by CodeRabbit