<?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: Edwin Kys</title>
    <description>The latest articles on Forem by Edwin Kys (@edwinkys).</description>
    <link>https://forem.com/edwinkys</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%2F1276498%2F5bd87a2d-dcd8-4a32-8e1b-47b33bd0b583.png</url>
      <title>Forem: Edwin Kys</title>
      <link>https://forem.com/edwinkys</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/edwinkys"/>
    <language>en</language>
    <item>
      <title>How to Build Tools For AI Agents With Human in The Loop in Python</title>
      <dc:creator>Edwin Kys</dc:creator>
      <pubDate>Thu, 14 Nov 2024 18:11:49 +0000</pubDate>
      <link>https://forem.com/edwinkys/how-to-build-tools-for-ai-agents-with-human-in-the-loop-in-python-259j</link>
      <guid>https://forem.com/edwinkys/how-to-build-tools-for-ai-agents-with-human-in-the-loop-in-python-259j</guid>
      <description>&lt;p&gt;With LangChain, you can equip your LLM agent with tools to expand its capability way beyond a simple conversational interaction. For example, you can create an LLM agent that can automatically reply to emails you receive or an agent that can write and publish a blog post on your behalf on a certain trendy subject. The potential is quite limitless.&lt;/p&gt;

&lt;h2&gt;
  
  
  What are tools?
&lt;/h2&gt;

&lt;p&gt;In the context of LLM agents, tools are functions or methods that you define in your source code, giving the agent the ability to perform specific tasks or access external resources. These tools extend the language model, allowing it to go beyond generating text in response to a prompt. Instead, it can interact with various functions, APIs, or databases as part of its workflow.&lt;/p&gt;

&lt;p&gt;For example, tools might include functions for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Data Retrieval&lt;/strong&gt;: Accessing information from a database or a web API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Calculations&lt;/strong&gt;: Performing computations beyond the model's capabilities.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content Generation&lt;/strong&gt;: Generating or posting content, such as drafting blog posts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Task Automation&lt;/strong&gt;: Triggering actions like sending emails or updating records.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What does it look like in code?
&lt;/h2&gt;

&lt;p&gt;As of LangChain version 0.3, defining tools in Python is straightforward. Tools are typically just standard Python functions that you decorate with &lt;code&gt;@tool&lt;/code&gt; to make them accessible to your language model agent. This allows the agent to "call" these functions as part of its decision-making process.&lt;/p&gt;

&lt;p&gt;Here’s a basic example illustrating how to create tools in LangChain. The actual functionality within each tool function is left out for simplicity.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_core.tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt;

&lt;span class="nd"&gt;@tool&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;publish_blog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;topic&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Write and publish a blog post based on the topic.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# Add code to draft and publish the blog post.
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A blog post (&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;topic&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;) is published.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="nd"&gt;@tool&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;send_email&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="sh"&gt;"""&lt;/span&gt;&lt;span class="s"&gt;Sends an email with to the specified recipient.&lt;/span&gt;&lt;span class="sh"&gt;"""&lt;/span&gt;
    &lt;span class="c1"&gt;# Add code to send an email using an email API.
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;An email is sent to &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Once we have our tools defined, we can bind them to our language model. The binding process typically involves specifying which functions are accessible to the model and defining the input and output formats, so the language model can correctly interact with each tool. The code below shows an example of how to bind tools to your language model.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ChatOpenAI&lt;/span&gt;

&lt;span class="c1"&gt;# Replace this with your OpenAI API Key.
&lt;/span&gt;&lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;xxx&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;llm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;ChatOpenAI&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;gpt-4o-mini&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&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="n"&gt;publish_blog&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;send_email&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;span class="n"&gt;llm_with_tools&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;bind_tools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The last step is to allow LangChain to &lt;em&gt;call&lt;/em&gt; these tools using the output generated by the language model. In practice, this often requires output validation to ensure specific parameters for each tool and parsing the relevant information, such as data inputs. But with LangChain, we can use its chain functionality to simplify this process.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_core.messages&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AIMessage&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call_tools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AIMessage&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;tool_map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tool_call&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tool_call&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tool_call&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;args&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
        &lt;span class="n"&gt;tool_map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;chain&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;llm_with_tools&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;call_tools&lt;/span&gt;
&lt;span class="n"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Remind elon@x.com about the Monday meeting at 9AM&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;When we execute this code, our language model will first assess the available tools it can use to accomplish the task. It will then generate a message on the required operation with its parameters and pass it to the tool caller function. This function interprets the message, identifying which tool to activate based on the LLM’s output.&lt;/p&gt;
&lt;h2&gt;
  
  
  Adding human approval layer
&lt;/h2&gt;

&lt;p&gt;Certain tools we provided to our LLM, such as publishing a blog post or sending an email, carry significant risks. To mitigate these risks, we can integrate a human approval layer into our chain. Instead of executing these high-stakes tools immediately upon request, our agent will wait for human approval. This extra step ensures that any critical action is carefully reviewed, allowing us to maintain control and safety over our agent's actions.&lt;/p&gt;

&lt;p&gt;In this article, we’ll be using &lt;a href="https://github.com/phantasmlabs/phantasm" rel="noopener noreferrer"&gt;Phantasm&lt;/a&gt;, an open-source platform designed for human-in-the-loop workflows for AI agents. To get started with Phantasm, we’ll be using its Docker images and Python SDK. The Docker images allow us to quickly set up its components, while the Python SDK allows us to integrate Phantasm in our AI agent's source code.&lt;/p&gt;
&lt;h3&gt;
  
  
  Running Phantasm
&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;# Pull the server and the dashboard images.&lt;/span&gt;
docker pull ghcr.io/phantasmlabs/phantasm/dashboard:latest
docker pull ghcr.io/phantasmlabs/phantasm/server:latest

&lt;span class="c"&gt;# Run the server and the dashboard.&lt;/span&gt;
docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 2515:2515 ghcr.io/phantasmlabs/phantasm/dashboard:latest
docker run &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; 2505:2505 &lt;span class="nt"&gt;-p&lt;/span&gt; 2510:2510 ghcr.io/phantasmlabs/phantasm/server:latest start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;These commands will pull the necessary Docker images and launch both the server and dashboard in the background. To start receiving approval requests from our AI agent, we must first establish a connection with the coordinator server.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open &lt;a href="http://localhost:2515" rel="noopener noreferrer"&gt;http://localhost:2515&lt;/a&gt; on your browser.&lt;/li&gt;
&lt;li&gt;Click on the &lt;strong&gt;Add Connection&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;localhost:2510&lt;/strong&gt; as the connection address.&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;
  
  
  Integrating Phantasm's Python SDK
&lt;/h3&gt;

&lt;p&gt;Now that the setup is complete, the final step is to integrate our agent with Phantasm via its Python SDK. This requires installing the SDK on our local machine.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;phantasmpy
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;With the SDK installed, our next step is to initialize it and integrate the human approval workflow logic into our tool-caller function. This involves setting up a checkpoint, so the tool can wait for human approval before invoking the tools.&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain_core.messages&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;AIMessage&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;phantasmpy&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Phantasm&lt;/span&gt;

&lt;span class="n"&gt;phantasm&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Phantasm&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;call_tools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;AIMessage&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;tool_map&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;tool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tool&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;tools&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;tool_call&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tool_calls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tool_call&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;name&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="n"&gt;tool_call&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;args&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

        &lt;span class="c1"&gt;# Added the human approval logic below.
&lt;/span&gt;        &lt;span class="n"&gt;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;phantasm&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get_approval&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="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;approved&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;tool_map&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;invoke&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;parameters&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Rejected when calling tool: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;When we run the updated code, we should see an approval request from our agent appear in the dashboard. Phantasm will relay the parameters from the AI agent, allowing us to review and modify them as needed. Once approved, our agent will invoke the tool with the parameters specified by the approvers, significantly enhancing the accuracy and effectiveness of each tool call.&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%2F0g8ehl8mato3spqueg5a.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%2F0g8ehl8mato3spqueg5a.png" alt="Dashboard Preview" width="800" height="555"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Equipping our AI agent with tools enables it to deliver greater impact and value to our users. However, some tools carry inherent risks, which is why human oversight is essential. I developed Phantasm to provide teams with the ability to monitor and manage their AI agents in real time to ensure high performance in production environments.&lt;/p&gt;

&lt;p&gt;If you found this article valuable, consider supporting Phantasm to help enhance safe and effective AI deployment. Your support means a lot to an open-source developer like me 😁&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/phantasmlabs" rel="noopener noreferrer"&gt;
        phantasmlabs
      &lt;/a&gt; / &lt;a href="https://github.com/phantasmlabs/phantasm" rel="noopener noreferrer"&gt;
        phantasm
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Toolkits to create a human-in-the-loop approval layer to monitor and guide AI agents workflow in real-time.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://github.com/phantasmlabs/phantasm" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/6d6134d4fb3b27071474e0cd4a8f76e46c88d5befec53b552daa97f09f05bf9e/68747470733a2f2f74696e7975726c2e636f6d2f35786574737a6665" alt="GitHub"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/dgevsYhh7P" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5887cfc1f71defa1cdab70e620b897b829994187c00165d2417cdae2db8eb582/68747470733a2f2f74696e7975726c2e636f6d2f3566763833753268" alt="Discord"&gt;&lt;/a&gt;
&lt;a href="https://github.com/phantasmlabs/phantasm/blob/main/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/34b5f6da13803f9650f40fbf608874ee3d46a6859c75ee940cfc2660a336f095/68747470733a2f2f74696e7975726c2e636f6d2f6d72786e3866767a" alt="License"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/190a8a69e02694bdf27c3e2a99fb3277cfd1d9b88c928b5a175db8d545bd686a/68747470733a2f2f7068616e7461736d2d6173736574732e73332e616d617a6f6e6177732e636f6d2f62616e6e6572732f302e312e302e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/190a8a69e02694bdf27c3e2a99fb3277cfd1d9b88c928b5a175db8d545bd686a/68747470733a2f2f7068616e7461736d2d6173736574732e73332e616d617a6f6e6177732e636f6d2f62616e6e6572732f302e312e302e706e67" alt="Phantasm"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Phantasm offers open-source toolkits that allows you to create human-in-the-loop
(HITL) workflows for modern AI agents. Phantasm comes with 3 main components
that work together to create a seamless HITL experience:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt;: Coordinating the HITL workflows between humans and AI agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dashboard&lt;/strong&gt;: For the human team to monitor and manage the workflows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client&lt;/strong&gt;: A library to integrate the workflows into your AI agents.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;

