<?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: Griptape AI</title>
    <description>The latest articles on Forem by Griptape AI (@griptape).</description>
    <link>https://forem.com/griptape</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%2Forganization%2Fprofile_image%2F9654%2Ff628464c-2e3a-4647-8a48-fc8912f9d39f.png</url>
      <title>Forem: Griptape AI</title>
      <link>https://forem.com/griptape</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/griptape"/>
    <language>en</language>
    <item>
      <title>What the Heck Are Hybrid Knowledge Bases? (And Why They Matter for LLM Apps)</title>
      <dc:creator>Kirk Crenshaw</dc:creator>
      <pubDate>Fri, 25 Apr 2025 17:51:56 +0000</pubDate>
      <link>https://forem.com/griptape/what-the-heck-are-hybrid-knowledge-bases-and-why-they-matter-for-llm-apps-im</link>
      <guid>https://forem.com/griptape/what-the-heck-are-hybrid-knowledge-bases-and-why-they-matter-for-llm-apps-im</guid>
      <description>&lt;p&gt;If you're building with LLMs and trying to give your agents or copilots real context, you've probably used a &lt;strong&gt;vector database&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;They're great for unstructured data — PDFs, HTML, markdown, text blobs. But what happens when your data &lt;em&gt;isn't&lt;/em&gt; just text?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enter Hybrid Knowledge Bases.&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Now available in &lt;a href="https://www.griptape.ai/cloud" rel="noopener noreferrer"&gt;Griptape Cloud&lt;/a&gt;, they let you store and retrieve &lt;strong&gt;structured and unstructured data&lt;/strong&gt; — together — and query them intelligently in your apps.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 So... What &lt;em&gt;Is&lt;/em&gt; a Hybrid Knowledge Base?
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Hybrid Knowledge Base&lt;/strong&gt; compliments a vector store by combining:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔢 &lt;strong&gt;Structured data&lt;/strong&gt;: things like location, job titles, timestamps, metadata fields
&lt;/li&gt;
&lt;li&gt;📝 &lt;strong&gt;Unstructured data&lt;/strong&gt;: resumé text, emails, notes, paragraphs, docs
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use &lt;strong&gt;natural language queries&lt;/strong&gt; or programmatic ones — and get results that combine &lt;strong&gt;exact-match filters&lt;/strong&gt; with &lt;strong&gt;vector similarity searches&lt;/strong&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  🛠️ Example Use Case: Candidate Search
&lt;/h3&gt;

&lt;p&gt;You're building a recruiter assistant. You have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Structured data: candidate name, location, years of experience
&lt;/li&gt;
&lt;li&gt;Unstructured data: resumes, LinkedIn profiles, cover letters&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;With a hybrid knowledge base, your app can answer:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;"Which candidates are in New York and have experience in data analysis with Python?"&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It will:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Filter by &lt;code&gt;location == New York&lt;/code&gt; (structured)&lt;/li&gt;
&lt;li&gt;Perform semantic search across profiles and resumes for &lt;code&gt;"data analysis with Python"&lt;/code&gt; (unstructured)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;📊✅ Combined results. No hacky joins. No second queries. Just clean, LLM-ready responses.&lt;/p&gt;




&lt;h2&gt;
  
  
  💡 Why It Matters
&lt;/h2&gt;

&lt;p&gt;Most LLM apps fail when the data isn’t flat text.&lt;br&gt;&lt;br&gt;
Real-world knowledge is messy. It’s structured &lt;em&gt;and&lt;/em&gt; unstructured.&lt;br&gt;&lt;br&gt;
And most stacks treat those as separate systems.&lt;/p&gt;

&lt;p&gt;With &lt;strong&gt;Griptape Hybrid Knowledge Bases&lt;/strong&gt;, you get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A unified query layer&lt;/li&gt;
&lt;li&gt;Tight integration with agents, workflows, and pipelines&lt;/li&gt;
&lt;li&gt;Real-time, semantic + structured retrieval&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Read more
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.griptape.ai/blog/introducing-griptape-cloud-hybrid-knowledge-bases" rel="noopener noreferrer"&gt;Hybrid Knowledge Bases are now available in Griptape Cloud&lt;/a&gt;.  &lt;/p&gt;




&lt;h2&gt;
  
  
  🙋‍♂️ What Would You Build?
&lt;/h2&gt;

&lt;p&gt;Got a use case that blends structured and unstructured data?&lt;br&gt;&lt;br&gt;
Want to give your agents actual intelligence without cobbling multiple tools together?&lt;/p&gt;

</description>
      <category>ai</category>
      <category>llm</category>
      <category>devtools</category>
      <category>rag</category>
    </item>
    <item>
      <title>Improving the dev experience for building apps that integrate up-to-date and private data with large language models</title>
      <dc:creator>Kirk Crenshaw</dc:creator>
      <pubDate>Mon, 31 Mar 2025 20:25:51 +0000</pubDate>
      <link>https://forem.com/griptape/improving-the-dev-experience-for-building-apps-that-integrate-up-to-date-and-private-data-with-gpj</link>
      <guid>https://forem.com/griptape/improving-the-dev-experience-for-building-apps-that-integrate-up-to-date-and-private-data-with-gpj</guid>
      <description>&lt;p&gt;We’re delighted to announce a new feature in Griptape Cloud that will improve the experience for developers building applications that integrate up-to-date and private data with large language models.  Griptape Cloud has supported retrieval augmented generation applications through similarity search for some time. Check out this post for more details on existing Retrieval Augmented Generation features in Griptape Cloud &amp;gt; &lt;a href="https://www.griptape.ai/blog/retrieval-augmented-generation-with-griptape-cloud" rel="noopener noreferrer"&gt;https://www.griptape.ai/blog/retrieval-augmented-generation-with-griptape-cloud&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Retrievers&lt;/strong&gt;&lt;br&gt;
Today, we are adding to that capability with Griptape Cloud Retrievers. Retrievers are a fully-managed implementation of the RAG Engine within Griptape Framework, and add query modification, reranking capabilities, and the ability to apply rules to query responses. These features enable you to generate more accurate and tailored results in your RAG applications built with Griptape Cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Query Modification&lt;/strong&gt;&lt;br&gt;
Query modification in RAG allows you to improve matching by transforming queries before embeddings are generated for the query and used for similarity search against the data stored in a vector store. They use techniques such as query expansion, where an LLM is used to add additional context or terms to improve each query; or Hypothetical Document Embedding (HyDE), which is the generation of hypothetical answers to a query, which are then embedded and used  with the original query to enhance the query that is made against the vector store.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What is Reranking?&lt;/strong&gt;&lt;br&gt;
Reranking works by comparing the relatedness of search results returned from a vector search query to the original query and reordering the results in descending order of their relatedness. This gives a ‘reranked’ list of results that you can use in your application.  Let’s explore an example of reranking with Griptape Framework to illustrate why reranking is valuable, and then we’ll move on to explain how to get started with Retrievers in Griptape Cloud. Let’s assume we asked the question “What is the capital of France?” and the results that came back from a vector search operation across our data sources were as follows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;results = [ “Hotdog", "San Francisco", "Lille", "Paris", "Rome", "Baguette", "Eiffel Tower", "French Hotdog" ]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To rerank these results, we compare the embedding for each result to the embedding for the original question “What is the capital of France?” and then order the results in descending order of relatedness. In this use-case, answering a question, we would likely use the top result, but there are other use-cases, a research agent might be one example, where we might want to take the top n results from the reranking operation to perform a secondary operation on those results.&lt;/p&gt;

&lt;p&gt;Implementing reranking is simple with Griptape Framework. Griptape Framework supports reranking with a local rerank driver using a simple relatedness calculation, and also has the capabilities to use Cohere’s reranking model through the &lt;code&gt;CohereRerankDriver&lt;/code&gt;. The sample code below uses the local rerank driver to rerank these results from the example query.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from griptape.artifacts import TextArtifact
from griptape.drivers.rerank.local import LocalRerankDriver

list = ["Hotdog","San Francisco","Lille","Paris","Rome","Baguette","Eiffel Tower","French Hotdog"]

artifact_list = []

for i in list:
   artifact_list.append(TextArtifact(i))

rerank_driver = LocalRerankDriver()

artifacts = rerank_driver.run("What is the capital of France?", artifact_list)

print("Reranked list:")

for artifact in artifacts:
    print("\t", artifact.value)
Reranked list:
         Paris
         Eiffel Tower
         Lille
         San Francisco
         Rome
         Baguette
         French Hotdog
         Hotdog
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can see that the reranking operation correctly identifies Paris as the best answer to the question that we posed.&lt;/p&gt;

&lt;p&gt;The example above shows the &lt;code&gt;LocalRerankDriver&lt;/code&gt; being used as a standalone module, but it is more commonly used within a Griptape Framework &lt;code&gt;RagEngine&lt;/code&gt;. The code sample below shows how we might create a tool for an Agent to use where we define a &lt;code&gt;RetrievalRagStage&lt;/code&gt; that includes a &lt;code&gt;VectorStoreRetrievalRagModule&lt;/code&gt; and a &lt;code&gt;TextChunksRerankRagModule&lt;/code&gt;, where we use the &lt;code&gt;LocalRerankDriver&lt;/code&gt;as the rerank_driver.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rag_tool = RagTool(
   description="Contains information about the judgements and applications relating to legal cases",
   off_prompt=False,
   rag_engine=RagEngine(
       retrieval_stage=RetrievalRagStage(
           retrieval_modules=[
               VectorStoreRetrievalRagModule(
                   vector_store_driver=vector_store_driver,
                   query_params={"namespace": "legal documents", "top_n": 20},
               )
           ],
           rerank_module=TextChunksRerankRagModule(rerank_driver=LocalRerankDriver()),
       ),
       response_stage=ResponseRagStage(
           response_modules=[
               PromptResponseRagModule(
                   prompt_driver=OpenAiChatPromptDriver(model="gpt-4o")
               )
           ]
       ),
   ),
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As we mentioned earlier, Retrievers are a fully-managed implementation of the RAG Engine within the Griptape Framework. So you don’t need to worry about this complexity if you’re using Griptape Cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Query Response Types&lt;/strong&gt;&lt;br&gt;
Retrievers support two different response types, text chunk responses and prompts with rulesets. The Text Chunk response type is intended for use in conjunction with an LLM for Retrieval Augmented Generation use-case. &lt;/p&gt;

&lt;p&gt;The Prompt with Rulesets response type is used to generate natural language responses to your queries directly from the Retriever without the need to pass text chunks to an LLM for response generation. As you might expect from the name of this response type, you can control the behaviour of the Retrieverer in generating natural language responses by attaching a Ruleset.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Retrievers in Griptape Cloud&lt;/strong&gt;&lt;br&gt;
Retrievers bring the benefits of query modification, reranking, and control over query responses to Griptape Cloud. Retrievers can rerank the results returned from multiple Knowledge Bases. This means that they are particularly valuable when combining the results from multiple different data sources where they can help ensure that your applications get the results that are most relevant to the search queries they are making. &lt;/p&gt;

&lt;p&gt;Let’s walk through the process of setting up a Retriever on Griptape Cloud. In this example, we’re going to create a Retriever that uses the Knowledge Base that we configured when we set up the Assistant in the 'Brush Up on NVIDIA's Q4 Earnings’ sample on the Griptape Cloud console home page. If you want to learn more about that sample application, &lt;a href="https://www.griptape.ai/blog/retrieval-augmented-generation-with-griptape-cloud" rel="noopener noreferrer"&gt;it’s covered in this blog post&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Retrievers can be found under the Libraries Navigation header in the left navigation menu in the Griptape Cloud Console. To create a Retriever, select the yellow highlighted option in the  left navigation menu and then select Create Retriever on the Retrievers page.&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%2Fr20jnrc3bra56gtlyfb3.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%2Fr20jnrc3bra56gtlyfb3.png" alt="Retrievers can be found under the Libraries Navigation header" width="800" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You will then be prompted to provide the details for your new Retriever. We are going to create a Retriever for the RAG use-case that I will connect to an Assistant, so I completed the Retriever details as shown below. Once the details have been entered, click the Create button to create the Retriever. &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%2Ft76r2l6eoydvx30gbbnd.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%2Ft76r2l6eoydvx30gbbnd.png" alt="completed the Retriever details" width="800" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I can then connect the new Retriever to my Assistant and use it to retrieve answers to my questions from the NVIDIA Q4 Earnings Knowledge Base.&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%2Fvjfms34vq4ynbjm1w37f.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%2Fvjfms34vq4ynbjm1w37f.png" alt="connect the new Retriever to my Assistant" width="800" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this example, I am using a Ruleset to guide the Assistants behavior. If you want to experiment with this, you can use my rules as inspiration for your own, or just copy them for yourself. The rules I used are as follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Only provide answers that you can verify using the Knowledge Base or Retriever. Check all answers against either the Knowledge Base or Retriever. If you cannot verify an answer from the Knowledge Base or Retriever, say so and decline to answer. Do not make things up that cannot be verified.&lt;/li&gt;
&lt;li&gt;Only answer questions related to NVIDIA's Q4 2025 earnings. Decline to answer all other questions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We hope you find the Griptape Cloud Retrievers a valuable addition to your RAG toolkit. As usual, we’re excited to hear how you put this new capability to work. Please join us in the &lt;a href="https://discord.gg/griptape" rel="noopener noreferrer"&gt;Griptape Discord&lt;/a&gt; if you have any questions, or use-cases that you would like to share.&lt;/p&gt;

</description>
      <category>llm</category>
      <category>rag</category>
      <category>ai</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Announcing Griptape AI Framework 1.5</title>
      <dc:creator>Kirk Crenshaw</dc:creator>
      <pubDate>Thu, 20 Mar 2025 19:37:37 +0000</pubDate>
      <link>https://forem.com/griptape/announcing-griptape-framework-15-2m65</link>
      <guid>https://forem.com/griptape/announcing-griptape-framework-15-2m65</guid>
      <description>&lt;p&gt;We’re pleased to announce that Griptape Framework 1.5 is now available. The 1.5 release brings enhancements to embeddings to add support for generating image embeddings and the addition of image search via the framework’s vector store drivers. We also have updates to the default models in several drivers, support for Perplexity with a new prompt driver and web search driver, and more. Let’s head down to the skatepark and explore some of the new features added in this release.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Updated Getting Started Guide &amp;amp; Improved Samples&lt;/strong&gt;&lt;br&gt;
First up, we have improved the &lt;a href="https://docs.griptape.ai/stable/griptape-framework/" rel="noopener noreferrer"&gt;Griptape Framework getting started guide&lt;/a&gt; on the Framework Overview documentation page. The new guide uses the &lt;code&gt;uv&lt;/code&gt; python dependency manager, though of course we also provide instructions for &lt;code&gt;pip&lt;/code&gt; users, and provides a tour of the key features in the framework. We recommend that you check this out, even if you're already familiar with Griptape Framework, as it covers new features added over the last few releases. We have also updated all the code samples in the documentation to include a tab showing the output logs from running the sample, so you can see the results from each sample without having to run them yourself.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support for Image Embeddings&lt;/strong&gt;&lt;br&gt;
Griptape Framework 1.5 includes support for generating embeddings from &lt;code&gt;ImageArtifact&lt;/code&gt; objects, together with new embedding drivers for Amazon Bedrock with Amazon’s Titan Multimodal Embeddings G1 model, and for Voyage AI’s &lt;code&gt;voyage-multimodal-3&lt;/code&gt; model. &lt;/p&gt;

&lt;p&gt;In the example below, I generate embeddings for 4 images that I generated using FLUX.2 with the &lt;a href="https://github.com/griptape-ai/griptape-black-forest" rel="noopener noreferrer"&gt;Black Forest Labs extension for Griptape&lt;/a&gt;. After generating and saving two snowboarding images and two skateboarding images, in the code sample I use Amazon’s amazon.titan-embed-image-v1 model to calculate embeddings for these images and a simple relatedness calculation to compare the vectors that the embedding model generated.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from griptape.drivers.embedding.amazon_bedrock import AmazonBedrockTitanEmbeddingDriver
from griptape.loaders import ImageLoader
import numpy as np

def calc_relatedness(
   x, y
):  # using the same relatedness function as the localrerankdriver
   return np.dot(x, y) / (np.linalg.norm(x) * np.linalg.norm(y))

# create a driver for multi-modal embedding with Amazon Bedrock and Amazon Titan
multi_modal_embedding_driver = AmazonBedrockTitanEmbeddingDriver(
   model="amazon.titan-embed-image-v1"
)

# calculate embeddings for our four sample images
blue_snowboarder_embeddings = multi_modal_embedding_driver.embed(
   ImageLoader().load("images/blue_snowboarder.jpeg")
)
orange_snowboarder_embeddings = multi_modal_embedding_driver.embed(
   ImageLoader().load("images/orange_snowboarder.jpeg")
)
beach_skater_embeddings = multi_modal_embedding_driver.embed(
   ImageLoader().load("images/beach_skater.jpeg")
)
paris_skater_embeddings = multi_modal_embedding_driver.embed(
   ImageLoader().load("images/paris_skater.jpeg")
)

print(  # compare the two snowboarding images
   "blue_snowboarder vs orange_snowboarder: ",
   calc_relatedness(blue_snowboarder_embeddings, orange_snowboarder_embeddings),
)

print(  # compare a snowboarding image with a skateboarding image
   "blue_snowboarder vs beach_skater: ",
   calc_relatedness(blue_snowboarder_embeddings, beach_skater_embeddings),
)

print(  # compare the two skateboarding images
   "beach_skater vs paris_skater: ",
   calc_relatedness(beach_skater_embeddings, paris_skater_embeddings),
)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The results are that the two snowboarding images are very related with a score of greater than 0.9 (scores closer to 1 indicate higher levels of relatedness), while the comparison of the snowboarding and skateboarding images gives a score just over 0.55. Comparing the two skateboarding images generates a relatedness score of greater than 0.75, despite one being on Santa Monica beach and the other in the skatepark at the Paris Olympics.&lt;/p&gt;

&lt;p&gt;Here are the images, together with the results for you to take a look at. I really like the results that I got with Black Forest Labs, and the results from the relatedness calculations.&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%2Fc3997b5rcpfy8vfshp7n.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%2Fc3997b5rcpfy8vfshp7n.png" alt="Image description" width="800" height="700"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In addition to the changes to embedding drivers, vector store drivers have been updated to support upserting and querying with &lt;code&gt;ImageArtifact&lt;/code&gt; objects, and the framework’s local vector store has been updated to support persisting multi-modal entries. These changes mean that you can store the embeddings generated for the images into a vector store and then you can query this to find the top x images nearest to the embeddings for a query image. These changes enable Griptape Framework to support image-based use cases such as image similarity search. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support for Perplexity&lt;/strong&gt;&lt;br&gt;
In this release we’ve added support for the popular AI-powered search and research engine, Perplexity, with the addition of &lt;code&gt;PerplexityPromptDriver&lt;/code&gt; and &lt;code&gt;PerplexityWebSearchDriver&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

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

from griptape.drivers.prompt.perplexity import PerplexityPromptDriver
from griptape.rules import Rule
from griptape.structures import Agent
from griptape.tasks import PromptTask

agent = Agent(
   tasks=[
       PromptTask(
           prompt_driver=PerplexityPromptDriver(
               model="sonar-pro", api_key=os.environ["PERPLEXITY_API_KEY"]
           ),
           rules=[
               Rule("Be precise and concise"),
           ],
       )
   ],
)

agent.run("tell me about the griptape framework 1.4 release")

print(agent.output.value)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you experiment with the &lt;code&gt;PerplexityPromptDriver&lt;/code&gt; using the code sample above, you will notice that the responses are generated using search as well as an LLM, meaning that you get up-to-date answers from the web. In this case, the model does a great job finding some of the highlights from the last release of the framework, using the blog post about that release as a source. This makes the &lt;code&gt;PerplexityPromptDriver&lt;/code&gt; a little different to the other prompt drivers in Griptape Framework. We are excited to see what you build with this exciting new capability. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Updates to Default Models&lt;/strong&gt;&lt;br&gt;
The default model in the &lt;code&gt;AnthropicPromptDriver&lt;/code&gt; has been updated to &lt;code&gt;claude-3-7-sonnet-latest&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;If you're using Google models, the default model for the &lt;code&gt;GooglePromptDriver&lt;/code&gt; has been updated to &lt;code&gt;gemini-2.0-flash&lt;/code&gt; and the default model for the &lt;code&gt;GoogleEmbeddingDriver&lt;/code&gt; has been updated to &lt;code&gt;embedding-004&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;For developers using Amazon Bedrock to access Anthropic’s model, the default model in the &lt;code&gt;AmazonBedrockPromptDriver&lt;/code&gt; has been updated to &lt;code&gt;anthropic.claude-3-7-sonnet-20250219-v1:0&lt;/code&gt;. In addition, the Amazon Titan model used for text embeddings has been updated to &lt;code&gt;amazon.titan-embed-text-v2:0&lt;/code&gt; and the default Amazon Titan model used in the &lt;code&gt;AmazonBedrockImageGenerationDriver&lt;/code&gt; has been updated to &lt;code&gt;amazon.titan-image-generator-v2:0&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;As usual, you can continue to use previous generation models by setting the model keyword argument to the model that you wish to use when creating an instance of each driver.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improved Control over Tool Use&lt;/strong&gt;&lt;br&gt;
If you’ve having trouble getting less powerful LLMs to function correctly when calling tools, the 1.5 release allows you to set &lt;code&gt;reflect_on_tool_use&lt;/code&gt; to &lt;code&gt;False&lt;/code&gt; and have the LLM return tool outputs directly. If you're using a less powerful LLM, you should consider using this setting so that you can make tool calls yourself rather than having the LLM coordinate them. In the very simple code sample below I run three tasks where I provide a DateTimeTool. The code is commented to provide details on the behavior that you should expect, and you can see the results from running this sample below the sample.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from griptape.tasks import PromptTask
from griptape.tools import DateTimeTool
from griptape.artifacts.list_artifact import ListArtifact

# When disabling `reflect_on_tool_use`, Task results will be returned as a ListArtifact.
# Each item in the ListArtifact will be the result of a single tool execution.

date_task = PromptTask(
    tools=[DateTimeTool()],
    reflect_on_tool_use=False,
)
results = date_task.run("How many days until it's 2026?")
# This will fail as the model will not reflect and figure out that an additional tool run is needed to calculate the date delta

if isinstance(results, ListArtifact):
    for result in results:
        print("Simple prompt output without reflection:", result)

date_task = PromptTask(
    tools=[DateTimeTool()],
    reflect_on_tool_use=False,
)
results = date_task.run("How many days from 12:44 on March 19th 2025 to Jan 1st 2026?")
# This will succeed as the prompt is more specific and the model can calculate the date delta using a single tool invocation
# Note that the output is the raw output from the tool

if isinstance(results, ListArtifact):
    for result in results:
        print("Detailed prompt output without reflection:", result)

date_task = PromptTask(
    tools=[DateTimeTool()],
    reflect_on_tool_use=True,
)
results = date_task.run("How many days until it's 2026?")
# This will succeed as the model will invoke the tool multiple times to get the current date &amp;amp; calculate the date delta
# Note that the output is more descriptive as the model has reflected on the final tool inovcation to generate the response

print("Simple prompt output with reflection:", results)
Simple prompt output without reflection: 2025-03-19 12:47:10.882934

Detailed prompt output without reflection: 287 days, 11:16:00

Simple prompt output with reflection: There are 287 days until it's 2026.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;‍&lt;strong&gt;How to get started&lt;/strong&gt;&lt;br&gt;
Griptape Framework 1.5 is available now and you can download it with uv, poetry, pip or another Python package manager of your choice. As usual, we would love to hear your feedback on these changes, together with ideas and suggestions for future imrpovements to the framework. If you want to ask any questions about the other features in this release or discuss your image embedding use-cases, please head over to the &lt;a href="https://discord.com/invite/griptape" rel="noopener noreferrer"&gt;Griptape Discord&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>python</category>
      <category>griptape</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Griptape vs. LangChain, CrewAI, and LlamaIndex: Which AI Framework Performs Best?</title>
      <dc:creator>Opemipo Disu</dc:creator>
      <pubDate>Tue, 22 Oct 2024 10:37:25 +0000</pubDate>
      <link>https://forem.com/griptape/griptape-vs-langchain-crewai-and-llamaindex-which-ai-framework-performs-best-354j</link>
      <guid>https://forem.com/griptape/griptape-vs-langchain-crewai-and-llamaindex-which-ai-framework-performs-best-354j</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;TL;DR&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;This article compares Griptape Framework with three popular AI frameworks; LangChain, CrewAI, and LlamaIndex, focusing on scalability, performance, and code complexity. In the end, you will learn why Griptape offers a more straightforward, faster, and more scalable framework for developing AI applications.&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In recent times, AI frameworks have transformed the development and deployment of AI applications, making it easier to manage workflows, build pipelines, and integrate complex LLMs into existing applications. Each of these frameworks has unique qualities and strengths that can be leveraged to build different AI projects.&lt;/p&gt;

&lt;p&gt;These frameworks have been helpful to developers looking to streamline AI development by integrating LLMs, automating tasks, and reducing development time. They also simplify workflows and pipelines, allowing developers to focus more on building AI applications.&lt;/p&gt;

&lt;p&gt;In this article, we will compare these frameworks, focusing on their performance and ease of use for developers. We’ll explore how Griptape framework stands out, making it a better option than other AI frameworks for building interactive AI applications.&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%2Feutev9obr3ctowqehnfx.gif" 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%2Feutev9obr3ctowqehnfx.gif" alt="Spongebob Scared gif" width="498" height="371"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Overview of Griptape Framework
&lt;/h3&gt;

&lt;p&gt;Griptape framework is &lt;a href="https://github.com/griptape-ai/griptape" rel="noopener noreferrer"&gt;an open-source AI framework&lt;/a&gt; that is designed to enhance the performance of AI applications by reducing code complexity and integrating LLMs into configurable workflows and pipelines. With the framework, developers can create interactive AI applications that efficiently handle and secure data..&lt;/p&gt;

&lt;p&gt;Griptape takes care of optimizing AI models and other high-level stuff, while developers can focus on lower-level complexities, such as building the business logic, orchestrating workflows and managing integrations with LLMs.&lt;/p&gt;

&lt;p&gt;The framework enables developers to code in Python and work with external data and APIs to generate responses. It also supports RAG pipelines, enabling responses from external sources, which makes it a flexible platform.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.griptape.ai/" rel="noopener noreferrer"&gt;Griptape’s Official Website.&lt;/a&gt;&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%2Fwvtqpt7ieb8ktkoyuv6c.gif" 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%2Fwvtqpt7ieb8ktkoyuv6c.gif" alt="Anything else gif" width="400" height="222"&gt;&lt;/a&gt;&lt;/p&gt;
 Yes, one more thing 😃. 



&lt;h3&gt;
  
  
  Give Griptape a Star on GitHub 🙏
&lt;/h3&gt;

&lt;p&gt;I will appreciate it if you become one of Griptape’s stargazers on GitHub. This will help a lot in Griptape’s growth - each star goes a long way toward making Griptape a more popular framework. 🚀&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%2F82bp6kq6s0efi3uq4uzs.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%2F82bp6kq6s0efi3uq4uzs.png" alt="Griptape's star history" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/griptape-ai/griptape" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Star Griptape on GitHub 🌟&lt;/a&gt;
&lt;/p&gt;




&lt;h3&gt;
  
  
  Overview of LangChain
&lt;/h3&gt;

&lt;p&gt;LangChain is a popular and powerful &lt;a href="https://www.langchain.com/langchain" rel="noopener noreferrer"&gt;open-source framework&lt;/a&gt; that enables developers to build AI applications with LLMs. It is a great choice for creating dynamic pipelines for AI applications, enabling tasks like natural language processing and conversational agents.&lt;/p&gt;

&lt;p&gt;LangChain can also connect LLMs to external data and APIs, providing additional context to responses. Its flexibility and support for numerous integrations have made it  a popular choice among developers for building complex AI applications.&lt;/p&gt;

&lt;p&gt;Currently, LangChain supports both Python and JavaScript, making it a flexible option for developers who want to build AI applications across different environments.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.langchain.com/" rel="noopener noreferrer"&gt;LangChain’s Official Website&lt;/a&gt;.&lt;/p&gt;




&lt;h3&gt;
  
  
  Overview of CrewAI
&lt;/h3&gt;

&lt;p&gt;CrewAI on the other hand is an AI platform designed to streamline team collaboration and project management. It provides an &lt;a href="https://github.com/crewAIInc/crewAI" rel="noopener noreferrer"&gt;open-source Python framework&lt;/a&gt; that enhances workflow efficiency by automating repetitive tasks With CrewAI, teams can manage projects more effectively by  predicting timelines, defining tasks, and distributing roles.&lt;/p&gt;

&lt;p&gt;CrewAI easily connects with LLMs, project management tools, and APIs, helping teams centralize their work and improve coordination. Its AI-powered analytics assist teams in making smart decisions, leading to smoother project execution and better goal alignment.&lt;/p&gt;

&lt;p&gt;CrewAI’s flexible setup works well for teams of any size, making it useful for both small startups and large enterprises. The platform lets organizations scale easily, while getting real-time insights to improve performance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.crewai.com/" rel="noopener noreferrer"&gt;CrewAI’s Official Website.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Overview of LlamaIndex
&lt;/h3&gt;

&lt;p&gt;LlamaIndex is an &lt;a href="https://www.llamaindex.ai/open-source" rel="noopener noreferrer"&gt;open-source framework&lt;/a&gt; that helps developers build systems to find and retrieve information using large language models (LLMs). It makes it easy to create pipelines for searching, indexing, and retrieving data from different sources, making it a powerful tool for AI-driven applications.&lt;/p&gt;

&lt;p&gt;LlamaIndex works well with external sources such as datasets, APIs, and knowledge bases, allowing LLMs to access and search both structured and unstructured data. This helps developers build smart systems that can give accurate, data-based answers.&lt;/p&gt;

&lt;p&gt;LlamaIndex supports two programming languages: TypeScript and Python, making it a flexible tool for developers who use both technologies to build applications.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.llamaindex.ai/" rel="noopener noreferrer"&gt;LlamaIndex’s Official Website&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Understanding The Frameworks
&lt;/h2&gt;

&lt;p&gt;In this section, we will take a deep dive into each framework. You’ll learn more about their architectures, strengths, and specific use cases, helping you better understand how they perform and where they stand out.&lt;/p&gt;

&lt;h2&gt;
  
  
  Griptape Framework
&lt;/h2&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Architecture&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Griptape Framework is an open-source framework. The Griptape framework is designed with modularity and cloud integration, especially with Griptape Cloud; its modularity makes it flexible to work with LLMs. At its core level, Griptape applications are structured around workflows and pipelines that include manageable components.&lt;/p&gt;

&lt;p&gt;These workflows enable developers to define tasks, data flows, and logic that interact with LLMs and external systems. Griptape’s framework also provides a feature for memory management, Task Memory. It ensures that workflows can maintain context and share data between tasks.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;TaskMemory&lt;/code&gt; approach is mostly useful for applications that work with LLMs, where maintaining context across multiple interactions is essential for generating logical responses.&lt;/p&gt;

&lt;p&gt;The Griptape Framework mostly focuses on simplicity and performance. Its lightweight nature makes it more performant compared to other frameworks. The Griptape framework is known for minimizing code complexity in Gen AI applications.&lt;/p&gt;

&lt;p&gt;Lastly, the framework is a fit for high-performance AI applications that need to scale properly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of Griptape Framework
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: The Griptape Framework is designed to handle large datasets and huge tasks, making it suitable for any type of application, from small AI applications to enterprise-level applications. Its architecture enables developers to scale their AI applications seamlessly as data and workloads grow, without reducing performance.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Minimal Code&lt;/strong&gt;: One of the most exciting features of Griptape is its capability to reduce the amount of code needed to build AI workflows. For example, it provides a seamless integration with AI models.&lt;br&gt;
By minimizing code, developers can focus more on application logic, reducing development time and reducing complexities.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Performance&lt;/strong&gt;: One of the most notable features the Griptape Framework provides is its high efficiency. Griptape is optimized for speed, often performing up to 10x faster than other frameworks, particularly in AI workflows integrating with LLMs.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Task Memory&lt;/strong&gt;: Task Memory is one of the most useful features of the Griptape Framework. It enables workflows to maintain context and state, enhancing the efficiency of AI applications.&lt;br&gt;
By storing intermediate results and enabling task communication, Task Memory ensures that each step in a workflow can access and build upon previous inputs and outputs.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  LangChain
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;

&lt;p&gt;LangChain is designed to be a modular framework, offering a flexible architecture that allows developers to easily integrate and customize components based on their specific use cases. The framework is designed to work with different models and APIs, making it adaptable to different types of AI workflows.&lt;/p&gt;

&lt;p&gt;Like Griptape, LangChain’s modularity enables seamless chaining and integration with different models, prompts, and data sources.&lt;/p&gt;

&lt;p&gt;LangChain currently supports two programming languages: JavaScript and Python. This enables developers using either language to easily build AI applications across these stacks. Whether you're working with the JavaScript or Python frameworks, LangChain provides the same functionalities, ensuring that developers can achieve the same results regardless of the frameworks they choose.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of LangChain
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LLM Integration Layer&lt;/strong&gt;: At its core, LangChain is built around the idea of relying on LLMs to generate responses. This integration layer handles the interaction with LLMs through APIs, ensuring that developers can easily plug in different models, making it simple to use LLMs without manual configuration or complexity.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Multilingual Support&lt;/strong&gt;: As mentioned earlier, LangChain provides two frameworks—one for Python and another for JavaScript. With both frameworks, you’ll get the same results; the only difference is the syntax. Code complexity may also vary because of the two different underlying technologies.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Chains for Workflow Orchestration&lt;/strong&gt;: Beyond LLM integration, LangChain allows developers to connect various components in a sequence, enabling workflow orchestration. This chaining of components facilitates the creation of more complex AI workflows, where data flows from one task to the next.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LangChain Memory&lt;/strong&gt;: This is still in its beta version, LangChain Memory allows conversational AI applications to "remember" previous conversations, making it possible to maintain context in multi-turn conversations. This is mostly useful for virtual assistants that need to store information across different sessions to improve response relevance.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  LlamaIndex
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;

&lt;p&gt;LlamaIndex is a framework designed to manage large-scale datasets and integrate with AI models. It provides tools for data management, mostly for applications that require querying and processing large amounts of &lt;strong&gt;structured&lt;/strong&gt; and &lt;strong&gt;unstructured&lt;/strong&gt; data. However, LlamaIndex does not perform as efficiently when handling high-speed AI model execution compared to Griptape.&lt;/p&gt;

&lt;p&gt;Like LangChain, LlamaIndex provides a framework for two underlying stacks; Python and TypeScript. These stacks are designed to be lightweight, allowing easy interaction with LLMs while ensuring developers can work with TypeScript and JavaScript. &lt;/p&gt;

&lt;p&gt;LlamaIndex stands out at connecting LLMs with large datasets for real-time and context-driven retrieval, making it a great tool to use for AI applications that require access to external sources.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of LlamaIndex
&lt;/h3&gt;

&lt;p&gt;Now, let’s have a look at the best attributes of LlamaIndex:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Language Flexibility&lt;/strong&gt;: LlamaIndex has a framework for two underlying technologies; JavaScript and TypeScript, providing flexibility for developers who prefer either language.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lightweight Nature&lt;/strong&gt;: LlamaIndex is designed to be lightweight, allowing developers to build applications without the overhead of a large framework. Its simplicity makes it a great framework for developers working on AI projects that require a direct connection between LLMs and data sources.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Query Optimization&lt;/strong&gt;: The query layer facilitates the interaction between the user’s prompt or question and large datasets. It ensures that LLMs can generate relevant information from the index, enabling natural language querying and retrieval.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  CrewAI Framework
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Architecture
&lt;/h3&gt;

&lt;p&gt;CrewAI Framework is an open-source framework solely for team collaboration. The framework integrates with LLMs and models, providing a structure that allows different models to solve complex tasks.&lt;/p&gt;

&lt;p&gt;CrewAI's Framework modularity makes it easy to connect with datasets and APIs. It allows AI workloads to scale across teams. Designed for real-time collaboration, CrewAI is good for projects that need input from multiple models or data streams.&lt;/p&gt;

&lt;p&gt;CrewAI also takes in a pipeline-based workflow, allowing developers to chain tasks, automate processes, and ensure smooth data flow through different models and stages of building the AI application. Lastly, CrewAI’s framework runs on Python; it can only run in a Python environment.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key Features of CrewAI Framework
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration Driven&lt;/strong&gt;: CrewAI is designed for teams that want to collaborate on building AI projects. It supports workflows where different members can contribute to various parts of the project in real-time, enabling seamless collaboration across teams.
CrewAI’s infrastructure enables AI agents to distribute roles and work together, regardless of the project the team is working on. This feature helps streamline development and speeds up project completion.&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%2Fkvxox7pyvecapxtciy3d.gif" 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%2Fkvxox7pyvecapxtciy3d.gif" alt="Collaboration equals innovation gif" width="640" height="640"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Modular Architecture&lt;/strong&gt;: Just like LangChain and Griptape, CrewAI’s framework offers a modular setup that enables seamless integration of different AI models, APIs, and external data sources. This architecture enables developers to configure and scale their AI projects efficiently.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Real-Time Data Integration&lt;/strong&gt;: CrewAI enables seamless real-time data processing, making it a great tool to use for dynamic applications. This capability ensures that AI models can interact with data that constantly changes.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Metrics for Comparison
&lt;/h2&gt;

&lt;p&gt;Now, we will evaluate Griptape, LangChain, LlamaIndex, and CrewAI. We will look into some key metrics to see which one stands out best. These metrics will provide a clear picture for each framework’s strengths and weaknesses for building AI applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Scalability
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Griptape Framework&lt;/strong&gt;: Griptape framework stands out in scalability when working with applications that need to manage large datasets and handle high-level tasks. It’s built for real-time data processing and large-scale deployments, enhanced further by Griptape Cloud. Its lightweight framework minimizes overhead, making it an efficient tool for managing AI workloads without sacrificing performance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LangChain&lt;/strong&gt;: LangChain is also scalable but it requires more manual configuration to manage large workloads. Due to its complex modular architecture, it can struggle with large-scale applications unless configured properly. LangChain’s strength in scalability relies on the developer’s ability to manually configure components.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;LlamaIndex&lt;/strong&gt;: LlamaIndex is built for document retrieval, making it highly scalable for use cases focused on querying large datasets. Its scalability for general AI tasks may not be as strong compared to Griptape framework or LangChain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;CrewAI&lt;/strong&gt;: CrewAI is great for scaling complex AI workflows and data pipelines with multiple integrations. However, setting it up and managing large projects can be more complex and require more effort compared to Griptape.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Performance
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Griptape&lt;/strong&gt;: Griptape is highly performant, it often completes tasks up to &lt;strong&gt;10x faster&lt;/strong&gt; than other major AI frameworks. This is due to its lightweight nature, which reduces latency and maximizes performance rate. Griptape's design allows it to deliver results efficiently without the need for additional layers of manual configuration.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LangChain&lt;/strong&gt;: LangChain is powerful and flexible, but its modular architecture can introduce complexities, which may affect performance if not optimized. Integrating multiple components can slow down execution, especially for simpler tasks where a smaller framework might be more efficient. Proper configuration is important for maintaining performance with larger workflows.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;LlamaIndex&lt;/strong&gt;: LlamaIndex works great for document-related applications, especially when dealing with large data sets. However, it’s not as fast for general AI tasks because its design is more suited for data retrieval than real-time language tasks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CrewAI:&lt;/strong&gt; CrewAI’s performance is dependent on how well the application is configured. It can achieve high performance for complex tasks, but this comes with more complex learning process and configuration time. For basic applications, it doesn’t perform as quickly as Griptape or LlamaIndex due to its more complex workflows.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Code Complexity
&lt;/h3&gt;

&lt;p&gt;In this section, we will have a look at how quickly it is to setup code for implementing the same solution for all frameworks. If you’re a developer, you will understand that simpler frameworks enable faster development cycles, fewer bugs, and easier maintenance.&lt;/p&gt;

&lt;p&gt;We will create a simple calculator that solves simple arithmetic equations with each of these frameworks and compare their code complexities.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Griptape&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&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;griptape.tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Calculator&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;griptape.structures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&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;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;Calculator&lt;/span&gt;&lt;span class="p"&gt;()]&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;calculator_loop&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;welcome to Griptape calculator&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;exit&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; to quit the calculator&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input a calculation like 5 + 3 * 2:&lt;/span&gt;&lt;span class="sh"&gt;"&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;user_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&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;exit&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bye!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&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;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output&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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Result: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&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;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&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;Error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&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;span class="nf"&gt;calculator_loop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LangChain&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&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_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="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.prompts&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;PromptTemplate&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;langchain.chains&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;LLMChain&lt;/span&gt;
&lt;span class="n"&gt;model&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-4&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;prompt_template&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;PromptTemplate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;input_variables&lt;/span&gt;&lt;span class="o"&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;expression&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;template&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Calculate this expression: {expression}.&lt;/span&gt;&lt;span class="sh"&gt;"&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="nc"&gt;LLMChain&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;llm&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;model&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;prompt_template&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;evaluate_expression&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expression&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="o"&gt;-&amp;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;response&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;chain&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;expression&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;expression&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt; 
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;strip&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;__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;__main__&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Welcome to the Interactive Calculator!&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Type &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;exit&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; to quit.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;expr&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter a numerical expression to evaluate: &lt;/span&gt;&lt;span class="sh"&gt;"&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;expr&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&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;exit&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Exiting the calculator. Goodbye!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;evaluate_expression&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;expr&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;Result: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&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;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&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;Error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;. Please enter a valid numerical expression.&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;ul&gt;
&lt;li&gt;
&lt;strong&gt;LlamaIndex&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&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;llama_index.core.agent&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;ReActAgent&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;llama_index.llms.openai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;OpenAI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;llama_index.core.tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FunctionTool&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;divide&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;a&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;float&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;b&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;ValueError&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Cannot divide by zero.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="n"&gt;b&lt;/span&gt;
&lt;span class="n"&gt;multiply_tool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FunctionTool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_defaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fn&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;multiply&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;add_tool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FunctionTool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_defaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fn&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;add&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;subtract_tool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FunctionTool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_defaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fn&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;subtract&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;divide_tool&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;FunctionTool&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_defaults&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;fn&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;divide&lt;/span&gt;&lt;span class="p"&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;OpenAI&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-4&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;agent&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ReActAgent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;from_tools&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;multiply_tool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;add_tool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subtract_tool&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;divide_tool&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;llm&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="n"&gt;verbose&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&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;evaluate_equation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;equation&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="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&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;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;chat&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;Given the equation &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;equation&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s"&gt;, calculate it step by step.&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Calculation Result:&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;response&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&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;Error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&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;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;parse_equation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;equation&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;tokens&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
    &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;equation&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;char&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;isdigit&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="ow"&gt;or&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt; &lt;span class="o"&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;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;char&lt;/span&gt;
        &lt;span class="k"&gt;else&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;num&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;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="n"&gt;num&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;''&lt;/span&gt;
            &lt;span class="n"&gt;tokens&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;char&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;num&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;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;num&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;tokens&lt;/span&gt;
&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Please enter an equation (e.g., 5 + 3 * 2) or type &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;exit&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; to quit: &lt;/span&gt;&lt;span class="sh"&gt;"&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;user_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&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;exit&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Exiting the program.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
    &lt;span class="n"&gt;equation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&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;span class="sh"&gt;""&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="nf"&gt;parse_equation&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;equation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;evaluate_equation&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;span class="nf"&gt;join&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;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s"&gt;Would you like to perform another calculation? (yes/no)&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;continue_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;lower&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;continue_input&lt;/span&gt; &lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;yes&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;y&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Exiting.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CrewAI&lt;/strong&gt;:
&lt;/li&gt;
&lt;/ul&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;crewai&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Task&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Crew&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Process&lt;/span&gt;
&lt;span class="n"&gt;calculator_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;role&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Calculator&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;goal&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;Perform arithmetic operations from given equations.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;verbose&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;memory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;False&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;backstory&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;You are designed to handle calculations efficiently by processing equations.&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;CalculationTask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;Task&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;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="nf"&gt;super&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="n"&gt;kwargs&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;execute&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="n"&gt;equation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;equation&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;eval&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;equation&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&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;Error evaluating equation: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nf"&gt;str&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
        &lt;span class="k"&gt;return&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;The result of the equation &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;equation&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; is: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;calculation_task&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;CalculationTask&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Evaluate the equation: {equation}.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;expected_output&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;The result will be calculated.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;agent&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;calculator_agent&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;crew&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;Crew&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="n"&gt;agents&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;calculator_agent&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;tasks&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;calculation_task&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
    &lt;span class="n"&gt;process&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sequential&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;run_terminal_calculator&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;equation&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter the equation to calculate (or type &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;exit&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; to quit): &lt;/span&gt;&lt;span class="sh"&gt;"&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;equation&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&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;exit&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Exiting the calculator. Goodbye!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="n"&gt;inputs&lt;/span&gt; &lt;span class="o"&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;equation&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;equation&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;crew&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;kickoff&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;inputs&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;inputs&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;result&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;__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;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;run_terminal_calculator&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;While they all perform the same function of solving arithmetic equations, they all have different ways of implementation due to the nature of the frameworks. While the basic implementations are straightforward, leveraging the GPT-4 model for more dynamic interactions brings in added complexities around integration and syntax.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Griptape Framework&lt;/strong&gt; focuses on simplicity and ease of use. The code for setting up a calculator using Griptape is straightforward, with just a few lines to define the agent and run a loop to keep interacting with the user after every calculation. The implementation has just 20 lines of code and it is easy to use. Additionally, the code didn’t include any manual integration with any LLM; the Griptape framework works with OpenAI’s GPT-4 by default.&lt;/p&gt;

&lt;p&gt;Basic error handling is also included, and the framework ensures you can manage errors without any complex setup.&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%2Fv7tjjdjxmtlj8xlmsvzy.jpg" 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%2Fv7tjjdjxmtlj8xlmsvzy.jpg" alt="it's not that deep gif" width="600" height="341"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LangChain&lt;/strong&gt;, on the other hand, offers flexibility but comes with increased complexity. Since LangChain is designed to integrate with language models, there’s a little more setup involved in defining prompts and handling responses from the model. &lt;/p&gt;

&lt;p&gt;While LangChain is simple to set up, it introduces some complexity with the need to define a prompt template and chain execution - the code isn’t as concise as what we have for Griptape; it has almost 30 lines.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LlamaIndex&lt;/strong&gt; combines the calculator with model interaction. It lets you set up function tools and use models for more complex tasks. While the implementation is more complex compared to Griptape and LangChain, the code has 58 lines. &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%2F92ocjidr9aiujt5i8pvu.gif" 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%2F92ocjidr9aiujt5i8pvu.gif" alt="That's a lot gif meme" width="498" height="498"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The code also includes more complex error handling, it requires manual effort to define each function tool and handle some cases like dividing by zero. 😃&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CrewAI&lt;/strong&gt; focuses on agents and tasks, making it the most complex framework in this comparison. Even the simple calculator setup needs agents, tasks, and process flows, despite using fewer lines of code than LlamaIndex. The code in the snippet is 42 lines majorly due to defining classes for the &lt;code&gt;Agent&lt;/code&gt;, &lt;code&gt;Task&lt;/code&gt;, and process flow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;While comparing these frameworks in this article — Griptape, LangChain, LlamaIndex, and CrewAI, we can see that they have their strengths and weaknesses depending on the use case. However, we explored the key metrics developers consider before choosing a tool to work with; Griptape, LangChain, LlamaIndex, and CrewAI.&lt;/p&gt;

&lt;p&gt;Objectively, Griptape framework stands out as the best option among all the frameworks. Its focus on reducing code complexity while providing powerful features such as &lt;code&gt;TaskMemory&lt;/code&gt;, high performance in LLM integrations, and scalability make it the best choice for building interactive AI applications.&lt;/p&gt;

&lt;p&gt;LangChain provides great flexibility but is more complex. LlamaIndex is great for data retrieval but lacks versatility for general AI applications. CrewAI is ideal for team collaboration and role distribution but can introduce unnecessary overhead for simpler use cases.&lt;/p&gt;

&lt;p&gt;For developers looking to build scalable and high-performance AI applications with minimal complexity, Griptape is the clear winner! 🎉 &lt;/p&gt;

&lt;p&gt;In conclusion, while each framework has its unique advantages, Griptape's combination of simplicity, efficiency, and powerful features makes it a good choice for developers eager to explore its capabilities. To get started with Griptape you can go through its &lt;a href="https://docs.griptape.ai/" rel="noopener noreferrer"&gt;documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I hope you enjoyed every single bit of this article. Please, note that opinions in this article are objective. I’ll appreciate your comments and reactions - hope to have you read the next piece. See ya! 👋 &lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.griptape.ai/stable/" rel="noopener noreferrer"&gt;Griptape Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://python.langchain.com/v0.2/docs/introduction/" rel="noopener noreferrer"&gt;LangChain Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.llamaindex.ai/en/latest/" rel="noopener noreferrer"&gt;LlamaIndex Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.crewai.com/introduction" rel="noopener noreferrer"&gt;CrewAI Documentation&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ai</category>
      <category>beginners</category>
      <category>programming</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Griptape: OSS Platform for Building AI Apps</title>
      <dc:creator>Opemipo Disu</dc:creator>
      <pubDate>Wed, 09 Oct 2024 18:01:34 +0000</pubDate>
      <link>https://forem.com/griptape/griptape-oss-platform-for-building-ai-apps-28ca</link>
      <guid>https://forem.com/griptape/griptape-oss-platform-for-building-ai-apps-28ca</guid>
      <description>&lt;p&gt;Over the past few weeks, I spent a lot of time exploring new AI tools with which I could build a Gen AI application. Of the many AI tools I found, Griptape impressed me the most. Wondering why I got interested in Griptape? You will find out what makes it special and my reason for using it.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR 🧏🏽
&lt;/h2&gt;

&lt;p&gt;In this article, you will learn about Griptape, its core components, and how to kickstart building and deploying your first AI application with Griptape and your favorite LLM. &lt;/p&gt;

&lt;p&gt;Curious to see what Griptape offers? Let’s dive in!&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%2Fwe42j8d9akh1nmayc43r.gif" 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%2Fwe42j8d9akh1nmayc43r.gif" alt="Diving meme" width="360" height="202"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Introduction to Griptape
&lt;/h2&gt;

&lt;p&gt;Griptape is a powerful platform for building, deploying, and managing AI applications with ease — it provides its users with a framework that helps simplify complexities of building AI applications and a cloud infrastructure for seamless deployment of Griptape applications.&lt;/p&gt;

&lt;p&gt;With Griptape, you don’t need to worry about managing the underlying infrastructure as the framework takes care of it. The platform is a great choice for developers and teams that want to accelerate development of AI applications. Griptape’s modularity ensures it remains lightweight, making it perfect for building high-performance applications without unnecessary overhead.&lt;/p&gt;

&lt;h3&gt;
  
  
  Griptape Framework
&lt;/h3&gt;

&lt;p&gt;The &lt;a href="https://github.com/griptape-ai/griptape" rel="noopener noreferrer"&gt;Griptape framework&lt;/a&gt; is an open-source Python framework designed to facilitate AI development. It makes it easy to integrate LLMs into applications with manageable pipelines and workflows. With the framework, developers can create conversational AI agents and other generative AI applications to handle data securely and efficiently.&lt;/p&gt;

&lt;p&gt;The Griptape framework allows developers to integrate LLMs with third-party data sources or custom AI models. All you have to do is build &lt;strong&gt;Extract, Transform, Load&lt;/strong&gt; (ETL) pipelines to protect access to LLMs and write agents, workflows, and pipelines to integrate your custom business logic.&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%2Fnaf6fit3bso3me4zj0ld.jpg" 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%2Fnaf6fit3bso3me4zj0ld.jpg" alt="shouting meme Griptape" width="500" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Griptape Cloud
&lt;/h3&gt;

&lt;p&gt;Griptape provides a cloud infrastructure that enables developers to deploy and scale their applications without worrying about infrastructure management. The platform takes care of resource allocation, load balancing, and uptime management, allowing developers to focus on building, deploying, and managing their applications with ease.&lt;/p&gt;

&lt;p&gt;Griptape's cloud infrastructure supports &lt;strong&gt;Retrieval-Augmented Generation&lt;/strong&gt; (RAG) pipelines, which are particularly useful for pre-processing information from external data sources before generating responses. This process allows developers to retrieve relevant data, integrate it with the response generation, and plug it seamlessly into client applications, creating more dynamic and data-enriched responses.&lt;/p&gt;

&lt;p&gt;In addition, it lets you connect to external data sources, therefore, allowing you to extract and refine data. Whether you're deploying lightweight or complex AI agents, the cloud infrastructure automatically adjusts to handle increased demand, ensuring seamless performance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Feature of Griptape
&lt;/h2&gt;

&lt;p&gt;Griptape provides many features to its users:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;LLM Integration (Framework)&lt;/strong&gt;: Griptape simplifies working with LLMs by reducing the code needed for integration. The framework allows you to easily integrate an LLM into your applications, enabling them to generate responses and context and perform other supported tasks efficiently.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Infrastructure Management (Cloud&lt;/strong&gt;): You do not need to worry about this when using Griptape because Griptape Cloud helps manage all the infrastructure tasks and load, including uptime management and resource allocation. This helps save time, as the developer’s focus will be centered on the application’s development.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability (Cloud)&lt;/strong&gt;: Griptape Cloud automatically scales to meet your application's demands without any manual configuration. This seamless scaling doesn't compromise performance, ensuring your Griptape application runs smoothly even as demand increases. 
Your application remains responsive and efficient as resources are dynamically adjusted to ensure optimal performance. Whether you are building a large-scale AI application or not, there’s nothing to worry about — Griptape Cloud manages everything for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modular and Lightweight (Framework)&lt;/strong&gt;: The Griptape framework was designed to be modular and lightweight for high performance and flexibility in development. With its modular approach, you only need to integrate the components developers need, saving time and reducing overhead.
The framework’s lightweight structure ensures that complex AI workflows and pipelines can be developed and executed without reducing performance quality, making it ideal for any type of project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Open-source (Framework)&lt;/strong&gt;: Griptape's framework is open-source, making it flexible for development. Developers can make contributions to extend Griptape's capabilities. Contributions such as GitHub issues or bug fixes can also be made to the repository.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pipeline &amp;amp; Workflow Management (Framework)&lt;/strong&gt;: The framework enables developers to build and manage workflows and pipelines securely and efficiently. With the help of Griptape’s &lt;code&gt;off-prompt&lt;/code&gt; (&lt;a href="https://www.griptape.ai/blog/the-power-of-task-memory-and-off-prompt-tm" rel="noopener noreferrer"&gt;Griptape’s component designed for security and higher performance&lt;/a&gt;), developers have control over the data that goes into the LLM and ensure processes run smoothly.
The &lt;code&gt;off-prompt&lt;/code&gt; feature also allows for seamless orchestration of tasks, enabling applications to process any amount of data and handle complex workflows.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;RAG Pipeline Optimization Support and Optimization&lt;/strong&gt;: Griptape’s framework supports RAG pipelines, enabling developers to generate relevant responses from external sources. The support allows for flexibility from different sources outside the LLM.
In addition, Griptape Cloud improves the quality of RAG pipelines making it easy to compile data before generating responses, improving the relevance and accuracy of the responses.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Seamless Deployment (Cloud)&lt;/strong&gt;: Developers can easily deploy Griptape applications using the Cloud Infrastructure without the need for manual configuration or complexities, simplifying the entire deployment process.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Griptape &lt;code&gt;TaskMemory&lt;/code&gt;&lt;/strong&gt;: This is a configurable feature provided by the Griptape Framework for storing and retrieving information generated during task execution within workflows, without sending any data back to the LLM. By using &lt;code&gt;TaskMemory&lt;/code&gt;, developers can easily manage the state between different tasks without needing to manually track it across different stages.
This feature also serves as a cost-effective solution for teams using LLMs, as the costs are based on token counts (&lt;a href="https://www.griptape.ai/blog/the-power-of-task-memory-and-off-prompt-tm" rel="noopener noreferrer"&gt;the amount of data LLMs use for input and output&lt;/a&gt;) of the messages sent.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Give Griptape a Star on GitHub 🙏
&lt;/h3&gt;

&lt;p&gt;As mentioned earlier, Griptape is open-source; all contributions are appreciated. You can support Griptape by giving It a Star on GitHub.&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%2F95uen01g3qy86m6j6bet.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%2F95uen01g3qy86m6j6bet.png" alt="Griptape's Star History Image" width="800" height="577"&gt;&lt;/a&gt;&lt;/p&gt;
 Griptape’s growth since its start in April 2023 🚀 



&lt;p&gt;Want to be a part Griptape’s growth? Please help Griptape grow by giving the project a &lt;strong&gt;Star on GitHub&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/griptape-ai/griptape" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Star Griptape on GitHub 🌟&lt;/a&gt;
&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%2F4g1s9z5sssr1mkfm5kdg.gif" 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%2F4g1s9z5sssr1mkfm5kdg.gif" alt="Thank you gif meme" width="260" height="260"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;Now that you know about Griptape, its major components, and key features, it’s time to get our hands a bit dirty by creating a simple AI application with Griptape’s Framework.&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%2Fbl3c45f29t22nerw31l4.jpg" 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%2Fbl3c45f29t22nerw31l4.jpg" alt="getting hands dirty meme" width="503" height="500"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Developing an AI Application Using Griptape and an LLM 🧙‍♀️
&lt;/h2&gt;

&lt;p&gt;Building an application with Griptape is straightforward - you only need to integrate an LLM into your AI application. Here is a step-by-step guide of how to develop a simple calculator using Griptape and an LLM:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Install and Setup Griptape Framework&lt;/strong&gt;: You’ll need to install Griptape Framework into your application using Python’s package manager:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="nx"&gt;pip&lt;/span&gt; &lt;span class="nx"&gt;install&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;griptape[all]&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;U&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Get Your OpenAI API key and Add to your Environment&lt;/strong&gt;: If you have an OpenAI account, &lt;a href="https://platform.openai.com/api-keys" rel="noopener noreferrer"&gt;generate a secret API key&lt;/a&gt;. Griptape uses OpenAI’s Chat Completion API to execute LLM tasks. The command below establishes a connection between OpenAI and Griptape by adding your API key to your environment:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="nx"&gt;OPENAI_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;&lt;span class="nx"&gt;YOUR_API_KEY&lt;/span&gt;&lt;span class="err"&gt;’&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Importing necessary Griptape Modules&lt;/strong&gt;: Here comes the first of the major steps; writing some Python code that leverages Griptape’s Framework and &lt;code&gt;gpt-4&lt;/code&gt; to perform tasks. Since we are building a simple calculator, we will make imports from two Griptape modules:
&lt;/li&gt;
&lt;/ul&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;griptape.tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Calculator&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;griptape.structures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the code above, we will import the &lt;code&gt;Calculator&lt;/code&gt; tool from the &lt;code&gt;griptape.tools&lt;/code&gt; module. This tool is designed to perform arithmetic functions in Griptape.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;Agent&lt;/code&gt; class was also imported from the &lt;code&gt;griptape.structures&lt;/code&gt; module for making interactions between the user and the &lt;code&gt;Calculator&lt;/code&gt; tool by taking in calculations and generating responses.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Creating an Agent&lt;/strong&gt;: After importing the modules, you need create an agent with the &lt;code&gt;Agent&lt;/code&gt;class imported.
&lt;/li&gt;
&lt;/ul&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;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;Calculator&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;p&gt;The &lt;code&gt;Agent&lt;/code&gt; works directly with the &lt;code&gt;Calculator&lt;/code&gt; tool to provide input, while the &lt;code&gt;Calculator&lt;/code&gt;tool performs calculations based on the user’s command.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Defining the Calculator’s Loop&lt;/strong&gt;: We will create a function to print the main logic of the calculator. In this loop, we will print the instruction for the user.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;calculator_loop&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;welcome to Griptape calculator&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;exit&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; to quit the calculator&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;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create User Interaction&lt;/strong&gt;: We will initiate a &lt;code&gt;while&lt;/code&gt; loop that enables continuous interaction with the user even after getting responses. The loop will only be terminated if the user inputs “exit”, this end the session as well by printing “bye!”.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input a calculation like 5 + 3 * 2: &lt;/span&gt;&lt;span class="sh"&gt;"&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;user_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&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;exit&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bye!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;break&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Handling User Input&lt;/strong&gt;: Now let’s create a logic to make user input perform calculations. The user’s input is passed to the agent’s &lt;code&gt;agent.run(user_input)&lt;/code&gt;method that process the calculation using the &lt;code&gt;Calculation&lt;/code&gt; tool integrated into the &lt;code&gt;Agent&lt;/code&gt; class. Once the agent has processed the inputted calculation, it is expected to display a key as &lt;code&gt;output&lt;/code&gt;. In the end, the result will be extracted and printed in a readable format.
One thing also added to the code below is a logic to handle errors; once there is an error. it notifies the user in a friendly way.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&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;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output&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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Result: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&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;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&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;Error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&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;ul&gt;
&lt;li&gt;
&lt;strong&gt;Run the Calculator Loop&lt;/strong&gt;: Lastly, we will create a calculator loop to restart the calculator after performing
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nf"&gt;calculator_loop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the code you should have before running or deploying:&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;griptape.tools&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Calculator&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;griptape.structures&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Agent&lt;/span&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;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;Calculator&lt;/span&gt;&lt;span class="p"&gt;()]&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;calculator_loop&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;welcome to Griptape calculator&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;type &lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;exit&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt; to quit the calculator&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;user_input&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;input a calculation like 5 + 3 * 2:&lt;/span&gt;&lt;span class="sh"&gt;"&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;user_input&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;lower&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;exit&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="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;bye!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;
        &lt;span class="k"&gt;try&lt;/span&gt;&lt;span class="p"&gt;:&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;agent&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;user_input&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
            &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;response&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;output&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="sa"&gt;f&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Result: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;result&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;span class="k"&gt;except&lt;/span&gt; &lt;span class="nb"&gt;Exception&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;e&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;Error: &lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="n"&gt;e&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;span class="nf"&gt;calculator_loop&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let’s run the script and test our first Griptape Application:&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="n"&gt;python3&lt;/span&gt; &lt;span class="n"&gt;my_griptape_script&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, let’s test our first Griptape application:&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="n"&gt;Welcome&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;Griptape&lt;/span&gt; &lt;span class="n"&gt;Calculator&lt;/span&gt;
&lt;span class="n"&gt;Type&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;exit&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;quit&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;calculator&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;
&lt;span class="n"&gt;Input&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;calculation&lt;/span&gt; &lt;span class="n"&gt;like&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&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;83&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&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;10&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;04&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;03&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;INFO&lt;/span&gt;     &lt;span class="n"&gt;ToolkitTask&lt;/span&gt; &lt;span class="mf"&gt;038e687684&lt;/span&gt;&lt;span class="n"&gt;c04ae2b83467221ca9f6c4&lt;/span&gt;                                                                                               
                             &lt;span class="n"&gt;Input&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;83&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt; &lt;span class="o"&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;10&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;04&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;08&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;INFO&lt;/span&gt;     &lt;span class="n"&gt;Subtask&lt;/span&gt; &lt;span class="mi"&gt;989&lt;/span&gt;&lt;span class="n"&gt;a11849ec3406f85b5db3de17089bf&lt;/span&gt;                                                                                                   
                             &lt;span class="n"&gt;Thought&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;To&lt;/span&gt; &lt;span class="n"&gt;solve&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;expression&lt;/span&gt; \&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;83&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; \&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; \&lt;span class="n"&gt;frac&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;}{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;\&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;need&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;follow&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;order&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;operations&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;parentheses&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;exponents&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     
                             &lt;span class="n"&gt;multiplication&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nf"&gt;division &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;addition&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nf"&gt;subtraction &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="n"&gt;left&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;right&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;                                       

                             &lt;span class="mf"&gt;1.&lt;/span&gt; &lt;span class="n"&gt;First&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;perform&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;multiplication&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; \&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt; \&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;\&lt;span class="p"&gt;).&lt;/span&gt;                                                                                     
                             &lt;span class="mf"&gt;2.&lt;/span&gt; &lt;span class="n"&gt;Then&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;perform&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;division&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; \&lt;span class="p"&gt;(&lt;/span&gt;\&lt;span class="n"&gt;frac&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;}{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;\&lt;span class="p"&gt;).&lt;/span&gt;                                                                                            
                             &lt;span class="mf"&gt;3.&lt;/span&gt; &lt;span class="n"&gt;Finally&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;perform&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;subtraction&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;addition&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;sequence&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;                                                                              

                             &lt;span class="n"&gt;Actions&lt;/span&gt;&lt;span class="p"&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;name&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;Calculator&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;path&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;calculate&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;input&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;values&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;expression&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;10 *                                                    
                             2&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;tag&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;multiplication&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;name&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;Calculator&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;path&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;calculate&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;input&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;values&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;expression&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;4 / 2&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;tag&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;division&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}]&lt;/span&gt;          
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;04&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;INFO&lt;/span&gt;     &lt;span class="n"&gt;Subtask&lt;/span&gt; &lt;span class="mi"&gt;989&lt;/span&gt;&lt;span class="n"&gt;a11849ec3406f85b5db3de17089bf&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;Output&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Calculator.calculate&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="n"&gt;was&lt;/span&gt; &lt;span class="n"&gt;stored&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;memory&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;memory_name&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;TaskMemory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;artifact_namespace&lt;/span&gt;                       
                             &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;ec34a8df918c41c18ae2f53f0654b611&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;                                                                                                         

                             &lt;span class="n"&gt;Output&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Calculator.calculate&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="n"&gt;was&lt;/span&gt; &lt;span class="n"&gt;stored&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;memory&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;memory_name&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;TaskMemory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;artifact_namespace&lt;/span&gt;                                 
                             &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;e2ce65a931e34b36bda8c62063621fc1&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;                                                                                                         
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;04&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;12&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;INFO&lt;/span&gt;     &lt;span class="n"&gt;Subtask&lt;/span&gt; &lt;span class="n"&gt;bf8589416c6f4f6487d22dc7b217b599&lt;/span&gt;                                                                                                   
                             &lt;span class="n"&gt;Thought&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;have&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;multiplication&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;division&lt;/span&gt; &lt;span class="n"&gt;stored&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;memory&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt; &lt;span class="n"&gt;I&lt;/span&gt; &lt;span class="n"&gt;need&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;retrieve&lt;/span&gt; &lt;span class="n"&gt;these&lt;/span&gt; &lt;span class="n"&gt;results&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;use&lt;/span&gt; &lt;span class="n"&gt;them&lt;/span&gt; &lt;span class="n"&gt;to&lt;/span&gt; &lt;span class="n"&gt;complete&lt;/span&gt; 
                             &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;calculation&lt;/span&gt; &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;expression&lt;/span&gt; \&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;83&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;\&lt;span class="p"&gt;).&lt;/span&gt;                                                                                        

                             &lt;span class="n"&gt;Actions&lt;/span&gt;&lt;span class="p"&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;tag&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;subtraction_addition&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;name&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;Calculator&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;path&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;calculate&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;input&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&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;values&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&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;expression&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;83 - 20 + 2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}}}]&lt;/span&gt;  
                    &lt;span class="n"&gt;INFO&lt;/span&gt;     &lt;span class="n"&gt;Subtask&lt;/span&gt; &lt;span class="n"&gt;bf8589416c6f4f6487d22dc7b217b599&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;Output&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Calculator.calculate&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="n"&gt;was&lt;/span&gt; &lt;span class="n"&gt;stored&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="n"&gt;memory&lt;/span&gt; &lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="n"&gt;memory_name&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;TaskMemory&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt; &lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="n"&gt;artifact_namespace&lt;/span&gt;                       
                             &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;d29c94ed49f84111ae76f02ae94e7df2&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;                                                                                                         
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;04&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="mi"&gt;00&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;47&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;13&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="n"&gt;INFO&lt;/span&gt;     &lt;span class="n"&gt;ToolkitTask&lt;/span&gt; &lt;span class="mf"&gt;038e687684&lt;/span&gt;&lt;span class="n"&gt;c04ae2b83467221ca9f6c4&lt;/span&gt;                                                                                               
                             &lt;span class="n"&gt;Output&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;The&lt;/span&gt; &lt;span class="n"&gt;result&lt;/span&gt; &lt;span class="n"&gt;of&lt;/span&gt; &lt;span class="n"&gt;the&lt;/span&gt; &lt;span class="n"&gt;expression&lt;/span&gt; \&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;83&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt; \&lt;span class="n"&gt;times&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; \&lt;span class="n"&gt;frac&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;}{&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;\&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="ow"&gt;is&lt;/span&gt; &lt;span class="mf"&gt;65.&lt;/span&gt;                                                             
&lt;span class="n"&gt;Input&lt;/span&gt; &lt;span class="n"&gt;a&lt;/span&gt; &lt;span class="n"&gt;calculation&lt;/span&gt; &lt;span class="n"&gt;like&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;span class="n"&gt;bye&lt;/span&gt;&lt;span class="err"&gt;!&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, it doesn’t just give the calculation's output; it is also interactive. It allows users to see the process of calculating the arithmetic expression. This transparency enhances the user experience by enabling users to understand how the final result is obtained.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying Your Griptape Application
&lt;/h2&gt;

&lt;p&gt;While we won’t be deploying this application, you can follow the instructions provided in the &lt;a href="https://docs.griptape.ai/stable/griptape-cloud/" rel="noopener noreferrer"&gt;Griptape Cloud documentation&lt;/a&gt;. Griptape Cloud offers a component, &lt;a href="https://docs.griptape.ai/stable/griptape-cloud/structures/create-structure/" rel="noopener noreferrer"&gt;Structures&lt;/a&gt;, for deploying applications whether it uses the Griptape Framework or not.&lt;/p&gt;

&lt;p&gt;It also enables developers to build RAG pipelines by connecting to Griptape’s Data Sources for ingestion. To deploy your application, you can also start by creating an account and integrating with GitHub.&lt;/p&gt;

&lt;p&gt;For more detailed steps on how to deploy a Griptape application, you can refer to the deployment guide in &lt;a href="https://docs.griptape.ai/stable/griptape-cloud/" rel="noopener noreferrer"&gt;Griptape's Cloud documentation&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Summary
&lt;/h2&gt;

&lt;p&gt;Building and deploying an AI application using Griptape shows how easily you can integrate LLM tools into your project. From handling user input to interacting with LLMs, Griptape simplifies the development process of developing an AI Application with its framework.&lt;/p&gt;

&lt;p&gt;This article only focused on Griptape’s entire structure and how Griptape can be used to develop interactive AI applications. If you want to learn more about Griptape’s other offerings, I recommend checking out their &lt;a href="http://griptape.ai" rel="noopener noreferrer"&gt;official website&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Lastly, please do well to give Griptape a Star on GitHub. 😃&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/griptape-ai/griptape" class="ltag_cta ltag_cta--branded" rel="noopener noreferrer"&gt;Star Griptape on GitHub 🌟&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;Thank you for reading this article. I look forward to hearing what you think about Griptape in the comment section! 👋 &lt;/p&gt;

&lt;h2&gt;
  
  
  References /Useful links ⛓️
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.notion.so/Griptape-OSS-Platform-for-Building-AI-Apps-10f38c31515a801e9f7bd92c0acd95fb?pvs=21" rel="noopener noreferrer"&gt;Griptape’s Official Website&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.griptape.ai/stable/griptape-framework/" rel="noopener noreferrer"&gt;Griptape’s Framework Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.griptape.ai/stable/griptape-cloud/" rel="noopener noreferrer"&gt;Griptape's Cloud Documentation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.griptape.ai/blog/griptape-deep-dive" rel="noopener noreferrer"&gt;Griptape Deep Dive&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.griptape.ai/blog/the-power-of-task-memory-and-off-prompt-tm" rel="noopener noreferrer"&gt;Griptape Task Memory and Off-Prompt&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.griptape.ai/account/support" rel="noopener noreferrer"&gt;Griptape's Cloud Support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://discord.gg/griptape" rel="noopener noreferrer"&gt;Griptape's Discord Community&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
