Skip to content

Build customizable Agents visually with Xircuits

License

Notifications You must be signed in to change notification settings

XpressAI/xai-agent

Repository files navigation

Component LibrariesProject Templates
DocsInstallTutorialsDeveloper GuidesContributeBlogDiscord

Xircuits Component Library for Agent! Enable intelligent agents with memory, tool usage, and dynamic decision-making.


Xircuits Component Library for Agent

This library empowers Xircuits with components to build intelligent agents that can interact dynamically with users, store and query memories, and utilize tools for specific tasks. It supports OpenAI and VertexAI agents for creating advanced conversational systems.

Table of Contents

Preview

The Example:

agent_example

The Result:

agent_example_result

Prerequisites

Before you begin, you will need the following:

  1. Python3.9+.
  2. Xircuits.

Main Xircuits Components

AgentInit Component:

Initializes the agent with a name, provider (OpenAI/VertexAI), memory, tools, and system prompts. This is the foundation of the agent setup.

AgentInit

AgentRun Component:

Runs the agent with a given conversation and allows the agent to use tools dynamically. Outputs the conversation history and the agent's last response.

AgentRun

AgentDefineTool Component:

Defines a tool for the agent to use during interactions. The tool can perform custom actions based on user input.

AgentToolOutput Component:

Outputs the result of a tool back to the agent, enabling it to complete its task or provide a response.

AgentMakeToolbelt Component:

Creates a collection of tools (toolbelt) for the agent, which can be referenced in workflows to enhance functionality.

AgentNumpyMemory Component:

Implements local, temporary memory using NumPy for storing and querying embeddings.

AgentVectoMemory Component:

Integrates with the Vecto API to provide external memory support for long-term storage and querying.

AgentStreamStringResponse Component:

Streams a response string word-by-word, mimicking the typing effect often seen in modern conversational systems.

Try The Examples

We have provided an example workflow to help you get started with the Agent component library. Give it a try and see how you can create custom Agent components for your applications.

Agent Example

This example uses the AgentRun component to create a conversational agent named HodlBot. The agent uses the get_current_time tool to respond to user queries about the current time in specific locations.

Installation

To use this component library, ensure that you have an existing Xircuits setup. You can then install the Agent library using the component library interface, or through the CLI using:

xircuits install agent

You can also do it manually by cloning and installing it:

# base Xircuits directory
git clone https://github.com/XpressAI/xai-agent xai_components/xai_agent
pip install -r xai_components/xai_agent/requirements.txt

About

Build customizable Agents visually with Xircuits

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages