π Language | θ―θ¨ιζ©οΌδΈζ | English
BNOS (Bionic Neural Network Operating System) is a general-purpose modular execution engine based on bionic neural networks. The system adopts a brain-inspired architecture where multiple collaborative nodes are combined to build various application systems. It can be used for plugin-based systems, automation pipelines, task scheduling, edge computing, microservices, and other scenarios, as well as for building AI agents. Each node is the smallest execution unit in the system (similar to neurons or functional modules in the brain), and multiple nodes communicate and collaborate through JSON files to jointly realize complex business logic and processing capabilities.
This system draws inspiration from the core characteristics of biological neural networks, mapped to general-purpose modular execution scenarios:
- Functional Nodes (Neurons): Each node functions like a neuron or functional module in the brain, responsible for specific subtask processing
- Node Collaboration (Neural Circuits): Multiple nodes connect through data files, forming a collaboration network within the system
- Attention Mechanism: Task filtering based on rules simulates the attention focusing mechanism of nodes
- Duplicate Processing Prevention: Automatically marks processed tasks to avoid nodes repeatedly executing the same operations (improves efficiency)
- Modular Design: Flexibly build various application systems with complex capabilities by combining nodes with different functions
BNOS does not require all nodes to support high concurrency, but adopts a brain-inspired architecture:
- High-Performance Node Implementation: High concurrency and high-performance requirements (such as LLM inference, large-scale computing, high-frequency access) are implemented only within individual specialized nodes
- Flexible Technology Stack: These nodes can freely use multi-threading, multi-processing, coroutines, third-party engines, and other technologies without framework restrictions
- Lightweight Node Stability: Other nodes are only responsible for task perception, attention filtering, decision scheduling, and result storage, maintaining lightweight stability
- Minimalist Communication: Inter-node communication is achieved through files, avoiding the complexity of distributed systems
This architecture makes the system both simple and stable, while enabling extreme performance in critical nodes.
Upper Task (upper_data.json)
β
Listener (listener.py) β Attention Filtering (node attention mechanism)
β
Node Processing Logic (main.py) β Functional Unit Execution
β
Output to Next Node (output.json) β Inter-Node Communication
- listener.py: Node listener responsible for monitoring upper tasks, executing attention filtering, and calling node processing logic
- main.py: Node processing logic implementing execution logic for specific functional units within the agent
- config.json: Node configuration file defining node name, listening path, attention rules, etc.
- packet.py: Data packet structure definition file (inter-node communication format)
- create_node.py: Node creation tool that automatically generates complete node structures
- π Environment Isolation: Each node has its own independent Python virtual environment (venv), ensuring independence of functional units within the system
- π― Attention Mechanism: Supports precise task filtering based on field values; nodes only focus on qualifying tasks (simulates attention focusing)
- π Duplicate Processing Prevention: Automatically marks processed tasks to avoid nodes repeatedly executing the same operations (improves system efficiency)
- π Logging System: Comprehensive node activity logging with both file and console output for tracking system behavior
- π Modular Construction: Provides node generator for one-click creation of standardized functional nodes, enabling rapid combination to build various application systems
- π» Cross-Platform: Supports Windows, Linux, and macOS systems
- π General-Purpose Workflow Orchestration: Supports building complex workflows, data pipelines, microservice components, etc. by combining multiple nodes
- π Pluggable Design: Node logic is independently encapsulated, allowing easy replacement, upgrade, or addition of new functional nodes to flexibly adjust system capabilities, suitable for plugin systems, automation toolchains, and other scenarios
bnos/
βββ data/
β βββ upper_data.json # Upper task data file (task source)
βββ node_test/ # Example functional node (component unit of the system, such as data processing node, business logic node, API node, etc.)
β βββ venv/ # Independent virtual environment
β βββ logs/ # Log directory
β β βββ listener.log # Node activity log
β βββ config.json # Node configuration (attention parameters)
β βββ listener.py # Listener program (task receiver)
β βββ main.py # Node processing logic (functional unit execution)
β βββ packet.py # Data packet definition (communication format)
β βββ output.json # Output data file (node output)
β βββ start.sh # Linux/macOS startup script
βββ create_node.py # Node creation tool (functional unit generator)
βββ README.md # Project documentation
- Python 3.6+
- pip (for creating virtual environments)
- Run the node creation tool in the project root directory:
python create_node.py- Enter the node name (e.g., data_processor, api_handler, task_scheduler), and the system will automatically generate:
- Complete node directory structure
- Independent Python virtual environment
- Standard configuration file
- Startup scripts (Windows:
start.bat/ Linux:start.sh)
Edit the config.json file:
{
"node_name": "data_processor", // Node name (functional unit ID)
"listen_upper_file": "../data/upper_data.json", // Path to upper task file (input channel)
"output_file": "./output.json", // Output file path (output channel)
"filter": { // Attention filtering rules (attention mechanism)
"type": "data_task"
},
"output_type": "data_result" // Output data type identifier
}Implement the process() function in main.py (functional unit execution logic):
def process(data):
"""Process input task and return results (functional unit execution)"""
value = data.get("data", 0)
return float(value) + 1Windows:
cd node_test
start.batLinux/macOS:
cd node_test
chmod +x start.sh
./start.sh| Field | Type | Description | Example |
|---|---|---|---|
node_name |
string | Unique node identifier (functional unit ID) | "data_processor" |
listen_upper_file |
string | Upper task file path (relative or absolute, input channel) | "../data/upper_data.json" |
output_file |
string | This node's output file path (output channel) | "./output.json" |
filter |
object | Attention filtering rules, key-value pair matching (attention mechanism) | {"type": "data_task"} |
output_type |
string | Output data type identifier (result type) | "data_result" |
- If
filteris an empty object{}, the node processes all tasks (broad attention) - If filtering rules are configured, tasks are processed only when they contain all specified fields with exact value matches (focused attention)
- Example:
{"type": "data_task"}means the node only focuses on tasks withtypefield value of"data_task"
Input Task Packet (upper_data.json):
{
"type": "data_task",
"data": 153,
"_processed_data_processor": true
}Output Result Packet (output.json):
{
"code": 0,
"type": "data_result",
"data": 154
}Add required Python packages to the node's requirements.txt file:
requests==2.28.0
numpy==1.23.0
openai==1.0.0
Then activate the virtual environment and install:
# Windows
venv\Scripts\activate
pip install -r requirements.txt
# Linux/macOS
source venv/bin/activate
pip install -r requirements.txt- View Logs: Check
logs/listener.logto understand node operation status (internal agent activity monitoring) - Monitor Data: Observe changes in
upper_data.jsonandoutput.json(internal agent signal flow tracking) - Test Attention: Modify the
filterrules inconfig.jsonto verify task filtering (attention adjustment)
[2026-04-24 17:26:11] [INFO] β
This is my task, starting processing
[2026-04-24 17:26:11] [INFO] β
Processing complete | Marked: _processed_perception_node
[2026-04-24 17:26:12] [ERROR] β Task packet format error
- Task Reception:
listener.pycontinuously monitors theupper_data.jsonfile (node receives tasks from upstream nodes) - Attention Filtering: Determines whether to process the task based on
filterrules inconfig.json(node attention focusing) - Duplicate Check: Checks if the task has been processed by the current node (via
_processed_<node_name>marker, avoiding duplicate execution) - Node Processing: Calls
main.pyto execute node functional logic, passing JSON task as command-line arguments (functional unit execution) - Output Results: Writes processing results to
output.json(node output, passed to downstream nodes) - Mark Completion: Adds processing markers to
upper_data.jsonto prevent duplicate processing (task completion marking)
- JSON Format: Ensure all JSON files are properly formatted, otherwise parsing errors will occur
- File Permissions: Ensure nodes have read/write permissions for data files
- Virtual Environment: Each node must use an independent virtual environment to avoid dependency conflicts
- Concurrency Safety: The current version does not support running multiple instances of the same node simultaneously
- Path Configuration: Paths in configuration files can be relative or absolute
- System Design: When designing systems, reasonably combine multiple nodes to form complete processing capabilities
As a general-purpose modular execution engine, BNOS is suitable for the following scenarios:
- π Modular Plugin Systems: Build scalable plugin architectures through node composition
- π Data Pipelines: Construct automated pipelines for data processing, transformation, and analysis
- β° Task Scheduling: Implement distributed scheduling and execution of complex tasks
- π Edge Computing: Deploy lightweight node networks on edge devices
- ποΈ Microservices: Build node-based microservice components and API gateways
- π οΈ Automation Toolchains: Create CI/CD, testing, deployment, and other automation toolchains
- π€ AI Agents: Build multi-node collaborative AI agent systems (perception, reasoning, decision nodes, etc.)
- π§ Brain-Inspired Computing Experiments: Conduct research experiments in brain-inspired computing and neural network simulation
A: Check the following:
- Confirm that
filterrules are correctly configured (attention settings) - Check
logs/listener.logfor filtering logs - Verify that
upper_data.jsonformat is correct
A: Manually delete the _processed_<node_name> field from upper_data.json (clear node memory)
A: Ensure Python is installed and the python -m venv command is available
A: Create multiple functional nodes (such as data processing nodes, business logic nodes, API nodes, etc.), configure their listen_upper_file and output_file to form collaborative workflows, jointly constituting a complete application system. It can also be used to build AI agents by combining perception nodes, reasoning nodes, decision nodes, etc. to implement agent functionality.
This project is licensed under the MIT License.
Contributions are welcome! Please feel free to submit Pull Requests or Issues.
Developed & Designed by Ahdong&Shouey Team Last Updated: 2026-04-24