&lt;ul&gt;
&lt;li&gt;✅ Fully open-source and free to use&lt;/li&gt;
&lt;li&gt;✅ Works out of the box with any AI framework or model&lt;/li&gt;
&lt;li&gt;✅ Load balancer to distribute the requests to multiple approvers (Beta)&lt;/li&gt;
&lt;li&gt;✅ Web-based dashboard to manage the approval workflows&lt;/li&gt;
&lt;li&gt;✅ Easy-to-use client libraries for popular programming languages&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How It Works&lt;/h2&gt;
&lt;/div&gt;

&lt;p&gt;Phantasm allows you to have an approval layer on top of your AI agents. This
means, you're free to use any AI framework or model you see fit. By using
Phantasm, you can delay…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/phantasmlabs/phantasm" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>tutorial</category>
      <category>ai</category>
      <category>programming</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Phantasm: A Human Approval Layer For AI Agents</title>
      <dc:creator>Edwin Kys</dc:creator>
      <pubDate>Thu, 31 Oct 2024 16:20:05 +0000</pubDate>
      <link>https://forem.com/edwinkys/phantasm-a-human-approval-layer-for-ai-agents-491k</link>
      <guid>https://forem.com/edwinkys/phantasm-a-human-approval-layer-for-ai-agents-491k</guid>
      <description>&lt;p&gt;Building impactful AI agents requires enabling them to execute business-critical actions. For example, let's take a look at the e-commerce space, where a user might want to cancel an order. An AI agent or chatbot that simply explains how to cancel an order is helpful, but one that can actually cancel an order on behalf of the user is far more impactful.&lt;/p&gt;

&lt;p&gt;By nature, these actions are risky, especially when performed by an AI agent. That's why we are building &lt;a href="https://github.com/phantasmlabs/phantasm" rel="noopener noreferrer"&gt;Phantasm&lt;/a&gt;. Phantasm allows you to build an impactful AI agent safely by providing an approval layer that a human team can use to monitor and manage the workflow of an AI agent.&lt;/p&gt;

&lt;p&gt;With Phantasm, your AI agent workflow will look somewhat like this:&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%2Fozk4wgg5nr65oyi559r9.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%2Fozk4wgg5nr65oyi559r9.png" alt="Workflow" width="800" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Your AI agent needs to call a function based on an LLM response.&lt;/li&gt;
&lt;li&gt;An approval request is sent to the approver.&lt;/li&gt;
&lt;li&gt;If an approver approves the request, the function will be executed.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Try Phantasm Today!
&lt;/h2&gt;

&lt;p&gt;If you're building an AI agent and you want to make sure that it can be deployed safely in the real world, please feel free to give it a shot! Phantasm works out of the box and doesn't require you to create an account or any API key.&lt;/p&gt;

&lt;p&gt;If you’re interested in our journey and goal, please support us by giving us a star and sharing it within your network. Every bit of support counts!&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/phantasmlabs" rel="noopener noreferrer"&gt;
        phantasmlabs
      &lt;/a&gt; / &lt;a href="https://github.com/phantasmlabs/phantasm" rel="noopener noreferrer"&gt;
        phantasm
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Toolkits to create a human-in-the-loop approval layer to monitor and guide AI agents workflow in real-time.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a href="https://github.com/phantasmlabs/phantasm" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/6d6134d4fb3b27071474e0cd4a8f76e46c88d5befec53b552daa97f09f05bf9e/68747470733a2f2f74696e7975726c2e636f6d2f35786574737a6665" alt="GitHub"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/dgevsYhh7P" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/5887cfc1f71defa1cdab70e620b897b829994187c00165d2417cdae2db8eb582/68747470733a2f2f74696e7975726c2e636f6d2f3566763833753268" alt="Discord"&gt;&lt;/a&gt;
&lt;a href="https://github.com/phantasmlabs/phantasm/blob/main/LICENSE" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/34b5f6da13803f9650f40fbf608874ee3d46a6859c75ee940cfc2660a336f095/68747470733a2f2f74696e7975726c2e636f6d2f6d72786e3866767a" alt="License"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/190a8a69e02694bdf27c3e2a99fb3277cfd1d9b88c928b5a175db8d545bd686a/68747470733a2f2f7068616e7461736d2d6173736574732e73332e616d617a6f6e6177732e636f6d2f62616e6e6572732f302e312e302e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/190a8a69e02694bdf27c3e2a99fb3277cfd1d9b88c928b5a175db8d545bd686a/68747470733a2f2f7068616e7461736d2d6173736574732e73332e616d617a6f6e6177732e636f6d2f62616e6e6572732f302e312e302e706e67" alt="Phantasm"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Phantasm offers open-source toolkits that allows you to create human-in-the-loop
(HITL) workflows for modern AI agents. Phantasm comes with 3 main components
that work together to create a seamless HITL experience:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Server&lt;/strong&gt;: Coordinating the HITL workflows between humans and AI agents.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Dashboard&lt;/strong&gt;: For the human team to monitor and manage the workflows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Client&lt;/strong&gt;: A library to integrate the workflows into your AI agents.&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Features&lt;/h2&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;✅ Fully open-source and free to use&lt;/li&gt;
&lt;li&gt;✅ Works out of the box with any AI framework or model&lt;/li&gt;
&lt;li&gt;✅ Load balancer to distribute the requests to multiple approvers (Beta)&lt;/li&gt;
&lt;li&gt;✅ Web-based dashboard to manage the approval workflows&lt;/li&gt;
&lt;li&gt;✅ Easy-to-use client libraries for popular programming languages&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How It Works&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;Phantasm allows you to have an approval layer on top of your AI agents. This
means, you're free to use any AI framework or model you see fit. By using
Phantasm, you can delay…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/phantasmlabs/phantasm" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>machinelearning</category>
      <category>opensource</category>
      <category>news</category>
      <category>tooling</category>
    </item>
    <item>
      <title>5 Things You Need to Know About RAG with Examples</title>
      <dc:creator>Edwin Kys</dc:creator>
      <pubDate>Thu, 27 Jun 2024 19:28:10 +0000</pubDate>
      <link>https://forem.com/edwinkys/5-terms-to-get-yourself-familiar-with-rag-3cep</link>
      <guid>https://forem.com/edwinkys/5-terms-to-get-yourself-familiar-with-rag-3cep</guid>
      <description>&lt;p&gt;If you're new to RAG, vector search, and related concepts, this article will guide you through the key terms and principles used in modern LLM-based applications.&lt;/p&gt;

