<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Emmanuel Onwuegbusi</title>
    <description>The latest articles on Forem by Emmanuel Onwuegbusi (@emmakodes_).</description>
    <link>https://forem.com/emmakodes_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1091487%2F3098af3e-0079-4048-a9ab-b9bda17c490e.jpeg</url>
      <title>Forem: Emmanuel Onwuegbusi</title>
      <link>https://forem.com/emmakodes_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/emmakodes_"/>
    <language>en</language>
    <item>
      <title>Build Your Own AI Agent that Can Browse the Web and Take Actions 🤖</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Fri, 09 May 2025 12:44:55 +0000</pubDate>
      <link>https://forem.com/emmakodes_/build-your-own-ai-agent-that-can-browse-the-web-and-take-actions-ogo</link>
      <guid>https://forem.com/emmakodes_/build-your-own-ai-agent-that-can-browse-the-web-and-take-actions-ogo</guid>
      <description>&lt;p&gt;In this article, we'll explore how to build an AI agent that can automatically browse the web and perform actions using the &lt;a href="https://github.com/supercog-ai/agentic" rel="noopener noreferrer"&gt;Supercog Agentic Framework&lt;/a&gt;. This powerful agent combines browser automation with AI vision models to create an intelligent web assistant that can navigate websites, extract information, and perform tasks just like a human would.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline 📋
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Set up Required API Keys&lt;/li&gt;
&lt;li&gt;Running the OSS Operator Agent&lt;/li&gt;
&lt;li&gt;Customizing the Agent&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation 🛠️
&lt;/h2&gt;

&lt;p&gt;Let's install the framework from source to get started:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone the repository&lt;/span&gt;
git clone https://github.com/supercog-ai/agentic.git

&lt;span class="c"&gt;# Change to the agentic directory&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;agentic

&lt;span class="c"&gt;# Create and activate a virtual environment&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv .venv
&lt;span class="nb"&gt;source&lt;/span&gt; .venv/bin/activate  &lt;span class="c"&gt;# On Windows: .venv\Scripts\activate&lt;/span&gt;

&lt;span class="c"&gt;# Install with browser-use dependencies&lt;/span&gt;
uv pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;".[browser-use,dev]"&lt;/span&gt;

&lt;span class="c"&gt;# Install Playwright browsers&lt;/span&gt;
playwright &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set up Required API Keys 🔑
&lt;/h2&gt;

&lt;p&gt;To use the OSS Operator Agent, you'll need to set up an API key for your chosen model:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Google Gemini API Key&lt;/strong&gt; (Recommended):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up at &lt;a href="https://makersuite.google.com/app/apikey" rel="noopener noreferrer"&gt;Google AI Studio&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create an API key&lt;/li&gt;
&lt;li&gt;We recommend using Gemini 2.0 Flash model which is optimized for browser automation tasks and has better context handling&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;OpenAI API Key&lt;/strong&gt; (Alternative):&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up at &lt;a href="https://platform.openai.com" rel="noopener noreferrer"&gt;OpenAI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create an API key in your account settings&lt;/li&gt;
&lt;li&gt;Can be used with GPT-4 or other OpenAI models&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can set the key as an environment variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# For Gemini (recommended)&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;GEMINI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_gemini_key

&lt;span class="c"&gt;# OR for OpenAI&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_openai_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running the OSS Operator Agent 🚀
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the examples directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;examples
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run the OSS operator agent:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python oss_operator.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;The agent will start and you can interact with it through the command line. Try asking it to:

&lt;ul&gt;
&lt;li&gt;Get the first 5 posts from Hacker News homepage&lt;/li&gt;
&lt;li&gt;Search for specific information on a website&lt;/li&gt;
&lt;li&gt;Fill out forms or perform actions on websites&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Example interaction:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I am your open source Operator. What task would you like me to perform?
&amp;gt; get me the first 5 posts on hackernews homepage
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open a browser window&lt;/li&gt;
&lt;li&gt;Navigate to Hacker News&lt;/li&gt;
&lt;li&gt;Extract the first 5 posts&lt;/li&gt;
&lt;li&gt;Return the results to you&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Customizing the Agent 🎯
&lt;/h2&gt;

&lt;p&gt;You can customize the agent by modifying the &lt;code&gt;oss_operator.py&lt;/code&gt; file:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Choose Your Model&lt;/strong&gt;: The agent supports different AI models:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OSS Operator&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;gemini/gemini-2.0-flash&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# Recommended for browser automation
&lt;/span&gt;    &lt;span class="c1"&gt;# Other options:
&lt;/span&gt;    &lt;span class="c1"&gt;# model="openai/gpt-4o"
&lt;/span&gt;    &lt;span class="c1"&gt;# model="openai/gpt-4"
&lt;/span&gt;    &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;BrowserUseTool&lt;/span&gt;&lt;span class="p"&gt;()]&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use Your Browser&lt;/strong&gt;: You can configure the agent to use your actual Chrome browser instance (with your cookies and state):
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nc"&gt;BrowserUseTool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;chrome_instance_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;/Applications/Google Chrome.app/Contents/MacOS/Google Chrome&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;  &lt;span class="c1"&gt;# MacOS
&lt;/span&gt;    &lt;span class="c1"&gt;# For Windows: 'C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe'
&lt;/span&gt;    &lt;span class="c1"&gt;# For Linux: '/usr/bin/google-chrome'
&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion 🎉
&lt;/h2&gt;

&lt;p&gt;The OSS Operator Agent demonstrates the power of combining browser automation with AI vision models. Using the Supercog Agentic Framework, you can create all kinds of sophisticated AI Agents just like the web automation agents that can understand and interact with websites in a human-like way.&lt;/p&gt;

&lt;p&gt;Some exciting use cases:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automated web research&lt;/li&gt;
&lt;li&gt;Data collection and monitoring&lt;/li&gt;
&lt;li&gt;Form filling and submission&lt;/li&gt;
&lt;li&gt;Website testing&lt;/li&gt;
&lt;li&gt;Content extraction&lt;/li&gt;
&lt;li&gt;Automated workflows&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To learn more about Supercog Agentic Framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit the GitHub repository: &lt;a href="https://github.com/supercog-ai/agentic" rel="noopener noreferrer"&gt;https://github.com/supercog-ai/agentic&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Check out the documentation: &lt;a href="https://supercog-ai.github.io/agentic/latest/" rel="noopener noreferrer"&gt;https://supercog-ai.github.io/agentic/latest/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join the Discord community: &lt;a href="https://discord.gg/EmPGShjmGu" rel="noopener noreferrer"&gt;https://discord.gg/EmPGShjmGu&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't forget to star the repository if you find it useful! ⭐ &lt;/p&gt;

&lt;h2&gt;
  
  
  Troubleshooting 🔧
&lt;/h2&gt;

&lt;p&gt;If you encounter any issues:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Browser Installation&lt;/strong&gt;: Make sure Playwright is properly installed:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;playwright &lt;span class="nb"&gt;install&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;API Key Issues&lt;/strong&gt;: Verify your API keys are correctly set in the environment variables.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Model Selection&lt;/strong&gt;: If you run into context limits, try using Gemini 2.0 Flash instead of GPT-4.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Browser Path&lt;/strong&gt;: If using a custom Chrome instance, ensure the path is correct for your operating system.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Feel free to ask questions in the comments below or open an issue on GitHub if you need help! &lt;/p&gt;

</description>
      <category>programming</category>
      <category>ai</category>
      <category>python</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Straightforward No-code Meeting Notetaker Agent 📝</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Fri, 25 Apr 2025 11:57:47 +0000</pubDate>
      <link>https://forem.com/emmakodes_/straightforward-no-code-meeting-notetaker-agent-k9i</link>
      <guid>https://forem.com/emmakodes_/straightforward-no-code-meeting-notetaker-agent-k9i</guid>
      <description>&lt;p&gt;In this article, we will set up and run a No-code meeting note taker agent that records and transcribes meetings, generates meeting summaries from the transcription, and saves them into a knowledge base you can interact with, ask for key points, etc.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sign up on Supercog&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Start the Meeting NoteTaker Agent&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Send the bot to join the Meeting&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Ask for info from the meeting&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Conclusion&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sign up on Supercog
&lt;/h2&gt;

&lt;p&gt;Go to Supercog &lt;a href="https://app.supercog.ai/register/" rel="noopener noreferrer"&gt;https://app.supercog.ai/register/&lt;/a&gt; and register:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjj1uv36evbnet5eack5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjj1uv36evbnet5eack5.png" alt="supercog sign up page" width="800" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Supercog is an advanced AI platform that transforms productivity by connecting directly to your business systems and automating tasks. It enables real-time data analysis, generates insights, and empowers teams to create customizable AI solutions tailored to their needs. You can build AI Agents with Supercog to automate tasks.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start the Meeting NoteTaker Agent
&lt;/h2&gt;

&lt;p&gt;Agents are systems that use LLMs as reasoning engines to determine which actions to take and the inputs to pass to them.&lt;/p&gt;

