Login Sign Up

Building and deploying agents using Nexus

A growing number of AI platforms and toolkits are available for building large language model (LLM) applications, and it can be challenging to determine which one best suits your needs. Nexus is an open-source platform designed specifically to teach the fundamental concepts behind AI agents.

In this tutorial, we’ll introduce Nexus, walk through its core features, and guide you step by step on how to set up and run Nexus for both quick usage and development.

What is Nexus?

Nexus is an AI agent platform built to simplify the learning and development of AI-driven applications. Unlike other platforms that focus solely on implementing agents, Nexus emphasizes key components such as:

  • Personas/Profiles – The personality and primary motivator of the agent.
  • Actions/Tools – The tasks an agent can perform, including both semantic/prompt functions and native code functions.
  • Knowledge/Memory – Additional information available to the agent, from short-term memory to semantic knowledge.
  • Planning/Feedback – Mechanisms that allow an agent to plan and receive feedback on its actions.

The Nexus interface, built with Streamlit, provides an intuitive way to interact with AI agents, allowing users to configure personas, select actions, and use different LLM models.

Running Nexus

Prerequisites

Before installing Nexus, ensure you have the following:

  • Python 3.10 installed
  • A valid OpenAI API key
  • Git installed

Installation & Setup

Follow these steps to quickly get Nexus up and running.

Create a new Python virtual environment (Recommended):

python -m venv nexus_env
source nexus_env/bin/activate  # For macOS/Linux
nexus_env\Scripts\activate     # For Windows

Install Nexus from GitHub:

pip install git+https://github.com/cxbxmxcx/Nexus.git

Set your OpenAI API Key:

export OPENAI_API_KEY="<your API key>"  # For macOS/Linux
$env:OPENAI_API_KEY="<your API key>"  # For Windows (PowerShell)
echo 'OPENAI_API_KEY="<your API key>"' > .env  # Alternative: Use an .env file

Run Nexus:

nexus run

After running this command, Nexus will launch a web application where you can create a new user and start interacting with an AI agent.

Developing with Nexus

For those interested in extending Nexus or modifying its source code, follow these steps to set it up in development mode.

Clone the Nexus repository:

git clone https://github.com/cxbxmxcx/Nexus.git
cd Nexus

Set up a virtual environment and install dependencies:

python -m venv venv
source venv/bin/activate  # For macOS/Linux
venv\Scripts\activate     # For Windows
pip install -e .

Set the OpenAI API Key (if not already set):

export OPENAI_API_KEY="<your API key>"
Run Nexus in development mode:
nexus run

You can now explore and modify the Nexus source code.

Exploring Nexus Architecture

Here, we have presented the high-level architecture of Nexus interaction in chat system implementation:

A high-level architecture diagram of the main elements of the application
A high-level architecture diagram of the main elements of the application

 Nexus is structured as follows:

  • Streamlit Interface – The frontend for interacting with AI agents.
  • Chat System – Manages conversations, storing them in a database.
  • Agent Manager – Controls agent logic and behavior.
  • Action Manager – Handles available tools and actions an agent can perform.
  • Profile Manager – Manages different personas that the agent can assume.

This modular approach makes it easy to extend Nexus with new features or integrations.

Nexus is a powerful open-source AI platform designed to teach and explore AI agent development. Whether you’re looking to experiment with AI personas, develop new agent actions, or contribute to its development, Nexus provides an accessible and feature-rich environment.