&lt;p&gt;This article attempts to provide a very high-level overview of the key concepts and terms used in the LLM ecosystem with an easy to relate explanation. For a more in-depth understanding, I recommend reading other dedicated resources.&lt;/p&gt;

&lt;p&gt;With that said, let's get started!&lt;/p&gt;

&lt;h2&gt;
  
  
  Embedding
&lt;/h2&gt;

&lt;p&gt;Embedding is a way to represent unstructured data as numbers to capture the semantic meaning of the data. In the context of LLMs, embeddings are used to represent words, sentences, or documents.&lt;/p&gt;

&lt;p&gt;Let's say we have a couple of words that we want to represent as numbers. For simplicity, we will only consider 2 aspects of the words: edibility and affordability.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Word&lt;/th&gt;
&lt;th&gt;Edibility&lt;/th&gt;
&lt;th&gt;Affordability&lt;/th&gt;
&lt;th&gt;Label&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Apple&lt;/td&gt;
&lt;td&gt;0.9&lt;/td&gt;
&lt;td&gt;0.8&lt;/td&gt;
&lt;td&gt;Fruit&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Apple&lt;/td&gt;
&lt;td&gt;0.0&lt;/td&gt;
&lt;td&gt;0.0&lt;/td&gt;
&lt;td&gt;Tech Company&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Banana&lt;/td&gt;
&lt;td&gt;0.8&lt;/td&gt;
&lt;td&gt;0.8&lt;/td&gt;
&lt;td&gt;?&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In the table above, we can roughly deduce that the first apple is a fruit, while the second apple refers to a tech company. If we were to deduce if the banana here is a fruit or a tech company we never heard about, we could roughly say that it's a fruit since it has similar edibility and affordability values as the first apple.&lt;/p&gt;

&lt;p&gt;In practice, embeddings are much more complex and have many more dimensions, often capturing various semantic properties beyond simple attributes like edibility and affordability. For instance, embeddings in models like Word2Vec, GloVe, BERT, or GPT-3 can have hundreds or thousands of dimensions. These embeddings are learned by neural networks and are used in numerous applications, such as search engines, recommendation systems, sentiment analysis, and machine&lt;br&gt;
translation.&lt;/p&gt;

&lt;p&gt;Moreover, modern LLMs use contextual embeddings, meaning the representation of a word depends on the context in which it appears. This allows the model to distinguish between different meanings of the same word based on its usage in a sentence.&lt;/p&gt;

&lt;p&gt;Note that embedding and vector are often used interchangeably in the context of LLMs.&lt;/p&gt;
&lt;h2&gt;
  
  
  Indexing
&lt;/h2&gt;

&lt;p&gt;Indexing is the process of organizing and storing data to optimize search and retrieval efficiency. In the context of RAG and vector search, indexing organizes data based on their embeddings.&lt;/p&gt;

&lt;p&gt;Let's consider 4 data points below with their respective embeddings representing features: alive and edible.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;ID&lt;/th&gt;
&lt;th&gt;Embedding&lt;/th&gt;
&lt;th&gt;Data&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;1&lt;/td&gt;
&lt;td&gt;[0.0, 0.8]&lt;/td&gt;
&lt;td&gt;Apple&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2&lt;/td&gt;
&lt;td&gt;[0.0, 0.7]&lt;/td&gt;
&lt;td&gt;Banana&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;3&lt;/td&gt;
&lt;td&gt;[1.0, 0.4]&lt;/td&gt;
&lt;td&gt;Dog&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;4&lt;/td&gt;
&lt;td&gt;[0.0, 0.0]&lt;/td&gt;
&lt;td&gt;BMW&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;To illustrate simple indexing, let's use a simplified version of the NSW (Navigable Small World) algorithm. This algorithm establishes links between data points based on the distances between their embeddings:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# ID -&amp;gt; Closest IDs
&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;
&lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  ANNS
&lt;/h3&gt;