&lt;p&gt;On the homepage (&lt;a href="https://app.supercog.ai/home/" rel="noopener noreferrer"&gt;https://app.supercog.ai/home/&lt;/a&gt;), scroll to Templates and click the Meeting Bot Agent tab to start chatting quickly:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttk8wz46fqamvdypqkfx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fttk8wz46fqamvdypqkfx.png" alt="Supercog Meeting Bot Agent Tab on Homepage" width="800" height="185"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Send the bot to join the Meeting
&lt;/h2&gt;

&lt;p&gt;In the agent edit page, go to the chat box and enter your prompt that includes your meeting URL&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Join this meeting: https://meet.google.com/example-url-here=here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsul70j4v43pje771xgut.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsul70j4v43pje771xgut.png" alt="Supercog Meeting Bot join meeting prompt" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The bot will join your meeting, record it until it ends, and provide the data as it goes. Supercog will generate a summary from the meeting transcript and index the summary for the RAG process so that you can ask questions to get information from the meeting and get a response based on the meeting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask for info from the meeting
&lt;/h2&gt;

&lt;p&gt;Once the meeting is complete or you leave the meeting, you can go to the chat box to ask questions and get info based on the meeting. For example, in my case, I am finding out what the key points discussed in the meeting were:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixub90300370fc3x2el3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fixub90300370fc3x2el3.png" alt="supercog meeting bot key point output" width="800" height="502"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can ask more questions about the meeting, and Supercog will give you responses based on the meeting data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You can easily do the following and more using Supercog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Integrate seamlessly with various business systems and popular SaaS applications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Automate repetitive tasks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do advanced data analysis&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Deep research&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Podcast generation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Report generation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;File data processing, etc&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://dev.to/emmakodes_/build-your-own-ai-meeting-notetaker-agent-using-supercog-agentic-framework-1hhp"&gt;Build Your Own AI Meeting Notetaker Agent using Supercog Agentic Framework&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>ai</category>
      <category>productivity</category>
      <category>nlp</category>
    </item>
    <item>
      <title>Build Your Own Podcast Producer AI Agent🎙️</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Fri, 18 Apr 2025 17:07:09 +0000</pubDate>
      <link>https://forem.com/emmakodes_/build-your-own-podcast-producer-agent-using-supercog-agentic-framework-3njc</link>
      <guid>https://forem.com/emmakodes_/build-your-own-podcast-producer-agent-using-supercog-agentic-framework-3njc</guid>
      <description>&lt;p&gt;In this article, we'll explore how to build an AI News Podcast Producer Agent that automatically generates, narrates, and publishes daily news updates covering AI, Sports, and Finance using &lt;a href="https://github.com/supercog-ai/agentic" rel="noopener noreferrer"&gt;Supercog Agentic Framework&lt;/a&gt;. This powerful agent combines multiple AI models and tools to create professional-quality podcast episodes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline 📋
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Installation Options&lt;/li&gt;
&lt;li&gt;Set up Required API Keys&lt;/li&gt;
&lt;li&gt;Running the Podcast Agent&lt;/li&gt;
&lt;li&gt;Customizing the Prompts&lt;/li&gt;
&lt;li&gt;Architecture Overview&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Installation Options 🛠️
&lt;/h2&gt;

&lt;p&gt;You have two options for installation:&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: Install from PyPI (Recommended)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Create and activate a virtual environment&lt;/span&gt;
python &lt;span class="nt"&gt;-m&lt;/span&gt; venv venv
&lt;span class="nb"&gt;source &lt;/span&gt;venv/bin/activate  &lt;span class="c"&gt;# On Windows: venv\Scripts\activate&lt;/span&gt;

&lt;span class="c"&gt;# Install from PyPI&lt;/span&gt;
pip &lt;span class="nb"&gt;install &lt;/span&gt;agentic-framework

&lt;span class="c"&gt;# Initialize your project&lt;/span&gt;
agentic init &lt;span class="nb"&gt;.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a basic project structure and copy example agents into your directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 2: Install from Source
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Clone the repository&lt;/span&gt;
git clone https://github.com/supercog-ai/agentic.git

&lt;span class="c"&gt;# Change to the agentic directory&lt;/span&gt;
&lt;span class="nb"&gt;cd &lt;/span&gt;agentic

&lt;span class="c"&gt;# Install with all dependencies&lt;/span&gt;
uv pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;".[all,dev]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set up required API keys 🔑
&lt;/h2&gt;

&lt;p&gt;To use the Podcast Agent, you'll need to set up the following API keys:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Transistor API Key &amp;amp; Show ID:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an account at &lt;a href="https://transistor.fm" rel="noopener noreferrer"&gt;Transistor.fm&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create a new podcast show&lt;/li&gt;
&lt;li&gt;Get your Show ID from the URL: &lt;code&gt;https://dashboard.transistor.fm/shows/SHOW-ID/episodes&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Get your API key from Your Account &amp;gt; API Access&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Tavily API Key:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up at &lt;a href="https://tavily.com" rel="noopener noreferrer"&gt;Tavily&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Navigate to your dashboard to get your API key&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;OpenAI API Key:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up at &lt;a href="https://platform.openai.com" rel="noopener noreferrer"&gt;OpenAI&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Create an API key in your account settings&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Anthropic API Key:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up at &lt;a href="https://www.anthropic.com" rel="noopener noreferrer"&gt;Anthropic&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Get your API key from the dashboard&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can set these keys:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Environment Variables:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TRANSISTOR_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_transistor_key
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TRANSISTOR_SHOW_ID&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_show_id
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;TAVILY_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_tavily_key
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_openai_key
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_anthropic_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Running the Podcast Agent 🚀
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the examples directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;examples/podcast
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Run the podcast agent:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python podcast_short.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Enter the command to start podcast production:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent will then:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Generate AI news using Claude&lt;/li&gt;
&lt;li&gt;Generate sports news using Claude&lt;/li&gt;
&lt;li&gt;Generate finance news using Claude&lt;/li&gt;
&lt;li&gt;Format the news for broadcast&lt;/li&gt;
&lt;li&gt;Convert the text to speech&lt;/li&gt;
&lt;li&gt;Publish the episode to Transistor.fm&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can listen to an example episode here: &lt;a href="https://share.transistor.fm/s/95fa8302" rel="noopener noreferrer"&gt;https://share.transistor.fm/s/95fa8302&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Customizing the Prompts 🎯
&lt;/h2&gt;

&lt;p&gt;The agent uses prompts defined in &lt;code&gt;podcast_short.yaml&lt;/code&gt; to generate each news segment. You can customize these prompts to change:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The style and tone of reporting&lt;/li&gt;
&lt;li&gt;The topics covered&lt;/li&gt;
&lt;li&gt;The length and detail of each segment&lt;/li&gt;
&lt;li&gt;The sources and focus of news gathering&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's an example of the AI News Reporter prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;AI_NEWS_REPORTER&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="s"&gt;You are an experienced, hard-hitting news reporter. You are preparing a news report.&lt;/span&gt;
  &lt;span class="s"&gt;Follow these steps precisely:&lt;/span&gt;
  &lt;span class="s"&gt;1. Search for headlines, using query_news, about "AI and artificial intelligence" but exclude "motley fool".&lt;/span&gt;
  &lt;span class="s"&gt;2. Download pages for the most interesting articles, max 10.&lt;/span&gt;
  &lt;span class="s"&gt;3. Now create a long, extensive "morning news" report in the style of NPR or CNN, but with a hard news edge, and reporting as "Supercog News", at least 10,000 characters. Do not print any paragraph headers.&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Feel free to modify these prompts to create your own unique podcast format!&lt;/p&gt;

&lt;h2&gt;
  
  
  Architecture Overview 🏗️
&lt;/h2&gt;

&lt;p&gt;The podcast agent uses several components:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Google News Tool for gathering news&lt;/li&gt;
&lt;li&gt;Tavily Search Tool for additional research&lt;/li&gt;
&lt;li&gt;Text-to-Speech Tool for narration&lt;/li&gt;
&lt;li&gt;Claude and GPT-4 for content generation and formatting&lt;/li&gt;
&lt;li&gt;Transistor.fm API for podcast publishing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each news segment is generated by a specialized agent (AI, Sports, Finance) that uses both news gathering tools and language models to create professional broadcast-style content.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion 🎉
&lt;/h2&gt;

&lt;p&gt;The AI News Podcast Agent demonstrates the power of the Supercog Agentic Framework for creating complex, multi-step automation workflows. By combining multiple AI models and tools, we can create a fully automated podcast production system that generates, narrates, and publishes professional-quality content.&lt;/p&gt;

&lt;p&gt;To learn more about Supercog Agentic Framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit the GitHub repository: &lt;a href="https://github.com/supercog-ai/agentic" rel="noopener noreferrer"&gt;https://github.com/supercog-ai/agentic&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Check out the documentation: &lt;a href="https://supercog-ai.github.io/agentic/latest/" rel="noopener noreferrer"&gt;https://supercog-ai.github.io/agentic/latest/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join the Discord community: &lt;a href="https://discord.gg/EmPGShjmGu" rel="noopener noreferrer"&gt;https://discord.gg/EmPGShjmGu&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't forget to star the repository if you find it useful! ⭐ &lt;/p&gt;

</description>
      <category>ai</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>python</category>
    </item>
    <item>
      <title>Build Your Own AI People Research Agent using Supercog Agentic Framework 🔍</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Thu, 17 Apr 2025 14:43:14 +0000</pubDate>
      <link>https://forem.com/emmakodes_/how-to-build-your-own-ai-people-research-agent-using-supercog-agentic-framework-25ac</link>
      <guid>https://forem.com/emmakodes_/how-to-build-your-own-ai-people-research-agent-using-supercog-agentic-framework-25ac</guid>
      <description>&lt;p&gt;In this article, we'll explore how to build an AI People Research Agent that can help you gather detailed information about professionals, their career progression, and company backgrounds. This powerful agent combines LinkedIn data with intelligent analysis to create comprehensive professional profiles.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outline&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install Supercog Agentic Framework&lt;/li&gt;
&lt;li&gt;Set up required API keys&lt;/li&gt;
&lt;li&gt;Start the People Researcher Agent&lt;/li&gt;
&lt;li&gt;Run your first people research&lt;/li&gt;
&lt;li&gt;Understanding the output&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install Supercog Agentic Framework 🛠️
&lt;/h2&gt;

&lt;p&gt;Currently, the easiest way to run Supercog agentic framework is from source. We'll use uv for package management:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Clone the Supercog agentic repository:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/supercog-ai/agentic.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Change to the agentic directory:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;agentic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Install the project in editable mode with all optional and development tools using uv:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uv pip &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;".[all,dev]"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set up required API keys 🔑
&lt;/h2&gt;

&lt;p&gt;To use the People Researcher agent, you'll need to set up the following API keys:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;RapidAPI Key&lt;/strong&gt; (for LinkedIn data access)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;OpenAI API Key&lt;/strong&gt; (for the AI model)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;You can set these in one of three ways:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Environment Variables:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;RAPIDAPI_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_rapidapi_key
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;your_openai_api_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;.env File:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;RAPIDAPI_KEY=your_rapidapi_key
OPENAI_API_KEY=your_openai_api_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Using agentic secrets:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;agentic secrets &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="s2"&gt;"RAPIDAPI_KEY=your_rapidapi_key"&lt;/span&gt;
agentic secrets &lt;span class="nb"&gt;set&lt;/span&gt; &lt;span class="s2"&gt;"OPENAI_API_KEY=your_openai_api_key"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can get your RapidAPI key from: &lt;a href="https://rapidapi.com/" rel="noopener noreferrer"&gt;https://rapidapi.com/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Start the People Researcher Agent 🚀
&lt;/h2&gt;

&lt;p&gt;Run the following command to start the People Researcher agent:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python examples/people_researcher.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will launch the agent in interactive mode, ready to accept your research requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run your first people research 🔍
&lt;/h2&gt;

&lt;p&gt;Once the agent is running, you can start researching people by providing their name and company. Here's an example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Do a research on Emmanuel Onwuegbusi, he works at Supercog AI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The agent will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Search for matching LinkedIn profiles&lt;/li&gt;
&lt;li&gt;If multiple matches are found, it will ask you to select the correct one&lt;/li&gt;
&lt;li&gt;Gather detailed profile information&lt;/li&gt;
&lt;li&gt;Research the company background&lt;/li&gt;
&lt;li&gt;Generate a comprehensive report&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Understanding the output 📊
&lt;/h2&gt;

&lt;p&gt;The agent will provide a detailed report that includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Profile overview (name, location, LinkedIn URL)&lt;/li&gt;
&lt;li&gt;Career progression&lt;/li&gt;
&lt;li&gt;Current role details&lt;/li&gt;
&lt;li&gt;Company background&lt;/li&gt;
&lt;li&gt;Education history&lt;/li&gt;
&lt;li&gt;Skills and endorsements&lt;/li&gt;
&lt;li&gt;Certifications and achievements&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's a snippet example of what the output might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;### Background Report on Emmanuel Onwuegbusi

**Profile Overview:**
- **Name:** Emmanuel Onwuegbusi
- **Location:** Nigeria
- **LinkedIn Profile:** [Emmanuel Onwuegbusi](https://www.linkedin.com/in/emmanuelonwuegbusi)
- **Profile Picture:** ![Profile Picture](https://media.licdn.com/dms/image/v2/C5603AQG2ND_gMGxa9w/profile-displayphoto-shrink_800_800/profile-displayphoto-shrink_800_800/0/1559317269391?e=1750291200&amp;amp;v=beta&amp;amp;t=qumIdOQHknAilHHKTKlG4IVW-6kNRDU57XV7v8ETrCI)
- **Summary:** Emmanuel is a Creative Software Engineer with expertise in Software Engineering, Data Science, Machine Learning, and Technical Writing. He leverages his creative skills and technical knowledge to lead and build data-driven applications.

**Career Progression:**

1. **Current Role: Software Engineer at Supercog AI**
   - **Duration:** September 2024 - Present
   - **Location:** San Francisco, California, United States
   - **Description:** Emmanuel is involved in solving complex problems in application and data integration using GenAI and agentic architectures.
   - **Company Overview:** Supercog AI is a technology company specializing in AI and machine learning solutions, focusing on enhancing business operations through innovative AI-driven products and services.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion 🎉
&lt;/h2&gt;

&lt;p&gt;The People Researcher agent is a powerful tool for gathering professional information and creating detailed background reports. It's particularly useful for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Recruiters looking to understand candidate backgrounds&lt;/li&gt;
&lt;li&gt;Business professionals researching potential partners or clients&lt;/li&gt;
&lt;li&gt;Anyone needing detailed professional profiles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can customize your research by:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Adding specific companies to narrow down searches&lt;/li&gt;
&lt;li&gt;Requesting particular aspects of a person's background&lt;/li&gt;
&lt;li&gt;Focusing on specific time periods in their career&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;To learn more about Supercog Agentic Framework:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Visit the GitHub repository: &lt;a href="https://github.com/supercog-ai/agentic" rel="noopener noreferrer"&gt;https://github.com/supercog-ai/agentic&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Check out the documentation: &lt;a href="https://supercog-ai.github.io/agentic/latest/" rel="noopener noreferrer"&gt;https://supercog-ai.github.io/agentic/latest/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Join the Discord community: &lt;a href="https://discord.gg/EmPGShjmGu" rel="noopener noreferrer"&gt;https://discord.gg/EmPGShjmGu&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Don't forget to star the repository if you find it useful! ⭐ &lt;/p&gt;

</description>
      <category>ai</category>
      <category>tutorial</category>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>Build Your Own AI Meeting Notetaker Agent using Supercog Agentic Framework 🚀</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Fri, 04 Apr 2025 16:26:56 +0000</pubDate>
      <link>https://forem.com/emmakodes_/build-your-own-ai-meeting-notetaker-agent-using-supercog-agentic-framework-1hhp</link>
      <guid>https://forem.com/emmakodes_/build-your-own-ai-meeting-notetaker-agent-using-supercog-agentic-framework-1hhp</guid>
      <description>&lt;p&gt;In this article, we will learn to build an AI Meeting Notetaker Agent that records and transcribes meetings, generates meeting summaries from the transcription, and saves that into a knowledge base you can interact with, ask for key points, etc.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Outline&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install Supercog Agentic Framework&lt;/li&gt;
&lt;li&gt;Set the required API keys&lt;/li&gt;
&lt;li&gt;Set up ngrok for Webhook Callbacks&lt;/li&gt;
&lt;li&gt;Start the Meeting NoteTaker Agent&lt;/li&gt;
&lt;li&gt;Send bot to Join Meeting&lt;/li&gt;
&lt;li&gt;Ask for info from meeting&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install Supercog Agentic Framework
&lt;/h2&gt;

&lt;p&gt;Currently, it's probably easiest to run Supercog agentic framework from source. We use uv for package management:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Git clone supercog agentic:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/supercog-ai/agentic.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;change directory to agentic
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd agentic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Install the project in editable mode with all optional and development tools using uv, a faster alternative to pip
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;uv pip install -e ".[all,dev]"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Set the required API keys
&lt;/h2&gt;

&lt;p&gt;Set the following API keys to use OPENAI llm and Meetings Bots As A Service to for example, join meetings.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export OPENAI_API_KEY=your_openai_api_key
export MEETING_BAAS_API_KEY=your_meetingbaas_api_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR&lt;br&gt;
Adding them to .env file&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OPENAI_API_KEY=your_openai_api_key
MEETING_BAAS_API_KEY=your_meetingbaas_api_key
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR&lt;br&gt;
using the agentic secrets set command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;agentic secrets set "OPENAI_API_KEY=your_openai_api_key"
agentic secrets set "MEETING_BAAS_API_KEY=your_meetingbaas_api_key"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can get your meetingbaas API key from: &lt;a href="https://meetingbaas.com/" rel="noopener noreferrer"&gt;https://meetingbaas.com/&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Set up ngrok for Webhook Callbacks
&lt;/h2&gt;

&lt;p&gt;The Meeting Notetaker Agent needs to receive webhook callbacks from the MeetingBaaS service. Since the agent runs locally, we need to expose it to the internet using a tunneling service like ngrok. Here's how to set it up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install ngrok:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# On Ubuntu/Debian&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;ngrok

&lt;span class="c"&gt;# On macOS&lt;/span&gt;
brew &lt;span class="nb"&gt;install &lt;/span&gt;ngrok

&lt;span class="c"&gt;# On Windows&lt;/span&gt;
&lt;span class="c"&gt;# Download from https://ngrok.com/download&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Sign up for a free ngrok account at &lt;a href="https://ngrok.com/" rel="noopener noreferrer"&gt;https://ngrok.com/&lt;/a&gt; and get your authtoken&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure ngrok with your authtoken:&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ngrok config add-authtoken your_authtoken_here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Start ngrok to tunnel to your agent's port (default 8086):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ngrok http 8086
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Set the &lt;code&gt;DEVTUNNEL_HOST&lt;/code&gt; environment variable to your ngrok URL:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;DEVTUNNEL_HOST&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;https://your-ngrok-url.ngrok.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;OR add it to your .env file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DEVTUNNEL_HOST=https://your-ngrok-url.ngrok.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now when you start the Meeting Notetaker Agent, it will be able to receive webhook callbacks from MeetingBaaS through the ngrok tunnel.&lt;/p&gt;

&lt;h2&gt;
  
  
  Start the Meeting NoteTaker Agent
&lt;/h2&gt;

&lt;p&gt;Run the following command in the terminal to start the Next.js - based web dashboard interface on &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; (by default) and to&lt;br&gt;
simultaneously launch the meeting notetaker agent server (FastAPI) in the background on port 8086 by default (specified by --agent-path examples/meeting_notetaker.py)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;agentic dashboard start --agent-path examples/meeting_notetaker.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once you start the web dashboard and the FastAPI web server, you can then go to &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt; on your web browser to access the dashboard.&lt;/p&gt;

&lt;h2&gt;
  
  
  Send Bot to Join Meeting
&lt;/h2&gt;

&lt;p&gt;You can copy your meeting URL and paste with a prompt like the following to send the bot to join your meeting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Join this meeting: https://meet.google.com/example-url-here=here
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The bot will join your meeting, record it until it ends, and provide the data as it goes. Supercog agentic will generate a summary from the meeting transcript and index the summary for the RAG process so that you can ask questions to get information from the meeting and get a response based on the meeting.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask for info from meeting
&lt;/h2&gt;

&lt;p&gt;Once the meeting is complete or you leave the meeting, you can go to the chat box to ask questions and get info based on the meeting. For example, in my case, I am finding out what the key points discussed in the meeting were:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5eba1342ygmeegm8e1vh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5eba1342ygmeegm8e1vh.png" alt="agentic prompts example" width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can ask more questions about the meeting, and Supercog agentic framework is going to give you responses based on the meeting data.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You can see more about Supercog Agentic Framework: &lt;a href="https://github.com/supercog-ai/agentic" rel="noopener noreferrer"&gt;https://github.com/supercog-ai/agentic&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If you are interested in a No-code meeting Note taker agent, you can check out the Supercog Platform: &lt;a href="https://supercog.ai/" rel="noopener noreferrer"&gt;https://supercog.ai/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Also, read this article for a guide: &lt;a href="https://dev.to/emmakodes_/straightforward-no-code-meeting-notetaker-agent-k9i"&gt;Straightforward No-code Meeting Notetaker Agent&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Docs: &lt;a href="https://supercog-ai.github.io/agentic/latest/" rel="noopener noreferrer"&gt;https://supercog-ai.github.io/agentic/latest/&lt;/a&gt;&lt;br&gt;
Join the Discord: &lt;a href="https://discord.gg/EmPGShjmGu" rel="noopener noreferrer"&gt;https://discord.gg/EmPGShjmGu&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>tutorial</category>
      <category>webdev</category>
      <category>python</category>
    </item>
    <item>
      <title>How I Build AI Agents in Seconds🤯</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Thu, 17 Oct 2024 15:46:30 +0000</pubDate>
      <link>https://forem.com/emmakodes_/how-i-build-ai-agents-in-seconds-26kn</link>
      <guid>https://forem.com/emmakodes_/how-i-build-ai-agents-in-seconds-26kn</guid>
      <description>&lt;p&gt;In this article, I will show you how I create AI agents that quickly perform my tasks. &lt;/p&gt;

&lt;p&gt;As an example, I will create an AI Agent that scrapes the web for me and provides the summary of the scraped webpage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Sign up on Supercog&lt;/li&gt;
&lt;li&gt;Create an Agent&lt;/li&gt;
&lt;li&gt;Add tools&lt;/li&gt;
&lt;li&gt;Enter query&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sign up on Supercog
&lt;/h2&gt;

&lt;p&gt;Go to Supercog &lt;a href="https://app.supercog.ai/register/" rel="noopener noreferrer"&gt;https://app.supercog.ai/register/&lt;/a&gt; and register:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjj1uv36evbnet5eack5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjj1uv36evbnet5eack5.png" alt="supercog sign up page" width="800" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create an Agent
&lt;/h2&gt;

&lt;p&gt;Once you register, you will be taken to the homepage of Supercog app, from this page we can create an AI Agent.&lt;/p&gt;

&lt;p&gt;Agents are systems that use LLMs as reasoning engines to determine which actions to take and the inputs to pass them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the &lt;strong&gt;Create Your Own Agent&lt;/strong&gt; button&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihmn6nnmubr2afsistff.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fihmn6nnmubr2afsistff.png" alt="supercog create your own agent" width="565" height="180"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You can give your Agent a Name and a custom Agent Instructions&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2f5nvfz5ydrlq1vfztwg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2f5nvfz5ydrlq1vfztwg.png" alt="Supercog editor page" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add tools
&lt;/h2&gt;

&lt;p&gt;Tools extend the agent's capabilities by allowing it to perform specific actions, like accessing an external database, etc&lt;/p&gt;

&lt;p&gt;We are going to add &lt;strong&gt;Zyte Web Scraping&lt;/strong&gt; Tool to be able to scrape web pages.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click the Add Tool button&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vev9pcpcc3msf69xc9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1vev9pcpcc3msf69xc9a.png" alt="supercog add tool button" width="198" height="83"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Locate the &lt;strong&gt;Internet&lt;/strong&gt; Agent Tools category, expand it and click on the "+" button to add Zyte Web Scraping Tool:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fywma5ca131xdvwukri3j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fywma5ca131xdvwukri3j.png" alt="Zytewebscrapingtool" width="776" height="817"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter query
&lt;/h2&gt;

&lt;p&gt;You can now enter your query to scrape web pages. Go to the chat input box and enter your query. &lt;/p&gt;

&lt;p&gt;For me, I entered the following text:&lt;br&gt;
&lt;em&gt;Scrape this webpage for me and provide a summary of the main ideas: &lt;a href="https://dev.to/emmakodes"&gt;https://dev.to/emmakodes&lt;/a&gt;&lt;/em&gt;/seamlessly-create-jira-issues-from-github-using-natural-language-and-supercog-297m_&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4pj8xtk0e5ovjypi54j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff4pj8xtk0e5ovjypi54j.png" alt="my prompt" width="800" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I got the following response which is a good summary of the article I wrote explaining how to seamlessly Create Jira Issues from GitHub Using Natural Language and Supercog 👏:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcsxbgrb70kldnjov3flu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcsxbgrb70kldnjov3flu.png" alt="supercog web scraping and summary output" width="800" height="638"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You can easily do the following and more using Supercog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Integrate seamlessly with various business systems and popular SaaS applications&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Help to automate repetitive tasks&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Do advanced data analysis&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Report generation&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;File data processing &lt;br&gt;
etc&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>nlp</category>
      <category>tutorial</category>
      <category>ai</category>
    </item>
    <item>
      <title>Get News Updates automatically posted to your Discord using Supercog</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Fri, 04 Oct 2024 13:44:39 +0000</pubDate>
      <link>https://forem.com/emmakodes_/get-news-updates-using-supercog-and-automatically-post-to-your-discord-j5g</link>
      <guid>https://forem.com/emmakodes_/get-news-updates-using-supercog-and-automatically-post-to-your-discord-j5g</guid>
      <description>&lt;p&gt;In this article, we will learn to get News updates on any topic automatically posted to your Discord channel using &lt;strong&gt;Supercog&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Supercog&lt;/strong&gt; is an advanced AI platform that transforms productivity by connecting directly to your business systems and automating tasks. It enables real-time data analysis, generates insights, and empowers teams to create customizable AI solutions tailored to their needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Get your Discord Channel Webhook URL&lt;/li&gt;
&lt;li&gt;Sign up on Supercog&lt;/li&gt;
&lt;li&gt;Create an agent&lt;/li&gt;
&lt;li&gt;Add Tools&lt;/li&gt;
&lt;li&gt;Customize the Agent Instructions&lt;/li&gt;
&lt;li&gt;Enter Query&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can watch the video tutorial:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/58Mbx0hlwz8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Get your Discord Channel Webhook URL
&lt;/h2&gt;

&lt;p&gt;First, you'll need to create a webhook for the specific channel you want to post to.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;In Discord&lt;/strong&gt;: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the channel settings (Edit Channel)
:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszgie5uiu7tv8lo9l3vc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszgie5uiu7tv8lo9l3vc.png" alt="discord channel settings" width="302" height="116"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click on "Integrations"&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create "New Webhook" or use the existing webhook &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the webhook URL&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbxhn6c79spqmis0w2b9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbxhn6c79spqmis0w2b9.png" alt="discord webhook" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Sign up on Supercog
&lt;/h2&gt;

&lt;p&gt;Go to Supercog &lt;a href="https://app.supercog.ai/register/" rel="noopener noreferrer"&gt;https://app.supercog.ai/register/&lt;/a&gt; and register:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjj1uv36evbnet5eack5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwjj1uv36evbnet5eack5.png" alt="supercog sign up page" width="800" height="742"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create an agent
&lt;/h2&gt;

&lt;p&gt;Agents are systems that use LLMs as reasoning engines to determine which actions to take and the inputs to pass them.&lt;/p&gt;

&lt;p&gt;Click the Morning News Report agent tab to start chatting quickly or Create a New Agent for the task you want to accomplish. Click on the Morning News Report agent for this article.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fchk6cvj4msfw95uavsy5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fchk6cvj4msfw95uavsy5.png" alt="supercog Morning News Report agent" width="800" height="442"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add Tools
&lt;/h2&gt;

&lt;p&gt;Tools extend the agent's capabilities by allowing it to perform specific actions, like accessing an external database, etc&lt;/p&gt;

&lt;p&gt;We already have most of the tools we need to get News updates in the Morning News Report agent. We are using Tavily Web Search and Web Browsing (Scale SERP) to perform searches and get the News. Text to Speech tool to transform text into high-quality, real-time speech with minimal latency.&lt;/p&gt;

&lt;p&gt;We are going to add &lt;strong&gt;Discord&lt;/strong&gt; Tool to be able to send the News to your Discord channel.&lt;br&gt;
&lt;strong&gt;Add Discord Tool&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the Add Tool button&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2xpnwwegh41p2jz0qzt8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2xpnwwegh41p2jz0qzt8.png" alt="supercog add tool" width="197" height="90"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Click the Connectors dropdown&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Scroll down to the Discord tool&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04jk1jcybsggkr5l5k5u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F04jk1jcybsggkr5l5k5u.png" alt="supercog agent tools" width="788" height="592"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on the "+" button to add the Discord tool. You will see the &lt;strong&gt;New Connection: Discord&lt;/strong&gt; modal. Enter the Discord Webhook URL you created earlier then click Save:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpefq0e2sd89i2wsxy0z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzpefq0e2sd89i2wsxy0z.png" alt="discord new connection modal" width="762" height="648"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Customize the Agent Instructions
&lt;/h2&gt;

&lt;p&gt;If you want, you can customize the agent instructions to fit your needs. In my case, I will leave it as is since I want to get news about AI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter Query
&lt;/h2&gt;

&lt;p&gt;You can now enter your query to get the News update on any topic and post to your Discord channel. Go to the chat input box and enter your query. &lt;/p&gt;

&lt;p&gt;For me, I entered the following text:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l57t32uqjidio9m1ddx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0l57t32uqjidio9m1ddx.png" alt="supercog chatbox" width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and I got the following output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjs8g4mxae0avdm331avt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjs8g4mxae0avdm331avt.png" alt="supercog news update" width="800" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can then enter the following text in the chatbox to send the News update to my discord channel:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fme6zxyo2vyp9fdfvxboz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fme6zxyo2vyp9fdfvxboz.png" alt="supercog post to discord" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;And I get the following output in my discord channel:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fpz8oco9w4f9ef85u9y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3fpz8oco9w4f9ef85u9y.png" alt="supercog message to discord" width="781" height="678"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Awesome🎉&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You can easily do the following and more using Supercog:&lt;/p&gt;

&lt;p&gt;Integrate seamlessly with various business systems and popular SaaS applications&lt;br&gt;
help to automate repetitive tasks&lt;br&gt;
Do advanced data analysis&lt;br&gt;
report generation&lt;br&gt;
file data processing etc&lt;/p&gt;

</description>
      <category>nlp</category>
      <category>tutorial</category>
      <category>python</category>
      <category>discord</category>
    </item>
    <item>
      <title>Seamlessly Create Jira Issues from GitHub Using Natural Language and Supercog</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Sat, 28 Sep 2024 19:27:18 +0000</pubDate>
      <link>https://forem.com/emmakodes_/seamlessly-create-jira-issues-from-github-using-natural-language-and-supercog-297m</link>
      <guid>https://forem.com/emmakodes_/seamlessly-create-jira-issues-from-github-using-natural-language-and-supercog-297m</guid>
      <description>&lt;p&gt;In this article, we will learn to create Jira issues from GitHub using Natural language and Supercog.&lt;/p&gt;

&lt;p&gt;Outline&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Get your Jira token&lt;/li&gt;
&lt;li&gt;Get your GitHub token&lt;/li&gt;
&lt;li&gt;Sign up on Supercog&lt;/li&gt;
&lt;li&gt;Create an Agent or Click Supercog&lt;/li&gt;
&lt;li&gt;Add tools&lt;/li&gt;
&lt;li&gt;Enter query&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can watch the video tutorial:&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/FL_WJz9Ehyg"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h2&gt;
  
  
  Get your Jira token
&lt;/h2&gt;

&lt;p&gt;Go to &lt;strong&gt;Your Profile and Settings&lt;/strong&gt; tab then click on &lt;strong&gt;Manage account&lt;/strong&gt;. From the nav links, click on Security then scroll and you will find &lt;strong&gt;API tokens&lt;/strong&gt; section. You can then click on &lt;strong&gt;Create and manage API tokens&lt;/strong&gt; to Create your Jira API token&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsockvhmjfv9dlf6lzcv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbsockvhmjfv9dlf6lzcv.png" alt="apitokens" width="745" height="202"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Get your GitHub token
&lt;/h2&gt;

&lt;p&gt;Go to &lt;a href="https://github.com/settings/tokens?type=beta" rel="noopener noreferrer"&gt;https://github.com/settings/tokens?type=beta&lt;/a&gt; to generate your GitHub personal access token&lt;/p&gt;

&lt;h2&gt;
  
  
  Sign up on Supercog
&lt;/h2&gt;

&lt;p&gt;Go to Supercog's page &lt;a href="https://app.supercog.ai/" rel="noopener noreferrer"&gt;https://app.supercog.ai/&lt;/a&gt; and sign up:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuwtokps7b3120o8tu3b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuwtokps7b3120o8tu3b.png" alt="supercog signup/login page" width="698" height="846"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create an Agent or Click Supercog
&lt;/h2&gt;

&lt;p&gt;Click the Supercog tab to start chatting quickly or Create a New Agent for the task you want to accomplish. We will click on the Supercog tab for this article to chat quickly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq0yni7kiuschj5an0zw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq0yni7kiuschj5an0zw.png" alt="supercog homepage" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;From the right, click on the &lt;strong&gt;Add Tool&lt;/strong&gt; button:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmt7ns5t07r29349ffxl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmt7ns5t07r29349ffxl.png" alt="add tool button" width="322" height="257"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;From there, click on the Connectors tab, you will see JIRA as an option. Click on the '+' button then &lt;strong&gt;Make connection&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbq6cszfhju37iuvyacj8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbq6cszfhju37iuvyacj8.png" alt="supercog database tool" width="800" height="825"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Once you click on the &lt;strong&gt;Make connection&lt;/strong&gt; button, you will see &lt;strong&gt;New Connection: JIRA&lt;/strong&gt; modal:&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j2pwksv842tzda84cl8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j2pwksv842tzda84cl8.png" alt="supercog jira modal" width="768" height="612"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Type in your&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Jira Username&lt;/strong&gt;: which is your Jira email address&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jira Token&lt;/strong&gt;: The token you generated&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jira Url:&lt;/strong&gt; Your Jira Project Url. It can be something like: &lt;a href="https://myproject.atlassian.net/" rel="noopener noreferrer"&gt;https://myproject.atlassian.net/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Then you click Save&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add GitHub tool&lt;/strong&gt;: Still Click on the Connectors Tools Tab. Click on the '+' button then &lt;strong&gt;Make connection&lt;/strong&gt;. You will see the following modal:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4ugi18y14bbiso33nlr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa4ugi18y14bbiso33nlr.png" alt="supercog github modal" width="777" height="515"&gt;&lt;/a&gt;&lt;br&gt;
Put in your generated GitHub access token, then click Save&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter query
&lt;/h2&gt;

&lt;p&gt;We can now start chatting with our GitHub and Jira repos and projects. You can ask any question you want.&lt;/p&gt;

&lt;p&gt;Since, we intend to create Jira issues or task from GitHub using Natural language. In the chat box, I can get details of an issue using the following prompt:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;query:&lt;/em&gt; &lt;em&gt;please show me issue #7 of emmakodes talk-to-your-data repo&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;and I got the following response:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8l8n70i7pb8g2cn3g1cn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8l8n70i7pb8g2cn3g1cn.png" alt="supercog git chat response" width="698" height="506"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;and then I can easily say in the chat:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;query:&lt;/em&gt; &lt;em&gt;Now create a jira issue in the AS project from that content&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;AS is my Jira project_key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;and I got the following output:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3uthezb2qnrp4zw7jfkh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3uthezb2qnrp4zw7jfkh.png" alt="supercog output" width="800" height="425"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So Cool🎉&lt;/p&gt;

&lt;p&gt;I can go to my Jira Project to see the issue. &lt;/p&gt;

&lt;p&gt;Yay👏 We have created the issue in our Jira project:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff99d16l178718123jamd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff99d16l178718123jamd.png" alt="jira issue" width="800" height="166"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;You can easily do the following and more using Supercog:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Integrate seamlessly with various business systems and popular SaaS applications&lt;/li&gt;
&lt;li&gt;help to automate repetitive tasks &lt;/li&gt;
&lt;li&gt;Do advanced data analysis&lt;/li&gt;
&lt;li&gt;report generation&lt;/li&gt;
&lt;li&gt;file data processing etc&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>nlp</category>
      <category>tutorial</category>
      <category>python</category>
      <category>jira</category>
    </item>
    <item>
      <title>Chat with your Supabase Database using Natural language and Supercog</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Sat, 21 Sep 2024 06:06:53 +0000</pubDate>
      <link>https://forem.com/emmakodes_/chat-with-your-supabase-database-using-natural-language-and-supercog-28fl</link>
      <guid>https://forem.com/emmakodes_/chat-with-your-supabase-database-using-natural-language-and-supercog-28fl</guid>
      <description>&lt;p&gt;This article will teach you how to interact with your Supabase database using natural language through Supercog.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Supercog&lt;/strong&gt; is an advanced AI platform that transforms productivity by connecting directly to your business systems and automating tasks. It enables real-time data analysis, generates insights, and empowers teams to create customizable AI solutions tailored to their needs.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Get your Supabase Database URL&lt;/li&gt;
&lt;li&gt;Sign up on Supercog&lt;/li&gt;
&lt;li&gt;Create an Agent or Click Supercog&lt;/li&gt;
&lt;li&gt;Add tools&lt;/li&gt;
&lt;li&gt;Enter query&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Get your Supabase Database URL
&lt;/h2&gt;

&lt;p&gt;Go to your supabase Project Settings -&amp;gt; Database -&amp;gt; Connection string&lt;br&gt;
Copy your connection string. You will need it to connect to your supabase database.&lt;/p&gt;

&lt;h2&gt;
  
  
  Sign up on Supercog
&lt;/h2&gt;

&lt;p&gt;Go to Supercog's page &lt;a href="https://app.supercog.ai/" rel="noopener noreferrer"&gt;https://app.supercog.ai/&lt;/a&gt; and sign up:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuwtokps7b3120o8tu3b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuuwtokps7b3120o8tu3b.png" alt="supercog signup/login page"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create an Agent or click Supercog
&lt;/h2&gt;

&lt;p&gt;Click the Supercog tab to start chatting quickly or Create a New Agent for the task you want to accomplish. We will click on the Supercog tab for this article to chat quickly.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq0yni7kiuschj5an0zw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjq0yni7kiuschj5an0zw.png" alt="supercog homepage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Add tools
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;From the right, click on the &lt;strong&gt;Add Tool&lt;/strong&gt; button:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmt7ns5t07r29349ffxl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmt7ns5t07r29349ffxl.png" alt="add tool button"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;From there, click on the Connectors tab, you will see Database as an option. Click on the '+' button then Make a connection:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbq6cszfhju37iuvyacj8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbq6cszfhju37iuvyacj8.png" alt="supercog database tool"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once you click on the &lt;strong&gt;Make connection&lt;/strong&gt; button, you will be shown the &lt;strong&gt;New Connection: Database&lt;/strong&gt; pop up:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwyzqbghkuczhlh0x561o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwyzqbghkuczhlh0x561o.png" alt="New Connection: Database"&gt;&lt;/a&gt;&lt;br&gt;
You will need to put in the connection string you copied from supabase to &lt;strong&gt;The Connection URL for the database&lt;/strong&gt; input box, then you click Save.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add The Charting tools. Click on Dev Tools Tab, then click the '+' button to add the Charting tool. We will use this to create our plot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43e15q311odca2jrut24.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F43e15q311odca2jrut24.png" alt="supercog tools-charting"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Enter query
&lt;/h2&gt;

&lt;p&gt;We can now start chatting with our connected supabase database. You can ask any question you want about your database. &lt;/p&gt;

&lt;p&gt;For me, I entered the following prompt:&lt;br&gt;
&lt;em&gt;What were the top 3 products sold in the month of August? Make a plot of the result. Use the product_data table and sales_data table but first get their schema&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;since I have a product table and a sales table. I wanted to know my top 3 products sold in August and also see the plot😊 Super interesting, right?🚀:&lt;/p&gt;

&lt;p&gt;I got the following output. It shows my top 3 products sold in the month of August and also the plot:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzdy8gvnhhxk0r4tq6km.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frzdy8gvnhhxk0r4tq6km.png" alt="supercogdatabasetoolresult"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Interacting with your database is just one of those things you can do with supercog. You can also: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automate Repetitive Tasks: Set up agents to handle routine processes on a scheduled or on-demand basis.&lt;/li&gt;
&lt;li&gt;Connect to various business systems like HubSpot, Postgres, and Jira for seamless data flow&lt;/li&gt;
&lt;li&gt;Do advanced Data Analysis&lt;/li&gt;
&lt;li&gt;Generate Reports &amp;amp; Insights&lt;/li&gt;
&lt;li&gt;Connect to Popular SaaS Applications: Utilize integrations with popular applications for enhanced functionality.&lt;/li&gt;
&lt;li&gt;Process File Data: Read and process various file types to extract and utilize relevant information.
etc.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>tutorial</category>
      <category>python</category>
      <category>nlp</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>Create your own Custom LLM Agent Using Open Source Models (llama3.1)</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Fri, 16 Aug 2024 18:30:26 +0000</pubDate>
      <link>https://forem.com/emmakodes_/create-your-own-custom-llm-agent-using-open-source-models-llama31-4aag</link>
      <guid>https://forem.com/emmakodes_/create-your-own-custom-llm-agent-using-open-source-models-llama31-4aag</guid>
      <description>&lt;p&gt;In this article, we will learn how to create a custom agent that uses an open source llm (llama3.1) that runs locally on our PC. We will also use Ollama and LangChain.&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install Ollama&lt;/li&gt;
&lt;li&gt;Pull model&lt;/li&gt;
&lt;li&gt;Serve model&lt;/li&gt;
&lt;li&gt;Create a new folder, open it with a code editor&lt;/li&gt;
&lt;li&gt;Create and activate Virtual environment&lt;/li&gt;
&lt;li&gt;Install langchain langchain-ollama&lt;/li&gt;
&lt;li&gt;Build Custom agent with open source model in Python&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install Ollama
&lt;/h2&gt;

&lt;p&gt;Follow the instructions based on your OS type in its GitHub README to install Ollama:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://github.com/ollama/ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I am on a Linux-based PC, so I am going to run the following command in my terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -fsSL https://ollama.com/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pull model
&lt;/h2&gt;

&lt;p&gt;Fetch the available LLM model via the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama pull llama3.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will download the default tagged version of the model. Typically, the default points to the latest, smallest sized-parameter model. In this case, it will be llama3.1:8b model.&lt;/p&gt;

&lt;p&gt;To download another version of the model, you can go to: &lt;a href="https://ollama.com/library/llama3.1" rel="noopener noreferrer"&gt;https://ollama.com/library/llama3.1&lt;/a&gt; and select the version to install, and then run the ollama pull command with the model and its version number. Example: ollama pull llama3.1:70b&lt;/p&gt;

&lt;p&gt;On Mac, the models will be downloaded to ~/.ollama/models&lt;/p&gt;

&lt;p&gt;On Linux (or WSL), the models will be stored at /usr/share/ollama/.ollama/models&lt;/p&gt;

&lt;h2&gt;
  
  
  Serve model
&lt;/h2&gt;

&lt;p&gt;Run the following command to start ollama without running the desktop application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All models are automatically served on localhost:11434&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a new folder, open it with a code editor
&lt;/h2&gt;

&lt;p&gt;Create a new folder on your computer and then open it with a code editor like VS Code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create and activate Virtual environment
&lt;/h2&gt;

&lt;p&gt;Open the terminal. Use the following command to create a virtual environment .venv and activate it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m venv .venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source .venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install langchain langchain-ollama
&lt;/h2&gt;

&lt;p&gt;Run the following command to install langchain and langchain-ollama:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install -U langchain langchain-ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command will install or upgrade the LangChain and LangChain-Ollama packages in Python. The -U flag ensures that the latest versions of these packages are installed, replacing any older versions that may already be present.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build Custom agent with open source model in Python
&lt;/h2&gt;

&lt;p&gt;Create a Python file for example: &lt;code&gt;main.py&lt;/code&gt; and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from langchain_ollama import ChatOllama
from langchain.agents import tool
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
from langchain.agents.format_scratchpad.openai_tools import (
    format_to_openai_tool_messages,
)
from langchain.agents import AgentExecutor
from langchain.agents.output_parsers.openai_tools import OpenAIToolsAgentOutputParser


llm = ChatOllama(
            model="llama3.1",
            temperature=0,
            verbose=True
        )

@tool
def get_word_length(word: str) -&amp;gt; int:
    """Returns the length of a word."""
    return len(word)


tools = [get_word_length]



prompt = ChatPromptTemplate.from_messages(
            [
                (
                    "system",
                    "You are very powerful assistant",
                ),
                ("user", "{input}"),
                MessagesPlaceholder(variable_name="agent_scratchpad"),
            ]
        )

llm_with_tools = llm.bind_tools(tools)

agent = (
    {
        "input": lambda x: x["input"],
        "agent_scratchpad": lambda x: format_to_openai_tool_messages(
            x["intermediate_steps"]
        ),
    }
    | prompt
    | llm_with_tools
    | OpenAIToolsAgentOutputParser()
)

# Create an agent executor by passing in the agent and tools
agent_executor = AgentExecutor(agent=agent, tools=tools, verbose=True)
result = agent_executor.invoke({"input": "How many letters in the word educa"})

if result:
    print(f"[Output] --&amp;gt; {result['output']}")
else:
    print('There are no result..')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code snippet sets up a LangChain agent using the ChatOllama model (llama3.1) to process user input and utilize a custom tool that calculates word length. It defines a prompt template for the agent, binds the tool to the language model, and constructs an agent that processes input and formats intermediate steps. Finally, it creates an AgentExecutor to invoke the agent with a specific input. We pass a simple question to ask "How many letters in the word educa" and then we print the output or indicate if no result was found.&lt;/p&gt;

&lt;p&gt;When we run, we get the following result:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; Entering new AgentExecutor chain...

Invoking: `get_word_length` with `{'word': 'educa'}`


5The word "educa" has 5 letters.

&amp;gt; Finished chain.
[Output] --&amp;gt; The word "educa" has 5 letters.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You see the agent used the model (llama3.1) to call the tool correctly to get the count of letters in the word.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Thanks for reading.&lt;/p&gt;

&lt;p&gt;Check Ollama repo here: &lt;a href="https://github.com/ollama/ollama" rel="noopener noreferrer"&gt;https://github.com/ollama/ollama&lt;/a&gt;&lt;/p&gt;

</description>
      <category>tutorial</category>
      <category>python</category>
      <category>llm</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>How to Run Llama-3.1🦙 locally in Python using Ollama, LangChain</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Fri, 02 Aug 2024 16:03:23 +0000</pubDate>
      <link>https://forem.com/emmakodes_/how-to-run-llama-31-locally-in-python-using-ollama-langchain-k8k</link>
      <guid>https://forem.com/emmakodes_/how-to-run-llama-31-locally-in-python-using-ollama-langchain-k8k</guid>
      <description>&lt;p&gt;In this article, we will learn how to run Llama-3.1 model locally on our PC using Ollama and LangChain in Python&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install Ollama&lt;/li&gt;
&lt;li&gt;Pull model&lt;/li&gt;
&lt;li&gt;Serve model&lt;/li&gt;
&lt;li&gt;Create a new folder, open it with a code editor&lt;/li&gt;
&lt;li&gt;Create and activate Virtual environment&lt;/li&gt;
&lt;li&gt;Install langchain-ollama&lt;/li&gt;
&lt;li&gt;Run Ollama with model in Python&lt;/li&gt;
&lt;li&gt;Conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Install Ollama
&lt;/h2&gt;

&lt;p&gt;Follow the instructions based on your OS type in its GitHub README to install Ollama:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://github.com/ollama/ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I am on a Linux-based PC, so I am going to run the following command in my terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -fsSL https://ollama.com/install.sh | sh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Pull model
&lt;/h2&gt;

&lt;p&gt;Fetch the available LLM model via the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama pull llama3.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will download the default tagged version of the model. Typically, the default points to the latest, smallest sized-parameter model. In this case, it will be llama3.1:8b model. &lt;/p&gt;

&lt;p&gt;To download another version of the model, you can go to: &lt;a href="https://ollama.com/library/llama3.1" rel="noopener noreferrer"&gt;https://ollama.com/library/llama3.1&lt;/a&gt; and select the version to install, and then run the ollama pull command with the model and its version number. Example: &lt;code&gt;ollama pull llama3.1:70b&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;On Mac, the models will be downloaded to ~/.ollama/models&lt;/p&gt;

&lt;p&gt;On Linux (or WSL), the models will be stored at /usr/share/ollama/.ollama/models&lt;/p&gt;

&lt;h2&gt;
  
  
  Serve model
&lt;/h2&gt;

&lt;p&gt;Run the following command to start ollama without running the desktop application.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ollama serve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;All models are automatically served on localhost:11434&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a new folder, open it with a code editor
&lt;/h2&gt;

&lt;p&gt;Create a new folder on your computer and then open it with a code editor like VS Code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create and activate Virtual environment
&lt;/h2&gt;

&lt;p&gt;Open the terminal. Use the following command to create a virtual environment .venv and activate it:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m venv .venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source .venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Install langchain-ollama
&lt;/h2&gt;

&lt;p&gt;Run the following command to install langchain-ollama:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install -U langchain-ollama
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above command will install or upgrade the LangChain Ollama package in Python. This package allows users to integrate and interact with Ollama models, which are open-source large language models, within the LangChain framework. The -U flag ensures that the package is upgraded to the latest version if it is already installed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Run Ollama with model in Python
&lt;/h2&gt;

&lt;p&gt;Create a Python file for example: &lt;code&gt;main.py&lt;/code&gt; and add the following code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from langchain_ollama import OllamaLLM

llm = OllamaLLM(model="llama3.1")

response = llm.invoke("The first man on the moon was ...")
print(response)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code imports the OllamaLLM class from the LangChain library and initializes an instance of the language model "llama3.1". We pass a prompt about the first man on the moon, and store the generated response in the variable response. When we run the above code we get the following response from the model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;...Neil Armstrong!

On July 20, 1969, Neil Armstrong became the first person to set foot on the lunar surface during the Apollo 11 mission. As he stepped off the lunar module Eagle and onto the moon's surface, he famously declared: "That's one small step for man, one giant leap for mankind."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Thanks for reading.&lt;br&gt;
You can view the &lt;a href="https://github.com/ollama/ollama" rel="noopener noreferrer"&gt;Ollama documentation&lt;/a&gt; for more commands.&lt;/p&gt;

</description>
      <category>python</category>
      <category>nlp</category>
      <category>machinelearning</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Setup User Auth for your Reflex app using local_auth</title>
      <dc:creator>Emmanuel Onwuegbusi</dc:creator>
      <pubDate>Tue, 31 Oct 2023 21:00:18 +0000</pubDate>
      <link>https://forem.com/emmakodes_/setup-user-auth-for-your-reflex-app-using-localauth-4nj8</link>
      <guid>https://forem.com/emmakodes_/setup-user-auth-for-your-reflex-app-using-localauth-4nj8</guid>
      <description>&lt;p&gt;In this article, we will configure user authentication for your reflex app by doing everything locally. The user will be able to register, login, and logout.&lt;/p&gt;

&lt;p&gt;This article is based on the local_auth example on reflex_examples GitHub page: &lt;a href="https://github.com/reflex-dev/reflex-examples/tree/main/local_auth" rel="noopener noreferrer"&gt;https://github.com/reflex-dev/reflex-examples/tree/main/local_auth&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Outline
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a new folder, open it with a code editor&lt;/li&gt;
&lt;li&gt;Create a virtual environment and activate&lt;/li&gt;
&lt;li&gt;Install requirements&lt;/li&gt;
&lt;li&gt;reflex setup&lt;/li&gt;
&lt;li&gt;local_auth.py&lt;/li&gt;
&lt;li&gt;auth_session.py&lt;/li&gt;
&lt;li&gt;base_state.py&lt;/li&gt;
&lt;li&gt;login.py&lt;/li&gt;
&lt;li&gt;registration.py&lt;/li&gt;
&lt;li&gt;user.py&lt;/li&gt;
&lt;li&gt;run app&lt;/li&gt;
&lt;li&gt;conclusion&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Create a new folder, open it with a code editor
&lt;/h2&gt;

&lt;p&gt;Create a new folder and name it &lt;code&gt;local_auth&lt;/code&gt; then open it with a code editor like VS Code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a virtual environment and activate
&lt;/h2&gt;

&lt;p&gt;Open the terminal. Use the following command to create a virtual environment &lt;code&gt;.venv&lt;/code&gt; and activate it:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m venv .venv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source .venv/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Install requirements
&lt;/h2&gt;

&lt;p&gt;We will install &lt;code&gt;reflex&lt;/code&gt; to build the app, &lt;code&gt;passlib&lt;/code&gt; to simplify the process of securely hashing and managing passwords, and &lt;code&gt;bcrypt&lt;/code&gt;- the specific hashing algorithm used to hash passwords securely.&lt;br&gt;
Run the following command in the terminal:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install reflex==0.2.9 passlib==1.7.4 bcrypt==4.0.1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  reflex setup
&lt;/h2&gt;

&lt;p&gt;Now, we need to create the project using reflex. Run the following command to initialize the template app in &lt;code&gt;local_auth&lt;/code&gt; directory.&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reflex init 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  local_auth.py
&lt;/h2&gt;

&lt;p&gt;We will build the homepage of the app. Go to the &lt;code&gt;local_auth&lt;/code&gt; subdirectory and open the &lt;code&gt;local_auth.py&lt;/code&gt; file. Add the following code to it:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"""Main app module to demo local authentication."""
import reflex as rx

from .base_state import State
from .login import require_login
from .registration import registration_page as registration_page


def index() -&amp;gt; rx.Component:
    """Render the index page.

    Returns:
        A reflex component.
    """
    return rx.fragment(
        rx.color_mode_button(rx.color_mode_icon(), float="right"),
        rx.vstack(
            rx.heading("Welcome to my homepage!", font_size="2em"),
            rx.link("Protected Page", href="/protected"),
            spacing="1.5em",
            padding_top="10%",
        ),
    )


@require_login
def protected() -&amp;gt; rx.Component:
    """Render a protected page.

    The `require_login` decorator will redirect to the login page if the user is
    not authenticated.

    Returns:
        A reflex component.
    """
    return rx.vstack(
        rx.heading(
            "Protected Page for ", State.authenticated_user.username, font_size="2em"
        ),
        rx.link("Home", href="/"),
        rx.link("Logout", href="/", on_click=State.do_logout),
    )


app = rx.App()
app.add_page(index)
app.add_page(protected)
app.compile()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;index()&lt;/code&gt;: This function defines the behavior for rendering the application's index page. It returns a Reflex component, representing part of the web page's user interface. The index page includes a color mode button, a greeting message, a link to the protected page, and styling for spacing and padding.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;protected()&lt;/code&gt;: This function is responsible for rendering a protected page that requires user authentication to access. It is decorated with &lt;code&gt;@require_login&lt;/code&gt;, ensuring that only authenticated users can view this page. The protected page displays a greeting message personalized for the authenticated user, links to the home page, and provides an option to log out.&lt;br&gt;
&lt;strong&gt;The above code renders the following page&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwzw87cp1u23u3yvsko0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdwzw87cp1u23u3yvsko0.png" alt="localauthhomepage"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  auth_session.py
&lt;/h2&gt;

&lt;p&gt;Create a new file &lt;code&gt;auth_session.py&lt;/code&gt; in the &lt;code&gt;local_auth&lt;/code&gt; subdirectory and add the following code.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import datetime

from sqlmodel import Column, DateTime, Field, func

import reflex as rx


class AuthSession(
    rx.Model,
    table=True,  # type: ignore
):
    """Correlate a session_id with an arbitrary user_id."""

    user_id: int = Field(index=True, nullable=False)
    session_id: str = Field(unique=True, index=True, nullable=False)
    expiration: datetime.datetime = Field(
        sa_column=Column(DateTime(timezone=True), server_default=func.now()),
        nullable=False,
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In this code, an &lt;code&gt;AuthSession&lt;/code&gt; class is defined. The purpose of this class is to manage authentication sessions.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;user_id&lt;/code&gt; attribute is defined as an integer field, marked as indexed, and non-nullable. It is intended to store the user ID associated with a session.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;session_id&lt;/code&gt; attribute is a string field, marked as unique, indexed, and non-nullable. This field ensures that each session has a distinct identifier.&lt;/p&gt;

&lt;p&gt;The expiration attribute is of type datetime.datetime. It is defined using the Field class, associated with a SQL model column represented by a Column instance with a datetime type and timezone set to True. The server_default parameter is set to func.now(), which means the default value will be the current time when a new session is created. This field is also non-nullable, ensuring that each session has an expiration time.&lt;/p&gt;

&lt;h2&gt;
  
  
  base_state.py
&lt;/h2&gt;

&lt;p&gt;Create a new file &lt;code&gt;base_state.py&lt;/code&gt; in the &lt;code&gt;local_auth&lt;/code&gt; subdirectory and add the following code:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import datetime

from sqlmodel import select

import reflex as rx

from .auth_session import AuthSession
from .user import User


AUTH_TOKEN_LOCAL_STORAGE_KEY = "_auth_tokens"
DEFAULT_AUTH_SESSION_EXPIRATION_DELTA = datetime.timedelta(days=7)


class State(rx.State):
    # The auth_token is stored in local storage to persist across tab and browser sessions.
    auth_token: str = rx.LocalStorage(name=AUTH_TOKEN_LOCAL_STORAGE_KEY)

    @rx.cached_var
    def authenticated_user(self) -&amp;gt; User:
        """The currently authenticated user, or a dummy user if not authenticated.

        Returns:
            A User instance with id=-1 if not authenticated, or the User instance
            corresponding to the currently authenticated user.
        """
        with rx.session() as session:
            result = session.exec(
                select(User, AuthSession).where(
                    AuthSession.session_id == self.auth_token,
                    AuthSession.expiration
                    &amp;gt;= datetime.datetime.now(datetime.timezone.utc),
                    User.id == AuthSession.user_id,
                ),
            ).first()
            if result:
                user, session = result
                return user
        return User(id=-1)  # type: ignore

    @rx.cached_var
    def is_authenticated(self) -&amp;gt; bool:
        """Whether the current user is authenticated.

        Returns:
            True if the authenticated user has a positive user ID, False otherwise.
        """
        return self.authenticated_user.id &amp;gt;= 0

    def do_logout(self) -&amp;gt; None:
        """Destroy AuthSessions associated with the auth_token."""
        with rx.session() as session:
            for auth_session in session.exec(
                AuthSession.select.where(AuthSession.session_id == self.auth_token)
            ).all():
                session.delete(auth_session)
            session.commit()
        self.auth_token = self.auth_token

    def _login(
        self,
        user_id: int,
        expiration_delta: datetime.timedelta = DEFAULT_AUTH_SESSION_EXPIRATION_DELTA,
    ) -&amp;gt; None:
        """Create an AuthSession for the given user_id.

        If the auth_token is already associated with an AuthSession, it will be
        logged out first.

        Args:
            user_id: The user ID to associate with the AuthSession.
            expiration_delta: The amount of time before the AuthSession expires.
        """
        if self.is_authenticated:
            self.do_logout()
        if user_id &amp;lt; 0:
            return
        self.auth_token = self.auth_token or self.get_token()
        with rx.session() as session:
            session.add(
                AuthSession(  # type: ignore
                    user_id=user_id,
                    session_id=self.auth_token,
                    expiration=datetime.datetime.now(datetime.timezone.utc)
                    + expiration_delta,
                )
            )
            session.commit()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above code defines a class called &lt;code&gt;State&lt;/code&gt;, which extends the &lt;code&gt;rx.State&lt;/code&gt; class. It includes several functions and properties related to authentication and user sessions.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;auth_token&lt;/code&gt;: This property stores the authentication token in the local storage to persist it across different browser sessions.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;authenticated_user(self)&lt;/code&gt;: This function returns the currently authenticated user or a dummy user if not authenticated. It uses the &lt;code&gt;rx.session()&lt;/code&gt; context manager to execute a SQL query that selects a User and AuthSession where the AuthSession matches the auth_token, has not expired, and corresponds to a user. If a result is found, it returns the user; otherwise, it returns a dummy user.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;is_authenticated(self)&lt;/code&gt;: This function returns a boolean indicating whether the current user is authenticated. It checks if the user's ID is greater than or equal to 0, and returns True if authenticated or False if not.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;do_logout(self)&lt;/code&gt;: This function is used to destroy AuthSessions associated with the auth_token. It begins a session and deletes all AuthSessions with a matching session_id, effectively logging the user out.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;_login(self, user_id, expiration_delta)&lt;/code&gt;: This is a private method used to create an AuthSession for a given user. If the user is already authenticated, it calls do_logout() to log out the current user. It then creates a new AuthSession with the provided user ID and sets an expiration time based on the expiration_delta (defaulting to 7 days). This new session is associated with the auth_token, which is generated if it doesn't exist. The new AuthSession is added to the database and committed within a session context.&lt;/p&gt;

&lt;h2&gt;
  
  
  login.py
&lt;/h2&gt;

&lt;p&gt;Create a new file &lt;code&gt;login.py&lt;/code&gt; in the &lt;code&gt;local_auth&lt;/code&gt; subdirectory and add the following code:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"""Login page and authentication logic."""
import reflex as rx

from .base_state import State
from .user import User


LOGIN_ROUTE = "/login"
REGISTER_ROUTE = "/register"


class LoginState(State):
    """Handle login form submission and redirect to proper routes after authentication."""

    error_message: str = ""
    redirect_to: str = ""

    def on_submit(self, form_data) -&amp;gt; rx.event.EventSpec:
        """Handle login form on_submit.

        Args:
            form_data: A dict of form fields and values.
        """
        self.error_message = ""
        username = form_data["username"]
        password = form_data["password"]
        with rx.session() as session:
            user = session.exec(
                User.select.where(User.username == username)
            ).one_or_none()
        if user is not None and not user.enabled:
            self.error_message = "This account is disabled."
            return rx.set_value("password", "")
        if user is None or not user.verify(password):
            self.error_message = "There was a problem logging in, please try again."
            return rx.set_value("password", "")
        if (
            user is not None
            and user.id is not None
            and user.enabled
            and user.verify(password)
        ):
            # mark the user as logged in
            self._login(user.id)
        self.error_message = ""
        return LoginState.redir()  # type: ignore

    def redir(self) -&amp;gt; rx.event.EventSpec | None:
        """Redirect to the redirect_to route if logged in, or to the login page if not."""
        if not self.is_hydrated:
            # wait until after hydration to ensure auth_token is known
            return LoginState.redir()  # type: ignore
        page = self.get_current_page()
        if not self.is_authenticated and page != LOGIN_ROUTE:
            self.redirect_to = page
            return rx.redirect(LOGIN_ROUTE)
        elif page == LOGIN_ROUTE:
            return rx.redirect(self.redirect_to or "/")


@rx.page(route=LOGIN_ROUTE)
def login_page() -&amp;gt; rx.Component:
    """Render the login page.

    Returns:
        A reflex component.
    """
    login_form = rx.form(
        rx.input(placeholder="username", id="username"),
        rx.password(placeholder="password", id="password"),
        rx.button("Login", type_="submit"),
        width="80vw",
        on_submit=LoginState.on_submit,
    )

    return rx.fragment(
        rx.cond(
            LoginState.is_hydrated,  # type: ignore
            rx.vstack(
                rx.cond(  # conditionally show error messages
                    LoginState.error_message != "",
                    rx.text(LoginState.error_message),
                ),
                login_form,
                rx.link("Register", href=REGISTER_ROUTE),
                padding_top="10vh",
            ),
        )
    )


def require_login(page: rx.app.ComponentCallable) -&amp;gt; rx.app.ComponentCallable:
    """Decorator to require authentication before rendering a page.

    If the user is not authenticated, then redirect to the login page.

    Args:
        page: The page to wrap.

    Returns:
        The wrapped page component.
    """

    def protected_page():
        return rx.fragment(
            rx.cond(
                State.is_hydrated &amp;amp; State.is_authenticated,  # type: ignore
                page(),
                rx.center(
                    # When this spinner mounts, it will redirect to the login page
                    rx.spinner(on_mount=LoginState.redir),
                ),
            )
        )

    protected_page.__name__ = page.__name__
    return protected_page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above code defines a login page and authentication logic. It includes a &lt;code&gt;LoginState&lt;/code&gt; class that handles login form submissions, checks user credentials, and manages redirection upon successful login. Additionally, it provides a decorator function called &lt;code&gt;require_login&lt;/code&gt; to protect certain pages, ensuring they can only be accessed by authenticated users and redirecting unauthenticated users to the login page.&lt;br&gt;
&lt;strong&gt;The above code renders the following page&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnj7258735am2s531txzv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnj7258735am2s531txzv.png" alt="localauthlogin"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  registration.py
&lt;/h2&gt;

&lt;p&gt;Create a new file &lt;code&gt;registration.py&lt;/code&gt; in the &lt;code&gt;local_auth&lt;/code&gt; subdirectory and add the following code:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;"""New user registration form and validation logic."""
from __future__ import annotations

import asyncio
from collections.abc import AsyncGenerator

import reflex as rx

from .base_state import State
from .login import LOGIN_ROUTE, REGISTER_ROUTE
from .user import User


class RegistrationState(State):
    """Handle registration form submission and redirect to login page after registration."""

    success: bool = False
    error_message: str = ""

    async def handle_registration(
        self, form_data
    ) -&amp;gt; AsyncGenerator[rx.event.EventSpec | list[rx.event.EventSpec] | None, None]:
        """Handle registration form on_submit.

        Set error_message appropriately based on validation results.

        Args:
            form_data: A dict of form fields and values.
        """
        with rx.session() as session:
            username = form_data["username"]
            if not username:
                self.error_message = "Username cannot be empty"
                yield rx.set_focus("username")
                return
            existing_user = session.exec(
                User.select.where(User.username == username)
            ).one_or_none()
            if existing_user is not None:
                self.error_message = (
                    f"Username {username} is already registered. Try a different name"
                )
                yield [rx.set_value("username", ""), rx.set_focus("username")]
                return
            password = form_data["password"]
            if not password:
                self.error_message = "Password cannot be empty"
                yield rx.set_focus("password")
                return
            if password != form_data["confirm_password"]:
                self.error_message = "Passwords do not match"
                yield [
                    rx.set_value("confirm_password", ""),
                    rx.set_focus("confirm_password"),
                ]
                return
            # Create the new user and add it to the database.
            new_user = User()  # type: ignore
            new_user.username = username
            new_user.password_hash = User.hash_password(password)
            new_user.enabled = True
            session.add(new_user)
            session.commit()
        # Set success and redirect to login page after a brief delay.
        self.error_message = ""
        self.success = True
        yield
        await asyncio.sleep(0.5)
        yield [rx.redirect(LOGIN_ROUTE), RegistrationState.set_success(False)]


@rx.page(route=REGISTER_ROUTE)
def registration_page() -&amp;gt; rx.Component:
    """Render the registration page.

    Returns:
        A reflex component.
    """
    register_form = rx.form(
        rx.input(placeholder="username", id="username"),
        rx.password(placeholder="password", id="password"),
        rx.password(placeholder="confirm", id="confirm_password"),
        rx.button("Register", type_="submit"),
        width="80vw",
        on_submit=RegistrationState.handle_registration,
    )
    return rx.fragment(
        rx.cond(
            RegistrationState.success,
            rx.vstack(
                rx.text("Registration successful!"),
                rx.spinner(),
            ),
            rx.vstack(
                rx.cond(  # conditionally show error messages
                    RegistrationState.error_message != "",
                    rx.text(RegistrationState.error_message),
                ),
                register_form,
                padding_top="10vh",
            ),
        )
    )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above code is responsible for creating a user registration form and implementing the validation logic for user registration.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;RegistrationState&lt;/code&gt; class handles user registration. It includes properties for tracking the success of the registration and error messages.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;handle_registration&lt;/code&gt; method asynchronously processes the registration form submission. It validates the provided username and password, checks for existing usernames in the database, ensures the passwords match, and then creates a new user and adds it to the database if all checks pass. After a brief delay, it sets the success flag and redirects to the login page.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;registration_page&lt;/code&gt; function is a reflex page that renders the user registration form. It includes form fields for the username, password, and password confirmation, as well as a registration button. The form submission is handled by the &lt;code&gt;handle_registration&lt;/code&gt; method from &lt;code&gt;RegistrationState&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The page dynamically displays different content based on the registration's success or failure. If registration is successful, it displays a success message and a spinner. If there are validation errors or the registration has not yet succeeded, it shows error messages, the registration form, and adds some padding for spacing.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The above code renders the following page&lt;/strong&gt;:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcufbg5vfjbrexky5oyfw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcufbg5vfjbrexky5oyfw.png" alt="localauthregister"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  user.py
&lt;/h2&gt;

&lt;p&gt;Create a new file &lt;code&gt;user.py&lt;/code&gt; in the &lt;code&gt;local_auth&lt;/code&gt; subdirectory and add the following code:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from passlib.context import CryptContext
from sqlmodel import Field

import reflex as rx

pwd_context = CryptContext(schemes=["bcrypt"], deprecated="auto")


class User(
    rx.Model,
    table=True,  # type: ignore
):
    """A local User model with bcrypt password hashing."""

    username: str = Field(unique=True, nullable=False, index=True)
    password_hash: str = Field(nullable=False)
    enabled: bool = False

    @staticmethod
    def hash_password(secret: str) -&amp;gt; str:
        """Hash the secret using bcrypt.

        Args:
            secret: The password to hash.

        Returns:
            The hashed password.
        """
        return pwd_context.hash(secret)

    def verify(self, secret: str) -&amp;gt; bool:
        """Validate the user's password.

        Args:
            secret: The password to check.

        Returns:
            True if the hashed secret matches this user's password_hash.
        """
        return pwd_context.verify(
            secret,
            self.password_hash,
        )
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The above code defines a User class for managing user data. It uses the bcrypt algorithm for securely hashing and verifying user passwords. The User class has fields for usernames, password hashes, and an "enabled" status, along with methods for hashing and verifying passwords using bcrypt. This code provides a foundation for securely handling user authentication and password storage in the application.&lt;/p&gt;

&lt;h2&gt;
  
  
  run app
&lt;/h2&gt;

&lt;p&gt;Run the following commands in the terminal to initialize alembic and create a migration script with the current schema, to generate a script in the alembic/versions directory that will update the database schema and apply migration scripts to bring the database up to date respectively:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reflex db init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reflex db makemigrations --message 'something changed'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reflex db migrate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;to start the app run the following:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reflex run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;You should see an interface as follows when you go to &lt;a href="http://localhost:3000/" rel="noopener noreferrer"&gt;http://localhost:3000/&lt;/a&gt; &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fffq2ve3hyzshqhm8go8y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fffq2ve3hyzshqhm8go8y.png" alt="authhomepage"&gt;&lt;/a&gt;&lt;br&gt;
When you click on the protected page link, it takes you to the login page. From there, you can either log in or register. If login is successful then you will be able to access the protected page and from there you can logout.&lt;/p&gt;

&lt;h2&gt;
  
  
  conclusion
&lt;/h2&gt;

&lt;p&gt;You can access the code from reflex local_auth example repo: &lt;a href="https://github.com/reflex-dev/reflex-examples/tree/main/local_auth" rel="noopener noreferrer"&gt;https://github.com/reflex-dev/reflex-examples/tree/main/local_auth&lt;/a&gt;&lt;/p&gt;

</description>
      <category>reflex</category>
      <category>webdev</category>
      <category>tutorial</category>
      <category>auth</category>
    </item>
  </channel>
</rss>
