AI Personal Learning
and practical guidance
Beanbag Marscode1

PrimisAI Nexus: A Lightweight Framework for Building Scalable AI Multi-Intelligent Body Systems and Task Automation

General Introduction

PrimisAI Nexus is a lightweight open source Python framework hosted on GitHub and developed by the PrimisAI team to help users build and manage scalable AI multi-intelligentsia systems for automation of complex tasks through Large Language Modeling (LLM). It adopts a modular design to provide simplified workflows and YAML configurations through a single Supervising Intelligence (Supervisor) collaborating with multiple Worker Agents, lowering the development threshold. As of February 2025, Nexus excels in code generation tasks such as HumanEval and VerilogEval-Human benchmarking, making it suitable for developers and researchers to build efficient AI automation solutions.

blank

Nexus Architecture


 

Function List

  • Scalable Multi-Intelligence System: Support dynamic addition of intelligences to scale the system with task complexity.
  • Task automation: Automated execution by supervisory intelligences breaking down tasks and assigning them to specialized work intelligences.
  • Lightweight Architecture: Provide a clean workflow design that reduces development and maintenance costs.
  • LLM Integration: Seamless connection to large language models (e.g., GPT-4o) with support for custom configurations.
  • YAML Configuration: Simplify management by defining the structure and tasks of intelligences through configuration files.
  • Debugging and Optimization: Built-in logging and feedback loops to minimize the impact of intelligent body failure.

 

Using Help

Installation process

The installation process for PrimisAI Nexus is simple, and the following are the detailed steps:

  1. Preparing the environment
    • Ensure that Python 3.8+ is installed, run thepython --versionCheck.
    • Create a virtual environment (recommended):
      python -m venv nexus_env
      source nexus_env/bin/activate # Linux/Mac
      nexus_env\Scripts\activate # Windows
      
  2. Installing Nexus
    • Use pip to install:
      pip install primisai
      
    • Check version: runpip show primisai, confirming that the installation was successful.
  3. Configuring LLM Access
    • Get the API key for a large language model (e.g., OpenAI API Key).
    • Setting environment variables:
      export OPENAI_API_KEY="your-api-key-here" # Linux/Mac
      set OPENAI_API_KEY="your-api-key-here" # Windows
      
  4. Verify Installation
    • Creating Test Scriptstest_nexus.py::
      from primisai.nexus.core import Supervisor
      llm_config = {"api_key": "your-api-key-here", "model": "gpt-4o"}
      supervisor = Supervisor("TestSupervisor", llm_config)
      print("Nexus is ready!")
      
    • (of a computer) runpython test_nexus.pyIf the output is "Nexus is ready!", the installation is successful. indicating a successful installation.

Main function operation flow

1. Building scalable multi-intelligence systems

  • procedure::
    1. Import Module:
      from primisai.nexus.core import Agent, Supervisor
      
    2. Configure LLM:
      llm_config = {
      "api_key": "your-api-key-here",
      "model": "gpt-4o"
      }
      
    3. Creating Supervisory Intelligentsia and Work Intelligentsia:
      supervisor = Supervisor("RootSupervisor", llm_config)
      coder = Agent("Coder", llm_config, system_message="Generating Python code.")
      tester = Agent("Tester", llm_config, system_message="Verify code correctness.")
      supervisor.register_agent(coder)
      supervisor.register_agent(tester)
      
    4. Execution of tasks:
      task = "Write and verify a sorting algorithm"
      supervisor.run(task)
      
  • Functional Description: Supervisory intelligences decompose tasks (e.g., writing code and tests) and assign them to Coder and Tester work intelligences, and the system can be dynamically scaled up with more intelligences as needed.

2. Configuring automated tasks using YAML

  • procedure::
    1. establishconfig.yamlDocumentation:
      supervisor.
      name: "AutomationSupervisor"
      llm_config.
      api_key: "your-api-key-here"
      model: "gpt-4o"
      agents.
      - name: "DataCollector"
      system_message: "Collecting and organizing data."
      - name: "ReportGenerator"
      system_message: "Generate data reports."
      
    2. Load and run:
      from primisai.nexus.config import load_yaml_config, AgentFactory
      config = load_yaml_config("config.yaml")
      factory = AgentFactory()
      system = factory.create_from_config(config)
      system.run("Collecting market data and generating reports")
      
  • Functional Description: Define the roles and task logic of intelligences through YAML files to automate data collection and report generation, and adjust the configuration without modifying the code.

3. Real-time interaction and testing

  • procedure::
    1. Start an interactive session:
      supervisor.start_interactive_session()
      
    2. Enter a task, e.g., "Generate a Web search tool," and observe the results of the intelligence collaboration.
    3. importationexitExit the session.
  • Functional Description: Supports real-time testing of the effectiveness of multi-intelligence collaboration to verify the smoothness of the task automation process.

4. Commissioning and optimization

  • procedure::
    1. Set up the debugger:
      from primisai.nexus.core import Debugger
      debugger = Debugger(log_level="DEBUG")
      supervisor.set_debugger(debugger)
      
    2. Run the task and view the log (saved by default tonexus.log).
    3. Optimize intelligentsia logic or task assignments based on logs.
  • Functional Description: Debugging tools record details of smart body operation and ensure stable and reliable task execution through feedback loops.

caveat

  • Ensure that the network is smooth and that LLM calls require a stable API service.
  • YAML file indentation needs to be uniform (e.g. 2 spaces), otherwise parsing may fail.
  • Complex tasks are suggested to be split into sub-tasks to improve the efficiency of multi-intelligence body collaboration.

With these steps, users can quickly get started with Nexus, build scalable AI multi-intelligence systems and automate tasks.

CDN1
May not be reproduced without permission:Chief AI Sharing Circle " PrimisAI Nexus: A Lightweight Framework for Building Scalable AI Multi-Intelligent Body Systems and Task Automation

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish