Skip to content

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Dhivya-Bharathy
Copy link
Contributor

@Dhivya-Bharathy Dhivya-Bharathy commented Jun 22, 2025

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 📝

Relevant files
Enhancement
Crypto_Research_Agent_Intelligence_Agent.ipynb
New crypto research agent notebook implementation               

examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb

  • Add complete Jupyter notebook for cryptocurrency research agent
  • Implement agent with YAML configuration and PraisonAI framework
  • Include comprehensive analysis of Render Token (RNDR) as example
  • Provide structured markdown output with utility, tokenomics, risks
    analysis
  • +570/-0 

    Need help?
  • Type /help how to ... in the comments thread for any questions about Qodo Merge usage.
  • Check out the documentation for more information.
  • Summary by CodeRabbit

    • New Features
      • Introduced a new Jupyter notebook for cryptocurrency intelligence research, featuring an AI agent that analyzes and reports on blockchain projects and market trends.
      • Provides detailed, markdown-formatted reports on specific cryptocurrencies, including fundamentals, risks, and growth outlook.
      • Securely prompts for and uses an OpenAI API key for analysis.

    Copy link
    Contributor

    coderabbitai bot commented Jun 22, 2025

    Walkthrough

    A 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

    File(s) Change Summary
    examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb Added new notebook implementing a cryptocurrency research agent using PraisonAI Agents and OpenAI GPT-4o.

    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
    
    Loading

    Suggested labels

    Review effort 2/5

    Poem

    In a notebook new, a rabbit peers,
    Crypto secrets whispered in digital ears.
    With agents and tasks, the research begins,
    RNDR unraveled, where insight wins.
    Markdown magic, a report appears—
    Blockchain mysteries, brought ever near!
    🐇✨


    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.

    Copy link
    Contributor

    @gemini-code-assist gemini-code-assist bot left a 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

    1. 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.

    Copy link

    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:

    ⏱️ Estimated effort to review: 2 🔵🔵⚪⚪⚪
    🧪 No relevant tests
    🔒 Security concerns

    API key exposure:
    The notebook uses getpass to collect the OpenAI API key, but in Jupyter environments, this could still be vulnerable to exposure through notebook outputs, shared sessions, or if the notebook is saved with execution state. Consider adding warnings about not sharing executed notebooks or implementing additional security measures for API key handling.

    ⚡ Recommended focus areas for review

    Security Risk

    The notebook prompts users to input their OpenAI API key directly in the cell using getpass, which could lead to accidental exposure in shared environments or version control if the notebook is executed and saved with outputs.

    "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"
    ]
    
    Unused Code

    The yaml_prompt variable is defined but never used in the implementation. The agent configuration is done directly in the Agent constructor instead of using this YAML configuration.

     "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"
    ]
    

    Copy link

    codecov bot commented Jun 22, 2025

    Codecov Report

    All modified and coverable lines are covered by tests ✅

    Project coverage is 14.50%. Comparing base (8ee013e) to head (5b71e7a).
    Report is 169 commits behind head on main.

    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           
    Flag Coverage Δ
    quick-validation 0.00% <ø> (ø)
    unit-tests 14.50% <ø> (ø)

    Flags with carried forward coverage won't be shown. Click here to find out more.

    ☔ View full report in Codecov by Sentry.
    📢 Have feedback on the report? Share it here.

    🚀 New features to boost your workflow:
    • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
    • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

    Copy link
    Contributor

    @coderabbitai coderabbitai bot left a 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.

    -"[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DhivyaBharathy-web/PraisonAI/blob/main/examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb)\n",
    +"[![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](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:

    1. A requirements check cell to verify all dependencies are properly installed
    2. Clear instructions on obtaining and using OpenAI API keys
    3. Example queries users can try beyond the hardcoded RNDR example
    4. Rate limiting considerations for API usage
    5. Cost estimation warnings for OpenAI API usage
    📜 Review details

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

    📥 Commits

    Reviewing files that changed from the base of the PR and between 851d43f and 5b71e7a.

    📒 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)

    Comment on lines +145 to +158
    "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"
    Copy link
    Contributor

    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.

    Suggested change
    "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.
    

    Comment on lines +551 to +555
    "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"
    Copy link
    Contributor

    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.

    Suggested change
    "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.
    

    Comment on lines +94 to +102
    "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"
    ]
    Copy link
    Contributor

    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.

    Suggested change
    "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.
    

    Comment on lines +180 to +190
    "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"
    Copy link
    Contributor

    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.

    Suggested change
    "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.
    

    Copy link

    You are nearing your monthly Qodo Merge usage quota. For more information, please visit here.

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Impact
    General
    Make cryptocurrency query configurable

    The hardcoded query limits the notebook's reusability and educational value.
    Making it configurable would allow users to research different cryptocurrencies
    without modifying the code.

    examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb [551-552]

    -query = "Research Render Token (RNDR), its tokenomics, risks, and growth potential."
    +# Allow users to specify their own cryptocurrency to research
    +crypto_to_research = input("Enter the cryptocurrency you want to research (e.g., 'Bitcoin', 'Ethereum', 'Render Token'): ")
    +query = f"Research {crypto_to_research}, its tokenomics, risks, and growth potential."
     output = crypto_team.start(input=query)

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 7

    __

    Why: The suggestion correctly points out that the query is hardcoded. Making the query configurable with user input significantly improves the reusability and interactivity of the notebook, enhancing its value as a cookbook example.

    Medium
    Add structured research methodology

    The agent instructions lack specific guidance on data sources and research
    methodology. Adding structured research steps would improve consistency and
    reliability of the analysis output.

    examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb [180-190]

     crypto_agent = Agent(
         name="CryptoResearcherAgent",
         instructions="""
    -You are a cryptocurrency intelligence agent. Use your analytical skills to evaluate coins, blockchain protocols, tokenomics,
    -and market trends. Provide critical insight into legitimacy, potential growth, and associated risks.
    -Use markdown formatting and structure your research clearly.
    +You are a cryptocurrency intelligence agent. Follow these steps for comprehensive analysis:
    +1. Research project fundamentals, team, and technology
    +2. Analyze tokenomics including supply, distribution, and utility
    +3. Evaluate market competition and positioning
    +4. Assess regulatory and technical risks
    +5. Identify potential red flags or legitimacy concerns
    +Provide critical insight into legitimacy, potential growth, and associated risks.
    +Use markdown formatting and structure your research clearly with clear sections.
     """,
         llm="gpt-4o",
         verbose=True,
         markdown=True
     )

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 6

    __

    Why: The suggestion proposes adding more detailed, structured instructions for the agent. This is a valuable improvement as it makes the agent's behavior more predictable and the output more consistent, which is beneficial for an example notebook.

    Low
    Remove unused variable definition

    The yaml_prompt variable is defined but never used in the code. This creates
    unnecessary code that serves no purpose and may confuse users about the intended
    workflow.

    examples/cookbooks/Crypto_Research_Agent_Intelligence_Agent.ipynb [145-158]

    -yaml_prompt = """
    -name: CryptoResearcherAgent
    -role: Cryptocurrency Intelligence Agent
    -goal: Provide accurate, timely, and insightful research on cryptocurrency projects, trends, and risks.
    -backstory: You are a professional crypto analyst, skilled in assessing coins, tokens, and DeFi protocols using web research and market trends.
    -skills:
    -  - Analyze tokenomics and utility
    -  - Evaluate risk factors
    -  - Identify scams or red flags
    -  - Summarize project fundamentals
    -llm: gpt-4o
    -verbosity: true
    -format: markdown
    -"""
    +# Remove the unused yaml_prompt variable entirely

    [To ensure code accuracy, apply this suggestion manually]

    Suggestion importance[1-10]: 4

    __

    Why: The suggestion correctly identifies that the yaml_prompt variable is defined but never used. Removing this dead code improves the clarity and maintainability of the example notebook.

    Low
    • More

    Copy link
    Contributor

    @gemini-code-assist gemini-code-assist bot left a 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.

    Comment on lines +259 to +260
    "<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",
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    medium

    The role being displayed here is 'Assistant', but in the YAML prompt, the role is defined as 'Cryptocurrency Intelligence Agent'. It might be useful to display the actual role defined in the YAML for clarity.

    Comment on lines +331 to +334
    "<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",
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    medium

    Consider adding a note about the importance of not including extra conversation or explanation, as this is a specific requirement for the task and could affect the output quality if ignored.

    Comment on lines +513 to +514
    "🪙 Crypto Research Report:\n",
    " # Render Token (RNDR) Analysis\n",
    Copy link
    Contributor

    Choose a reason for hiding this comment

    The reason will be displayed to describe this comment to others. Learn more.

    medium

    Consider adding a brief explanation of what the output represents (e.g., a summary of the analysis).

    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    1 participant