&lt;p&gt;ANNS is a technique for efficiently finding the nearest data points to a given query, albeit approximately. While it may not always return the exact nearest data points, ANNS provides results that are close enough. This probabilistic approach balances accuracy with efficiency.&lt;/p&gt;

&lt;p&gt;Imagine we have a query with specific constraints:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Find the closest data to [0.0, 0.9].&lt;/li&gt;
&lt;li&gt;Calculate a maximum of 2 distances using the Euclidean distance formula.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's how we utilize the index created above to find the closest data point:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We start at a random data point, say 4, which is linked to 3 and 2.&lt;/li&gt;
&lt;li&gt;We calculate the distances and find that 2 is closer to [0.0, 0.9] than 3.&lt;/li&gt;
&lt;li&gt;We determine that the closest data to [0.0, 0.9] is Banana.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This method isn't perfect; in this case, the actual closest data point to [0.0, 0.9] is Apple. But, under these constraints, linear search would rely heavily on chance to find the nearest data point. Indexing mitigates this issue by efficiently narrowing down the search based on data embeddings.&lt;/p&gt;

&lt;p&gt;In real-world applications with millions of data points, linear search becomes impractical. Indexing, however, enables swift retrieval by structuring data intelligently according to their embeddings.&lt;/p&gt;

&lt;p&gt;Note that for managing billions of data points, sophisticated disk-based indexing algorithms may be necessary to ensure efficient data handling.&lt;/p&gt;
&lt;h2&gt;
  
  
  RAG
&lt;/h2&gt;

&lt;p&gt;RAG (Retrieval-Augmented Generation) is a framework that combines information retrieval and large language models (LLMs) to generate high-quality, contextually relevant responses to user queries. This approach enhances the capabilities of LLMs by incorporating relevant information retrieved from external sources into the model's input.&lt;/p&gt;

&lt;p&gt;In practice, RAG works by retrieving relevant information from a vector database, which allows efficient searching for the most relevant data based on the user query. This retrieved information is then inserted into the input context of the language model, providing it with additional knowledge to generate more accurate and informative responses.&lt;/p&gt;

&lt;p&gt;Below is an example of a prompt with and without RAG in a simple Q&amp;amp;A scenario:&lt;/p&gt;
&lt;h3&gt;
  
  
  Without RAG
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;What is the name of my dog?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;LLM: I don't know.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  With RAG
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Based on the context below:
I have a dog named Pluto.

Answer the following question: What is the name of my dog?
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;blockquote&gt;
&lt;p&gt;LLM: The name of your dog is Pluto.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By integrating retrieval with generation, RAG significantly improves the performance of LLMs in tasks that require specific, up-to-date, or external information, making it a powerful tool for various applications such as customer support, knowledge management, and content generation.&lt;/p&gt;
&lt;h2&gt;
  
  
  Token
&lt;/h2&gt;

&lt;p&gt;A token is a unit of text that AI models use to process and understand natural language. Tokens can be words, subwords, or characters, depending on the model's architecture. Tokenization is a crucial preprocessing step in natural language processing (NLP) and is essential for breaking down text into manageable pieces that the model can process.&lt;/p&gt;

&lt;p&gt;In this example, we'll use &lt;code&gt;WordPunctTokenizer&lt;/code&gt; from the NLTK library to tokenize the sentence: "OasysDB is awesome."&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;nltk.tokenize&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;WordPunctTokenizer&lt;/span&gt;

&lt;span class="n"&gt;tokenizer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;WordPunctTokenizer&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;span class="n"&gt;tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;tokenizer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;tokenize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OasysDB is awesome.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;OasysDB&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;is&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;awesome&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Tokenization plays a big role in LLMs and embedding models. Understanding tokenization can help in various aspects, such as optimizing model performance and managing costs.&lt;/p&gt;

&lt;p&gt;Since many AI service providers charge based on the number of tokens processed. So, you'll often encounter this term when working with LLMs and embedding models, especially when determining the pricing of using a specific model.&lt;/p&gt;
&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;These five concepts are crucial in understanding and implementing RAG effectively.&lt;/p&gt;

&lt;p&gt;Thank you for reading! If you have any questions or if there's anything I missed, please let me know in the comments section.&lt;/p&gt;

