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.
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:
- Preparing the environment
- Ensure that Python 3.8+ is installed, run the
python --version
Check. - Create a virtual environment (recommended):
python -m venv nexus_env source nexus_env/bin/activate # Linux/Mac nexus_env\Scripts\activate # Windows
- Ensure that Python 3.8+ is installed, run the
- Installing Nexus
- Use pip to install:
pip install primisai
- Check version: run
pip show primisai
, confirming that the installation was successful.
- Use pip to install:
- 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
- Verify Installation
- Creating Test Scripts
test_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) run
python test_nexus.py
If the output is "Nexus is ready!", the installation is successful. indicating a successful installation.
- Creating Test Scripts
Main function operation flow
1. Building scalable multi-intelligence systems
- procedure::
- Import Module:
from primisai.nexus.core import Agent, Supervisor
- Configure LLM:
llm_config = { "api_key": "your-api-key-here", "model": "gpt-4o" }
- 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)
- Execution of tasks:
task = "Write and verify a sorting algorithm" supervisor.run(task)
- Import Module:
- 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::
- establish
config.yaml
Documentation: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."
- 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")
- establish
- 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::
- Start an interactive session:
supervisor.start_interactive_session()
- Enter a task, e.g., "Generate a Web search tool," and observe the results of the intelligence collaboration.
- importation
exit
Exit the session.
- Start an interactive 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::
- Set up the debugger:
from primisai.nexus.core import Debugger debugger = Debugger(log_level="DEBUG") supervisor.set_debugger(debugger)
- Run the task and view the log (saved by default to
nexus.log
). - Optimize intelligentsia logic or task assignments based on logs.
- Set up the debugger:
- 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.