Skip to main content

Nexus is a powerful and flexible Python package for managing AI agents and coordinating complex tasks using LLMs.

Project description

Nexus

Nexus is a powerful and flexible Python package for managing AI agents and coordinating complex tasks using LLMs. It provides a robust framework for creating, managing, and interacting with multiple specialized AI agents under the supervision of a central coordinator.

Features

  • AI Base Class: A foundational class for AI interactions.
  • Agent Class: Extends the AI base class with additional features for specialized tasks.
  • Supervisor Class: Manages multiple agents, coordinates tasks, and handles user interactions.
  • Debugger Utility: Integrated debugging capabilities for logging and troubleshooting.
  • Flexible Configuration: Easy-to-use configuration options for language models and agents.
  • Interactive Sessions: Built-in support for interactive chat sessions with the AI system.

Installation

You can install Nexus using pip:

pip install -e .

Quick Start

Here's a simple example to get you started with Nexus:

from nexus.core import AI, Agent, Supervisor
from nexus.utils.debugger import Debugger

# Configure your OpenAI API key
llm_config = {
    "api_key": "your-api-key-here",
    "model": "gpt-4o",
    "base_url": "https://api.openai.com/v1",
}

# Create a supervisor
supervisor = Supervisor("MainSupervisor", llm_config)

# Create and register agents
agent1 = Agent("Agent1", llm_config, system_message="You are a helpful assistant.")
agent2 = Agent("Agent2", llm_config, system_message="You are a creative writer.")

supervisor.register_agent(agent1)
supervisor.register_agent(agent2)

# Start an interactive session
supervisor.display_agent_graph()
supervisor.start_interactive_session()

Documentation

For detailed documentation on each module and class, please refer to the inline docstrings in the source code.

Advanced Usage

Nexus allows for complex interactions between multiple agents. You can create specialized agents for different tasks, register them with a supervisor, and let the supervisor manage the flow of information and task delegation.

# Example of creating a specialized agent with tools
tools = [
    {
        "metadata": {
            "name": "search_tool",
            "description": "Searches the internet for information"
        },
        "tool": some_search_function
    }
]

research_agent = Agent("Researcher", llm_config, tools=tools, system_message="You are a research assistant.", use_tools=True)
supervisor.register_agent(research_agent)

License

This project is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

primisai-0.2.0.tar.gz (11.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

primisai-0.2.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file primisai-0.2.0.tar.gz.

File metadata

  • Download URL: primisai-0.2.0.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for primisai-0.2.0.tar.gz
Algorithm Hash digest
SHA256 332b8779b1a1df5e0e551308fb99753f7c6209c2fff533dacafd41d8cd759e03
MD5 21f5eecc2df47a16427896c1a4971d76
BLAKE2b-256 32bea7e229b516963945660789cec2a16d8221eb992af5e63f112b1814b700dc

See more details on using hashes here.

File details

Details for the file primisai-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: primisai-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for primisai-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 16c417ec5e89b0a1dc6d8825365e5e5c21885097d8b5c5444996c6c4dc3a5e80
MD5 4826ac3d8c202d2ab07b7523747df4f6
BLAKE2b-256 367253151a48593388da2aa088d663bf911a68a8a9a37a3566fa3902e63d112d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page