&lt;p&gt;If you found this article helpful, consider supporting OasysDB. We are developing a production-ready vector database that supports hybrid ANN searches from the ground up.&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/oasysai" rel="noopener noreferrer"&gt;
        oasysai
      &lt;/a&gt; / &lt;a href="https://github.com/oasysai/oasysdb" rel="noopener noreferrer"&gt;
        oasysdb
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Hybrid vector database with flexible SQL storage engine &amp;amp; multi-index support.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/244d33704915132fb2af4091c16b4c66e922186595c8b302d25c9d40811cdee9/68747470733a2f2f6f64622d6173736574732e73332e616d617a6f6e6177732e636f6d2f62616e6e6572732f302e372e302e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/244d33704915132fb2af4091c16b4c66e922186595c8b302d25c9d40811cdee9/68747470733a2f2f6f64622d6173736574732e73332e616d617a6f6e6177732e636f6d2f62616e6e6572732f302e372e302e706e67" alt="OasysDB Use Case"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/oasysai/oasysdb" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/c1831b9cfcde967df697fad09d5d42cd485cdced165515f441792bba6c243439/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f6173797361692f6f6173797364623f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d253233303030303030266c6162656c436f6c6f723d25323366636433346426636f6c6f723d253233366237323830" alt="GitHub Stars"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/bDhQrkqNP4" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/517e4f7724b302e8689bda1cba64bfe0d29268167169911cb0a9a84055d8ac42/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636861742d2532333662373238303f7374796c653d666f722d7468652d6261646765266c6f676f3d646973636f7264266c6f676f436f6c6f723d253233666666666666266c6162656c3d646973636f7264266c6162656c436f6c6f723d253233373238396461" alt="Discord"&gt;&lt;/a&gt;
&lt;a href="https://docs.oasysdb.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/43f96c133c36a237515bf25428a69cd70ef098294a06cbc926680852daf33556/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726561642d3662373238303f7374796c653d666f722d7468652d6261646765266c6162656c3d6f617379736462253230646f6373266c6162656c436f6c6f723d313462386136" alt="Documentation"&gt;&lt;/a&gt;
&lt;a href="https://crates.io/crates/oasysdb" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/a4a32ec6090aa2c3f7578d25a090c39ce2a5f451ba3fc0526c7eae6aa7ff1999/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f642f6f6173797364623f7374796c653d666f722d7468652d6261646765266c6f676f3d72757374266c6f676f436f6c6f723d253233303030266c6162656c3d6372617465732e696f266c6162656c436f6c6f723d25323366646261373426636f6c6f723d253233366237323830" alt="Crates.io"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Introducing OasysDB 👋&lt;/h1&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Quickstart 🚀&lt;/h1&gt;
&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Contributing 🤝&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;The easiest way to contribute to this project is to star this project and share
it with your friends. This will help us grow the community and make the project
more visible to others who might need it.&lt;/p&gt;
&lt;p&gt;If you want to go further and contribute your expertise, we will gladly welcome
your code contributions. For more information and guidance about this, please
see &lt;a href="https://github.com/oasysai/oasysdbdocs/contributing.md" rel="noopener noreferrer"&gt;Contributing to OasysDB&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you have a deep experience in the space but don't have the free time to
contribute codes, we also welcome advices, suggestions, or feature requests. We
are also looking for advisors to help guide the project direction and roadmap.&lt;/p&gt;
&lt;p&gt;If you are interested about the project in any way, please join us on &lt;a href="https://discord.gg/bDhQrkqNP4" rel="nofollow noopener noreferrer"&gt;Discord
Server&lt;/a&gt;. Help us grow the community and make OasysDB better 😁&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Disclaimer&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;This project is still in the early…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/oasysai/oasysdb" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>beginners</category>
      <category>ai</category>
      <category>learning</category>
      <category>machinelearning</category>
    </item>
    <item>
      <title>How I Got My First Rust Job by Doing Open Source</title>
      <dc:creator>Edwin Kys</dc:creator>
      <pubDate>Tue, 30 Apr 2024 16:36:56 +0000</pubDate>
      <link>https://forem.com/edwinkys/how-i-got-my-first-rust-job-by-doing-open-source-117b</link>
      <guid>https://forem.com/edwinkys/how-i-got-my-first-rust-job-by-doing-open-source-117b</guid>
      <description>&lt;p&gt;Hi everyone 👋&lt;/p&gt;

&lt;p&gt;I just want to share my story and my most recent achievement about landing on a Rust-oriented software engineering position at a startup by creating and maintaining an open-source project, &lt;a href="https://github.com/oasysai/oasysdb" rel="noopener noreferrer"&gt;OasysDB&lt;/a&gt;, an embedded vector database.&lt;/p&gt;

&lt;p&gt;I initially posted this on &lt;a href="https://www.reddit.com/r/rust/comments/1cdlaqs/i_finally_got_my_first_rust_job_doing_opensource/" rel="noopener noreferrer"&gt;Reddit&lt;/a&gt; and it received more attention than I could ever imagine. I also got a lot of questions from the community about starting an open-source projects or getting hired in general.&lt;/p&gt;

&lt;p&gt;So, in addition to the content in my original Reddit post, I will expand it a bit more to answers some of these stuff.&lt;/p&gt;

&lt;p&gt;Around 2 weeks ago now, someone opened an issue on OasysDB to integrate it to his platform, &lt;a href="https://github.com/tensorlakeai/indexify" rel="noopener noreferrer"&gt;Indexify&lt;/a&gt;, an open-source platform to extract and process various unstructured data from different sources for generative AI apps in real-time.&lt;/p&gt;

&lt;p&gt;He also connected with me via LinkedIn (my username is the same across all platforms 😂). He noticed that I had my #OpenToWork badge on and asked me if I'm looking for a job.&lt;/p&gt;

&lt;p&gt;I was like Yes! and told him that if his company is hiring, I'd love to apply. Apparently, he was actually hiring. We then scheduled a call and chatted about Indexify and OasysDB, The motivation behind it, the goal, and some other stuff.&lt;/p&gt;

