{"id":378,"date":"2024-12-05T07:03:13","date_gmt":"2024-12-05T07:03:13","guid":{"rendered":"https:\/\/mailitics.com\/index.php\/2024\/12\/05\/build-a-general-purpose-ai-agent-c40be49e7400\/"},"modified":"2024-12-05T07:03:13","modified_gmt":"2024-12-05T07:03:13","slug":"build-a-general-purpose-ai-agent-c40be49e7400","status":"publish","type":"post","link":"https:\/\/mailitics.com\/index.php\/2024\/12\/05\/build-a-general-purpose-ai-agent-c40be49e7400\/","title":{"rendered":"How to Build a General-Purpose LLM Agent"},"content":{"rendered":"<p>    How to Build a General-Purpose LLM Agent<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<h4>A Step-by-Step Guide<\/h4>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1024\/1%2AKKKdVTkdU_39D7lrlw4Ugw.png?ssl=1\"><figcaption><strong>High-level Overview of an LLM Agent.<\/strong> (Image by\u00a0author)<\/figcaption><\/figure>\n<p><strong>Why build a general-purpose agent? <\/strong>Because it\u2019s an excellent tool to prototype your use cases and lays the groundwork for designing your own custom agentic architecture.<\/p>\n<p>Before we dive in, let\u2019s quickly introduce LLM agents. <em>Feel free to skip\u00a0ahead.<\/em><\/p>\n<h3>What is an LLM\u00a0agent?<\/h3>\n<blockquote><p>An LLM agent is a program whose execution logic is controlled by its underlying model.<\/p><\/blockquote>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1024\/1%2A3B6dghRN0Ut1TCqbvIRSUA.jpeg?ssl=1\"><figcaption><strong>From Standalone LLMs to Agentic Systems.<\/strong> (<em>Image by\u00a0author)<\/em><\/figcaption><\/figure>\n<p>What sets an LLM agent apart from approaches like few-shot prompting or fixed workflows is its ability to define and adapt the steps required to execute a user\u2019s query. Given access to a set of tools (like code execution or web search), the agent can decide which tool to use, how to use it, and iterate on results based on the output. This adaptability enables the system to handle diverse use cases with minimal configuration.<\/p>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1024\/1%2Aqc9SCzDgBjV7qQPH4zHhxA.jpeg?ssl=1\"><figcaption><strong>A Spectrum of Agentic Architectures. <\/strong>(Image by\u00a0author)<\/figcaption><\/figure>\n<p>Agentic architectures exist on a spectrum, ranging from the reliability of fixed workflows to the flexibility of autonomous agents. For instance, a fixed flow like Retrieval-Augmented Generation (<a href=\"https:\/\/research.ibm.com\/blog\/retrieval-augmented-generation-RAG\">RAG<\/a>) can be enhanced with a self-reflection loop, enabling the program to iterate when the initial response falls short. Alternatively, a <a href=\"https:\/\/www.promptingguide.ai\/techniques\/react\">ReAct<\/a> agent can be equipped with fixed flows as tools, offering a flexible yet structured approach. The choice of architecture ultimately depends on the use case and the desired trade-off between reliability and flexibility.<\/p>\n<p>For a deeper overview, check out <a href=\"https:\/\/www.youtube.com\/watch?v=F8NKVhkZZWI&amp;t=1s\">this\u00a0video<\/a>.<\/p>\n<h3>Let\u2019s build a general-purpose LLM agent from\u00a0scratch!<\/h3>\n<h4>Step 1. Select the right\u00a0LLM<\/h4>\n<p>Choosing the right model is critical to achieving your desired performance. There are several factors to consider, like licensing, cost, and language support. The most important consideration for building an LLM agent is the model\u2019s performance on key tasks like coding, tool calling, and reasoning. Benchmarks to evaluate\u00a0include:<\/p>\n<ul>\n<li>\n<a href=\"https:\/\/paperswithcode.com\/sota\/multi-task-language-understanding-on-mmlu\">Massive Multitask Language Understanding (MMLU)<\/a> (reasoning)<\/li>\n<li>\n<a href=\"https:\/\/gorilla.cs.berkeley.edu\/leaderboard.html\">Berkeley\u2019s Function Calling Leaderboard<\/a> (tool selection &amp; tool\u00a0calling)<\/li>\n<li>\n<a href=\"https:\/\/evalplus.github.io\/leaderboard.html\">HumanEval<\/a> and <a href=\"https:\/\/huggingface.co\/spaces\/bigcode\/bigcode-models-leaderboard\">BigCodeBench<\/a> (coding)<\/li>\n<\/ul>\n<p>Another crucial factor is the model\u2019s context window. Agentic workflows can eat up a lot of tokens\u200a\u2014\u200asometimes 100K or more\u200a\u2014\u200aa larger context window is really\u00a0helpful.<\/p>\n<p><strong>Models to Consider<\/strong> (at the time of\u00a0writing)<\/p>\n<ul>\n<li>Frontier models: <a href=\"https:\/\/platform.openai.com\/docs\/models#gpt-4o\">GPT4-o<\/a>, <a href=\"https:\/\/www.anthropic.com\/news\/claude-3-5-sonnet\">Claude\u00a03.5<\/a>\n<\/li>\n<li>Open-source models: <a href=\"https:\/\/huggingface.co\/collections\/meta-llama\/llama-32-66f448ffc8c32f949b04c8cf\">Llama3.2<\/a>, <a href=\"https:\/\/huggingface.co\/collections\/Qwen\/qwen25-66e81a666513e518adb90d9e\">Qwen2.5<\/a>.<\/li>\n<\/ul>\n<p>In general, larger models tend to offer better performance, but smaller models that can run locally are still a solid option. With smaller models, you\u2019ll be limited to simpler use cases and might only be able to connect your agent to one or two basic\u00a0tools.<\/p>\n<h4>Step 2. Define the agent\u2019s control logic (aka communication structure)<\/h4>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1024\/1%2AnV1TFBv7PTg4GlimjpkXHg.png?ssl=1\"><figcaption><strong>Single Agent Architecture<\/strong>. (Image by\u00a0author)<\/figcaption><\/figure>\n<p>The main difference between a simple LLM and an agent comes down to the <strong>system\u00a0prompt<\/strong>.<\/p>\n<blockquote><p>The <a href=\"https:\/\/promptengineering.org\/system-prompts-in-large-language-models\/\">system prompt<\/a>, in the context of an LLM, is a set of instructions and contextual information provided to the model before it engages with user\u00a0queries.<\/p><\/blockquote>\n<p>The agentic behavior expected of the LLM can be codified within the system\u00a0prompt.<\/p>\n<p>Here are some common agentic patterns, which can be customized to fit your\u00a0needs:<\/p>\n<ul>\n<li>\n<strong>Tool Use:<\/strong> The agent determines when to route queries to the appropriate tool or rely on its own knowledge.<\/li>\n<li>\n<strong>Reflection:<\/strong> The agent reviews and corrects its answers before responding to the user. A reflection step can also be added to most LLM\u00a0systems.<\/li>\n<li>\n<strong>Reason-then-Act (<\/strong><a href=\"https:\/\/www.promptingguide.ai\/techniques\/react\"><strong>ReAct<\/strong><\/a><strong>):<\/strong> The agent iteratively reasons through how to solve the query, performs an action, observes the outcome, and determines whether to take another action or provide a response.<\/li>\n<li>\n<strong>Plan-then-Execute:<\/strong> The agent plans upfront by breaking the task into sub-steps (if needed) and then executes each\u00a0step.<\/li>\n<\/ul>\n<p>The last two patterns\u200a\u2014\u200a<strong>ReAct<\/strong> and <strong>Plan-then-Execute<\/strong>\u200a\u2014\u200aaare often the best starting point for building a general-purpose single\u00a0agent.<\/p>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1024\/1%2A1F63COXi6OHYRiWhN85XFA.png?ssl=1\"><figcaption><strong>Overview of Common Agentic Patterns.<\/strong> (Image by\u00a0author)<\/figcaption><\/figure>\n<p>To implement these behaviors effectively, you\u2019ll need to do some prompt engineering. You might also want to use a <a href=\"https:\/\/python.langchain.com\/v0.1\/docs\/modules\/model_io\/chat\/structured_output\/\"><strong>structured generation<\/strong><\/a><strong> <\/strong>technique. This basically means shaping the LLM\u2019s output to match a specific format or schema, so the agent\u2019s responses stay consistent with the communication style you\u2019re aiming\u00a0for.<\/p>\n<p><strong>Example:<\/strong> Below is a system prompt excerpt for a ReAct style agent from the <a href=\"https:\/\/github.com\/i-am-bee\/bee-agent-framework\/blob\/main\/src\/agents\/bee\/prompts.ts\">Bee Agent Framework<\/a>.<\/p>\n<pre># Communication structure<br>You communicate only in instruction lines. The format is: \"Instruction: expected output\". You must only use these instruction lines and must not enter empty lines or anything else between instruction lines.<br>You must skip the instruction lines Function Name, Function Input and Function Output if no function calling is required.<br><br>Message: User's message. You never use this instruction line.<br>Thought: A single-line plan of how to answer the user's message. It must be immediately followed by Final Answer.<br>Thought: A single-line step-by-step plan of how to answer the user's message. You can use the available functions defined above. This instruction line must be immediately followed by Function Name if one of the available functions defined above needs to be called, or by Final Answer. Do not provide the answer here.<br>Function Name: Name of the function. This instruction line must be immediately followed by Function Input.<br>Function Input: Function parameters. Empty object is a valid parameter.<br>Function Output: Output of the function in JSON format.<br>Thought: Continue your thinking process.<br>Final Answer: Answer the user or ask for more information or clarification. It must always be preceded by Thought.<br><br>## Examples<br>Message: Can you translate \"How are you\" into French?<br>Thought: The user wants to translate a text into French. I can do that.<br>Final Answer: Comment vas-tu?<\/pre>\n<h4>Step 3. Define the agent\u2019s core instructions<\/h4>\n<p>We tend to take for granted that LLMs come with a bunch of features right out of the box. Some of these are great, but others might not be exactly what you need. To get the performance you\u2019re after, it\u2019s important to spell out all the features you want\u200a\u2014\u200aand don\u2019t want\u200a\u2014\u200ain the system\u00a0prompt.<\/p>\n<p>This could include instructions like:<\/p>\n<ul>\n<li>\n<strong>Agent Name and Role:<\/strong> What the agent is called and what it\u2019s meant to\u00a0do.<\/li>\n<li>\n<strong>Tone and Conciseness:<\/strong> How formal or casual it should sound, and how brief it should\u00a0be.<\/li>\n<li>\n<strong>When to Use Tools:<\/strong> Deciding when to rely on external tools versus the model\u2019s own knowledge.<\/li>\n<li>\n<strong>Handling Errors:<\/strong> What the agent should do when something goes wrong with a tool or\u00a0process.<\/li>\n<\/ul>\n<p><strong>Example:<\/strong> Below is a snippet of the instructions section from the <a href=\"https:\/\/github.com\/i-am-bee\/bee-agent-framework\/blob\/main\/src\/agents\/bee\/prompts.ts\">Bee Agent Framework<\/a>.<\/p>\n<pre># Instructions<br>User can only see the Final Answer, all answers must be provided there.<br>You must always use the communication structure and instructions defined above. Do not forget that Thought must be a single-line immediately followed by Final Answer.<br>You must always use the communication structure and instructions defined above. Do not forget that Thought must be a single-line immediately followed by either Function Name or Final Answer.<br>Functions must be used to retrieve factual or historical information to answer the message.<br>If the user suggests using a function that is not available, answer that the function is not available. You can suggest alternatives if appropriate.<br>When the message is unclear or you need more information from the user, ask in Final Answer.<br><br># Your capabilities<br>Prefer to use these capabilities over functions.<br>- You understand these languages: English, Spanish, French.<br>- You can translate and summarize, even long documents.<br><br># Notes<br>- If you don't know the answer, say that you don't know.<br>- The current time and date in ISO format can be found in the last message.<br>- When answering the user, use friendly formats for time and date.<br>- Use markdown syntax for formatting code snippets, links, JSON, tables, images, files.<br>- Sometimes, things don't go as planned. Functions may not provide useful information on the first few tries. You should always try a few different approaches before declaring the problem unsolvable.<br>- When the function doesn't give you what you were asking for, you must either use another function or a different function input.<br>  - When using search engines, you try different formulations of the query, possibly even in a different language.<br>- You cannot do complex calculations, computations, or data manipulations without using functions.m<\/pre>\n<h4>Step 4. Define and optimize your core\u00a0tools<\/h4>\n<p>Tools are what give your agents their superpowers. With a narrow set of well-defined tools, you can achieve broad functionality. Key tools to include are code execution, web search, file reading, and data analysis.<\/p>\n<p>For each tool, you\u2019ll need to define the following and include it as part of the system\u00a0prompt:<\/p>\n<ul>\n<li>\n<strong>Tool Name:<\/strong> A unique, descriptive name for the capability.<\/li>\n<li>\n<strong>Tool Description:<\/strong> A clear explanation of what the tool does and when to use it. This helps the agent determine when to pick the right\u00a0tool.<\/li>\n<li>\n<strong>Tool Input Schema:<\/strong> A schema that outlines required and optional parameters, their types, and any constraints. The agent uses this to fill in the inputs it needs based on the user\u2019s\u00a0query..<\/li>\n<li>A pointer to where\/how to run the\u00a0tool.<\/li>\n<\/ul>\n<p><strong>Example:<\/strong> Below is an excerpt of an Arxiv tool implementation from <a href=\"https:\/\/github.com\/langchain-ai\/langchain\/blob\/master\/libs\/community\/langchain_community\/tools\/arxiv\/tool.py\">Langchain Community<\/a>.<\/p>\n<pre>class ArxivInput(BaseModel):<br>    \"\"\"Input for the Arxiv tool.\"\"\"<br><br>    query: str = Field(description=\"search query to look up\")<br><br><br>class ArxivQueryRun(BaseTool):  # type: ignore[override, override]<br>    \"\"\"Tool that searches the Arxiv API.\"\"\"<br><br>    name: str = \"arxiv\"<br>    description: str = (<br>        \"A wrapper around Arxiv.org \"<br>        \"Useful for when you need to answer questions about Physics, Mathematics, \"<br>        \"Computer Science, Quantitative Biology, Quantitative Finance, Statistics, \"<br>        \"Electrical Engineering, and Economics \"<br>        \"from scientific articles on arxiv.org. \"<br>        \"Input should be a search query.\"<br>    )<br>    api_wrapper: ArxivAPIWrapper = Field(default_factory=ArxivAPIWrapper)  # type: ignore[arg-type]<br>    args_schema: Type[BaseModel] = ArxivInput<br><br>    def _run(<br>        self,<br>        query: str,<br>        run_manager: Optional[CallbackManagerForToolRun] = None,<br>    ) -&gt; str:<br>        \"\"\"Use the Arxiv tool.\"\"\"<br>        return self.api_wrapper.run(query)p<\/pre>\n<p>In certain cases, you\u2019ll need to optimize tools to get the performance you\u2019re looking for. This might involve tweaking the tool name or description with some prompt engineering, setting up advanced configurations to handle common errors, or filtering the tool\u2019s\u00a0output.<\/p>\n<h4>Step 5. Decide on a memory handling\u00a0strategy<\/h4>\n<p>LLMs are limited by their context window\u200a\u2014\u200athe number of tokens they can \u201cremember\u201d at a time. This memory can fill up fast with things like past interactions in multi-turn conversations, lengthy tool outputs, or extra context the agent is grounded on. That\u2019s why having a solid memory handling strategy is\u00a0crucial.<\/p>\n<blockquote><p>\n<strong>Memory,<\/strong> in the context of an agent, refers to the system\u2019s capability to store, recall, and utilize information from past interactions. This enables the agent to maintain context over time, improve its responses based on previous exchanges, and provide a more personalized experience.<\/p><\/blockquote>\n<p><strong>Common Memory Handling Strategies:<\/strong><\/p>\n<ul>\n<li>\n<strong>Sliding Memory:<\/strong> Keep the last <em>k<\/em> conversation turns in memory and drop the older\u00a0ones.<\/li>\n<li>\n<strong>Token Memory:<\/strong> Keep the last <em>n<\/em> tokens and forget the\u00a0rest.<\/li>\n<li>\n<strong>Summarized Memory:<\/strong> Use the LLM to summarize the conversation at each turn and drop the individual messages.<\/li>\n<\/ul>\n<p>Additionally, you can also have an LLM detect key moments to store in long-term memory. This allows the agent to \u201cremember\u201d important facts about the user, making the experience even more personalized.<\/p>\n<p>The five steps we\u2019ve covered so far lay the foundation for setting up an agent. But what happens if we run a user query through our LLM at this\u00a0stage?<\/p>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1024\/1%2A4gwtct9L3Y3g61LdlLdl9A.png?ssl=1\"><figcaption><strong>Answer: you get a raw text output.<\/strong> (Image by\u00a0author)<\/figcaption><\/figure>\n<p>Here\u2019s an example of what that might look\u00a0like:<\/p>\n<pre>User Message: Extract key insighs from this dataset<br>Files: bill-of-materials.csv<br>Thought: First, I need to inspect the columns of the dataset and provide basic data statistics.<br>Function Name: Python<br>Function Input: {\"language\":\"python\",\"code\":\"import pandas as pdnndataset = pd.read_csv('bill-of-materials.csv')nnprint(dataset.columns)nprint(dataset.describe())\",\"inputFiles\":[\"bill-of-materials.csv\"]}<\/pre>\n<p>At this point, the agent produces raw text output. So how do we get it to actually execute the next step? That\u2019s where parsing and orchestration come\u00a0in.<\/p>\n<h4><strong>Step 6. Parse the agent\u2019s raw\u00a0output<\/strong><\/h4>\n<blockquote><p>A <strong>parser<\/strong> is a function that converts raw data into a format your application can understand and work with (like an object with properties)<\/p><\/blockquote>\n<p>For the agent we\u2019re building, the parser needs to recognize the communication structure we defined in <strong>Step 2<\/strong> and return a structured output, like JSON. This makes it easier for the application to process and execute the agent\u2019s next\u00a0steps.<\/p>\n<p><em>Note: some model providers like <\/em><a href=\"https:\/\/openai.com\/index\/introducing-structured-outputs-in-the-api\/\"><em>OpenAI<\/em><\/a>,<em> can return parsable outputs by default. For other models, especially open-source ones, this would need to be configured.<\/em><\/p>\n<h4>Step 7. Orchestrate the agent\u2019s next\u00a0step<\/h4>\n<p>The final step is setting up the orchestration logic. This determines what happens after the LLM outputs a result. Depending on the output, you\u2019ll\u00a0either:<\/p>\n<ol>\n<li>\n<strong>Execute a tool call<\/strong>,\u00a0or<\/li>\n<li>\n<strong>Return an answer<\/strong>\u200a\u2014\u200aeither the final response to the user\u2019s query or a follow-up request for more information.<\/li>\n<\/ol>\n<figure><img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\" src=\"https:\/\/i0.wp.com\/cdn-images-1.medium.com\/max\/1024\/1%2AsBpr4BfqAgpyQ57GkP3Ubw.png?ssl=1\"><figcaption><strong>Extended single agent architecture.<\/strong> (Image by\u00a0author)<\/figcaption><\/figure>\n<p>If a tool call is triggered, the tool\u2019s output is sent back to the LLM (as part of its working memory). The LLM would then determine what to do with this new information: either performan another tool call or return an answer to the\u00a0user.<\/p>\n<p>Here\u2019s an example of how this orchestration logic might look in\u00a0code:<\/p>\n<pre>def orchestrator(llm_agent, llm_output, tools, user_query):<br>    \"\"\"<br>    Orchestrates the response based on LLM output and iterates if necessary.<br><br>    Parameters:<br>    - llm_agent (callable): The LLM agent function for processing tool outputs.<br>    - llm_output (dict): Initial output from the LLM, specifying the next action.<br>    - tools (dict): Dictionary of available tools with their execution methods.<br>    - user_query (str): The original user query.<br><br>    Returns:<br>    - str: The final response to the user.<br>    \"\"\"<br>    while True:<br>        action = llm_output.get(\"action\")<br><br>        if action == \"tool_call\":<br>            # Extract tool name and parameters<br>            tool_name = llm_output.get(\"tool_name\")<br>            tool_params = llm_output.get(\"tool_params\", {})<br><br>            if tool_name in tools:<br>                try:<br>                    # Execute the tool<br>                    tool_result = tools[tool_name](**tool_params)<br>                    # Send tool output back to the LLM agent for further processing<br>                    llm_output = llm_agent({\"tool_output\": tool_result})<br>                except Exception as e:<br>                    return f\"Error executing tool '{tool_name}': {str(e)}\"<br>            else:<br>                return f\"Error: Tool '{tool_name}' not found.\"<br><br>        elif action == \"return_answer\":<br>            # Return the final answer to the user<br>            return llm_output.get(\"answer\", \"No answer provided.\")<br><br>        else:<br>            return \"Error: Unrecognized action type from LLM output.\"<\/pre>\n<p><strong>And voil\u00e0! <\/strong>You now have a system capable of handling a wide variety of use cases\u200a\u2014\u200afrom competitive analysis and advanced research to automating complex workflows.<\/p>\n<h3>Where do multi-agent systems come\u00a0in?<\/h3>\n<p>While this generation of LLMs is incredibly powerful, they have a key limitation: <a href=\"https:\/\/arxiv.org\/html\/2410.18745v1\">they struggle with information overload<\/a>. Too much context or too many tools can overwhelm the model, leading to performance issues. A general-purpose single agent will eventually hit this ceiling, especially since agents are notoriously token-hungry.<\/p>\n<p>For certain use cases, a multi-agent setup might make more sense. By dividing responsibilities across multiple agents, you can avoid overloading the context of a single LLM agent and improve overall efficiency.<\/p>\n<p>That said, <strong>a general-purpose single-agent setup is a fantastic starting point for prototyping<\/strong>. It can help you quickly test your use case and identify where things start to break down. Through this process, you\u00a0can:<\/p>\n<ol>\n<li>Understand which parts of the task truly benefit from an agentic approach.<\/li>\n<li>Identify components that can be spun off as standalone processes in a larger workflow.<\/li>\n<\/ol>\n<p>Starting with a single agent gives you valuable insights to refine your approach as you scale to more complex\u00a0systems.<\/p>\n<h3>What is the best way to get\u00a0started?<\/h3>\n<p>Ready to dive in and start building? Using a framework can be a great way to quickly test and iterate on your agent configuration.<\/p>\n<ul>\n<li>\n<strong>Planning on using frontier models like OpenAI?<\/strong> Try <a href=\"https:\/\/langchain-ai.github.io\/langgraph\/how-tos\/react-agent-from-scratch\/\">this tutorial<\/a> from <a href=\"https:\/\/langchain-ai.github.io\/langgraph\/\">LangGraph<\/a>.<\/li>\n<li>\n<strong>Planning on using open-source models like Llama 3.2?<\/strong> Try <a href=\"https:\/\/github.com\/i-am-bee\/bee-agent-framework-starter\">this starter template<\/a> from the <a href=\"https:\/\/github.com\/i-am-bee\/bee-agent-framework\">Bee Agent Framework<\/a>.<\/li>\n<\/ul>\n<p><em>What\u2019s your experience building general-purpose agents? <br \/>Share your in the comments!<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/medium.com\/_\/stat?event=post.clientViewed&amp;referrerSource=full_rss&amp;postId=c40be49e7400\" width=\"1\" height=\"1\" alt=\"\"><\/p>\n<hr>\n<p><a href=\"https:\/\/towardsdatascience.com\/build-a-general-purpose-ai-agent-c40be49e7400\">How to Build a General-Purpose LLM Agent<\/a> was originally published in <a href=\"https:\/\/towardsdatascience.com\/\">Towards Data Science<\/a> on Medium, where people are continuing the conversation by highlighting and responding to this story.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Maya Murad<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/medium.com\/m\/global-identity-2?redirectUrl=https%3A%2F%2Ftowardsdatascience.com%2Fbuild-a-general-purpose-ai-agent-c40be49e7400\">Go to original source<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Build a General-Purpose LLM Agent A Step-by-Step Guide High-level Overview of an LLM Agent. (Image by\u00a0author) Why build a general-purpose agent? Because it\u2019s an excellent tool to prototype your use cases and lays the groundwork for designing your own custom agentic architecture. Before we dive in, let\u2019s quickly introduce LLM agents. Feel free [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[446,151,62,240,87,447],"tags":[448,134,449],"class_list":["post-378","post","type-post","status-publish","format-standard","hentry","category-agent-framework","category-ai","category-aimldsaimlds","category-editors-pick","category-llm","category-llm-agent","tag-agent","tag-llm","tag-tool"],"_links":{"self":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/378"}],"collection":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/comments?post=378"}],"version-history":[{"count":0,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/posts\/378\/revisions"}],"wp:attachment":[{"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/media?parent=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mailitics.com\/index.php\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}