&lt;p&gt;We also had another call the day after. An interview of some sort but way more casual. We discussed about the team, the vision, and other stuff related to the role. He made the decision to bring me in so fast that it kind of mindblowing 🤯&lt;/p&gt;

&lt;p&gt;We discussed the compensation over the weekend and after signing in some paperwork, I got my first Rust-oriented job! I started working last Monday and so far, I'm loving it. The team is also very helpful and friendly making the orientation period much more enjoyable.&lt;/p&gt;

&lt;p&gt;I just want to say, if you're currently struggling to land a software engineering position, it might be worth it to try expanding your network by doing different stuff. Contributing or creating an open-source project is one of them 😁&lt;/p&gt;

&lt;p&gt;Anyway, if you have any question, feel free to ask me in the comment!&lt;/p&gt;

&lt;p&gt;I add some extra content below. Don't forget to check it out :)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why I created OasysDB&lt;/li&gt;
&lt;li&gt;Improving a chance to get hired (Community)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Why I created OasysDB&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;I initially created OasysDB to learn more about Rust and vector indexing. I had no prior experience with Rust and the only experience I had with vector databases was using them at the previous startup I worked at to build a custom RAG pipeline.&lt;/p&gt;

&lt;p&gt;So, yeah. I don't even know what got into me 😂&lt;/p&gt;

&lt;p&gt;I came from Python and Typescript and my whole professional experience as a software engineer revolves around working with startups. One that I started myself and the other as a co-founder/founding engineer.&lt;/p&gt;

&lt;p&gt;So with that, I have a pretty diverse skillset from web development both frontend and backend, devops, other engineering-related skills to UI/UX designs and even administrative stuff like incorporation.&lt;/p&gt;

&lt;p&gt;Anyway, my point is that I'm adaptable and willing to learn.&lt;/p&gt;

&lt;p&gt;After I got laid off from my previous job (the startup didn't take off), I decided that I wanted to add a new programming language to my arsenal.&lt;/p&gt;

&lt;p&gt;I watched a couple of YouTube videos and read a couple of blog posts and decided to give Rust a try.&lt;/p&gt;

&lt;p&gt;My favorite way to learn something new is to create a project using it. Since I read that Rust is a good language to create a database in and I have some experience with vector database, I decided to make just that.&lt;/p&gt;

&lt;p&gt;Oh what a rough couple of weeks following that simple-minded decision 😅&lt;/p&gt;

&lt;p&gt;I ended up learning more than just Rust and vectors. I learned a lot about creating and growing a open-source community, supporting the early users of OasysDB, and many other things both engineering and non-engineering related.&lt;/p&gt;

&lt;p&gt;Overall, it is a wholesome experience that I would recommend anyone to try.&lt;/p&gt;

&lt;p&gt;Self-promotion really quick 🤣, this is OasysDB now:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/oasysai" rel="noopener noreferrer"&gt;
        oasysai
      &lt;/a&gt; / &lt;a href="https://github.com/oasysai/oasysdb" rel="noopener noreferrer"&gt;
        oasysdb
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      Hybrid vector database with flexible SQL storage engine &amp;amp; multi-index support.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/244d33704915132fb2af4091c16b4c66e922186595c8b302d25c9d40811cdee9/68747470733a2f2f6f64622d6173736574732e73332e616d617a6f6e6177732e636f6d2f62616e6e6572732f302e372e302e706e67"&gt;&lt;img src="https://camo.githubusercontent.com/244d33704915132fb2af4091c16b4c66e922186595c8b302d25c9d40811cdee9/68747470733a2f2f6f64622d6173736574732e73332e616d617a6f6e6177732e636f6d2f62616e6e6572732f302e372e302e706e67" alt="OasysDB Use Case"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/oasysai/oasysdb" rel="noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/c1831b9cfcde967df697fad09d5d42cd485cdced165515f441792bba6c243439/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6f6173797361692f6f6173797364623f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d253233303030303030266c6162656c436f6c6f723d25323366636433346426636f6c6f723d253233366237323830" alt="GitHub Stars"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/bDhQrkqNP4" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/517e4f7724b302e8689bda1cba64bfe0d29268167169911cb0a9a84055d8ac42/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636861742d2532333662373238303f7374796c653d666f722d7468652d6261646765266c6f676f3d646973636f7264266c6f676f436f6c6f723d253233666666666666266c6162656c3d646973636f7264266c6162656c436f6c6f723d253233373238396461" alt="Discord"&gt;&lt;/a&gt;
&lt;a href="https://docs.oasysdb.com" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/43f96c133c36a237515bf25428a69cd70ef098294a06cbc926680852daf33556/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f726561642d3662373238303f7374796c653d666f722d7468652d6261646765266c6162656c3d6f617379736462253230646f6373266c6162656c436f6c6f723d313462386136" alt="Documentation"&gt;&lt;/a&gt;
&lt;a href="https://crates.io/crates/oasysdb" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/a4a32ec6090aa2c3f7578d25a090c39ce2a5f451ba3fc0526c7eae6aa7ff1999/68747470733a2f2f696d672e736869656c64732e696f2f6372617465732f642f6f6173797364623f7374796c653d666f722d7468652d6261646765266c6f676f3d72757374266c6f676f436f6c6f723d253233303030266c6162656c3d6372617465732e696f266c6162656c436f6c6f723d25323366646261373426636f6c6f723d253233366237323830" alt="Crates.io"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Introducing OasysDB 👋&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Quickstart 🚀&lt;/h1&gt;
&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Contributing 🤝&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;The easiest way to contribute to this project is to star this project and share
it with your friends. This will help us grow the community and make the project
more visible to others who might need it.&lt;/p&gt;
&lt;p&gt;If you want to go further and contribute your expertise, we will gladly welcome
your code contributions. For more information and guidance about this, please
see &lt;a href="https://github.com/oasysai/oasysdbdocs/contributing.md" rel="noopener noreferrer"&gt;Contributing to OasysDB&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you have a deep experience in the space but don't have the free time to
contribute codes, we also welcome advices, suggestions, or feature requests. We
are also looking for advisors to help guide the project direction and roadmap.&lt;/p&gt;
&lt;p&gt;If you are interested about the project in any way, please join us on &lt;a href="https://discord.gg/bDhQrkqNP4" rel="nofollow noopener noreferrer"&gt;Discord
Server&lt;/a&gt;. Help us grow the community and make OasysDB better 😁&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Disclaimer&lt;/h2&gt;

&lt;/div&gt;
&lt;p&gt;This project is still in the early…&lt;/p&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/oasysai/oasysdb" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Also, this is Indexify, the open-source platform I'm currently working at:&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fassets.dev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/tensorlakeai" rel="noopener noreferrer"&gt;
        tensorlakeai
      &lt;/a&gt; / &lt;a href="https://github.com/tensorlakeai/indexify" rel="noopener noreferrer"&gt;
        indexify
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A realtime serving engine for Data-Intensive Generative AI Applications
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Indexify&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer" href="https://github.com/tensorlakeai/indexify/actions/workflows/test.yaml/badge.svg?branch=main"&gt;&lt;img src="https://github.com/tensorlakeai/indexify/actions/workflows/test.yaml/badge.svg?branch=main" alt="Tests"&gt;&lt;/a&gt;
&lt;a href="https://discord.gg/VXkY7zVmTD" rel="nofollow noopener noreferrer"&gt;&lt;img src="https://camo.githubusercontent.com/e2e5fc3dc6c944e772a93bdd97052a0fb2a1bc65149f2acd476b8cfa76a384dc/68747470733a2f2f646362616467652e76657263656c2e6170702f6170692f7365727665722f56586b59377a566d54443f7374796c653d666c617426636f6d706163743d74727565" alt="Discord"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Create and Deploy Durable, Data-Intensive Agentic Workflows&lt;/h2&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;Indexify simplifies building and serving durable, multi-stage workflows as inter-connected Python functions and automagically deploys them as APIs.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;A &lt;strong&gt;workflow&lt;/strong&gt; encodes data ingestion and transformation stages that can be implemented using Python functions. Each of these functions is a logical compute unit that can be retried upon failure or assigned to specific hardware.&lt;/p&gt;
&lt;br&gt;
&lt;div&gt;
    &lt;a rel="noopener noreferrer nofollow" href="https://raw.githubusercontent.com/tensorlakeai/indexify/main/docs/images/PDF_Extraction_Demo-VEED.gif"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Ftensorlakeai%2Findexify%2Fmain%2Fdocs%2Fimages%2FPDF_Extraction_Demo-VEED.gif" alt="PDF Extraction Demo"&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;p&gt;&lt;em&gt;To give you a taste of the project, in the above video - Indexify running PDF Extraction on a cluster of 3 machines. &lt;br&gt;
top left -    A GPU accelerated machine running document layout and OCR model on a PDF,&lt;br&gt;
bottom left - chunking texts, embedding image and text using CLIP and a text embedding model. &lt;br&gt;
top right - A function writing image and text embeddings to ChromaDB. &lt;br&gt;
All three functions of the workflow are running in parallel and coordinated by the Indexify server.&lt;/em&gt;&lt;/p&gt;
&lt;div class="markdown-alert markdown-alert-note"&gt;
&lt;p class="markdown-alert-title"&gt;Note&lt;/p&gt;
&lt;p&gt;Indexify is the Open-Source core…&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/tensorlakeai/indexify" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;h2&gt;
  
  
  &lt;strong&gt;Improving a chance to get hired (Community)&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;In addition to, of course, applying for jobs via some job boards like Indeed or LinkedIn, these are some other things you can try to get hired.&lt;/p&gt;

&lt;p&gt;By the way, if you have things that work for you that I don't have in this list, please share and I'll add it to the list so that this list can help more people too 😁&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Creating an open-source project&lt;/strong&gt;: The project also functions as your portfolio of some sort. When people use your project, connect with them and help them succeed using it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Local professional networking&lt;/strong&gt;: Meeting people in person builds a deeper connection faster. Exchange contacts and don't forget to keep in touch with them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Volunteer teaching how to code&lt;/strong&gt;: There are programs like &lt;a href="https://codeinplace.stanford.edu/" rel="noopener noreferrer"&gt;Code in Place&lt;/a&gt; teaching people how to code where you can volunteer as a teacher and connect with other teachers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Comment your own experience&lt;/strong&gt; 😁&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>rust</category>
      <category>opensource</category>
      <category>career</category>
    </item>
  </channel>
</rss>
