This repository has been archived by the owner on Aug 13, 2024. It is now read-only.
Non-developer trying to understand what is actually required for an implementation. #25
ChronikDog
started this conversation in
General
Replies: 1 comment 1 reply
-
This isn't exactly how I would approach it but that's the beauty of a flexible framework - lots of ways to implement. You can also use LangChain to do most of it. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Like most of us AI is facinating but the inception of real autonomous entities is a remarkable thing to witness so I am trying to understand how this will work. I understand Python to an extent (fundamentals - functions - libraries etc and my next step is to learn threading) but I have no experience of this sort of thing and the teamwork involved.
So with the help of ChatGPT I tried to get an overview of what actually needs to be done. Be warned this is a long post so I will start with the summary:
To implement the ACE Framework, a team of coders will use Python to develop six distinct scripts, each corresponding to a hierarchical layer in the framework. Communication between these layers will be managed through northbound and southbound buses using Syslog for transparency and logging. MongoDB will be employed to store and manage structured data relevant to the layers' functioning. The development process will include initial setup, layer implementation, interlayer communication setup, database integration, testing, and final deployment. The aim is to create an autonomous, ethically-aligned machine entity capable of complex reasoning and decision-making.
(I actually think this is a really good summary although later on there are a lot more than 6 scripts. How will members work on this? Do they take a layer or two each or brainstorm each layer together? Who does boring stuff like documentation?)
So how about each part of the project?
Project Setup
1. Initialize the Repository: Create a new repository to host the project code.
2. Set Up Virtual Environment: For Python isolation.
3. Project Structure: Establish a directory structure for different layers and components.
(So far fairly easy to understand.)
Layer Implementation
For each of the six layers in the ACE framework, create a Python class or module:
1. Aspirational Layer
○ Natural Language Processing for ethical constitution.
○ Data models for storing values and judgments.
2. Global Strategy Layer
○ Context evaluation algorithms.
○ High-level goal setting.
3. Agent Model Layer
○ Self-model algorithms.
○ Identification of capabilities and limitations.
4. Executive Function Layer
○ Algorithms for resource allocation and project planning.
○ Scheduling tasks based on goals.
5. Cognitive Control Layer
○ Environment state monitoring.
○ Dynamic task selection algorithms.
6. Task Prosecution Layer
○ API wrappers for interaction with the external environment.
Error handling and task execution logs.
(Ok so each layer of the framework will need various algorithms and tasks)
Interlayer Communication Buses
Implement Northbound and Southbound buses using a technology like AMQP, REST, or sockets.
1. Northbound Bus
○ Collect and forward internal state and sensor data.
○ Implement logs and (perhaps) syslog for telemetry.
2. Southbound Bus
○ Implement directives and instructions dispatch.
○ Validation and translation of high-level directives into actionable tasks.
(This gives an idea of how the buses might work although I know Dave suggested using syslog)
APIs and Databases
1. API Integration:
○ Consider what external services this agent will interact with and implement the necessary API calls.
2. Database:
○ Choose an appropriate database like MongoDB or PostgreSQL for storing long-term state, logs, and any other persistent data.
○ Define data models and schemas.
(APIs I can understand and similarly databases for storing information as required. Data models and schemas I have no clue)
Logging and Monitoring
1. Implement logging solutions that capture important states and transitions.
2. Monitoring for performance metrics and possible anomalies.
(What are important states and transitions? Presumably all logging will reside in a database)
Testing
1. Unit Tests: Write unit tests for each layer's functions and methods.
2. Integration Tests: Test the interplay between different layers.
3. Stress Tests: Examine how the system performs under heavy loads.
(I am assuming that different members of the team will need to colaborate to test their components against each other's)
Documentation
1. Code Comments: Useful for maintaining comprehension of the code.
2. User Manual: Write a comprehensive user manual describing how to set up and use the system.
3. Developer Docs: In-depth documentation for future developers.
(Boring but necessary. Presumably one member of the team is responsible for collating this. Or maybe it just doesn't happen?)
Deployment
1. Containerization for easy deployment.
2. Instructions and scripts for launching the agent.
(Extensive use of Docker?)
So how does the project structure actually look? ChatGPT gave this structure of python modules:
ACE_Framework/
|-- aspirational_layer/
| |-- init.py
| |-- ethics.py
| |-- values.py
|-- global_strategy_layer/
| |-- init.py
| |-- context_evaluator.py
| |-- goal_setting.py
|-- agent_model_layer/
| |-- init.py
| |-- self_model.py
| |-- capabilities.py
|-- executive_function_layer/
| |-- init.py
| |-- resource_allocator.py
| |-- planner.py
|-- cognitive_control_layer/
| |-- init.py
| |-- task_selector.py
| |-- environment_monitor.py
|-- task_prosecution_layer/
| |-- init.py
| |-- api_wrapper.py
| |-- executor.py
|-- communication_bus/
| |-- init.py
| |-- northbound.py
| |-- southbound.py
|-- main.py
|-- requirements.txt
Consider each layer as a Python package or module within your larger project structure. This allows your team to work on different aspects of each layer concurrently, makes the code easier to maintain, and helps to keep things organized as the project grows.
(Makes sense)
Then I asked ChatGPT how syslog could be used for the buses:
Syslog is a logging protocol commonly used for system monitoring and event notification. You could adapt Syslog to serve as the communication bus in your ACE Framework. Here's how it might work:
Advantages of Using Syslog for Buses:
1. Human-Readable Format: Syslog messages are typically plain text and thus human-readable, aligning with the framework's transparency requirement.
2. Reliability: Syslog can be configured for various levels of reliability and fault tolerance.
3. Scalability: Syslog can handle a large volume of messages from multiple sources.
4. Compatibility: Syslog servers can run on various platforms, and clients can send messages via UDP, TCP, or even HTTP.
Basic Structure:
• A Syslog server would serve as the centralized communication hub.
• Each layer would have a Syslog client responsible for sending messages to (and possibly receiving messages from) the Syslog server.
Northbound Bus:
1. Lower layers publish their messages to the Syslog server with a specific tag or priority indicating it's a northbound message.
2. Upper layers listen for messages with that tag or priority.
Southbound Bus:
1. Higher layers publish their directives or instructions to the Syslog server with a different tag or priority indicating it's a southbound message.
2. Lower layers listen for these directives and act accordingly.
(I have messed about a bit with syslog and I think this would be relatively simple code to write)
And finally I asked ChatGPT how the database might be implemented. let's assume the use of MongoDB
MongoDB, a NoSQL database, is well-suited for implementing various aspects of the ACE framework given its flexibility and scalability. Here's a high-level overview of how you might use MongoDB to implement the database components:
Database Schema:
1. Aspirational Layer: Stores ethical constitutions, principles, and guidelines.
○ Collection: ethical_guidelines
○ Documents: { "principle": "Do no harm", "explanation": "The agent should avoid actions that cause harm to humans or the environment." }
2. Global Strategy Layer: High-level goals and strategies.
○ Collection: global_strategies
○ Documents: { "goal": "Maximize efficiency", "strategy": "Prioritize tasks that reduce overall computational load." }
3. Agent Model Layer: Self-models of the agent's capabilities and limitations.
○ Collection: agent_models
○ Documents: { "capability": "speech_recognition", "limitation": "Cannot understand multiple languages simultaneously." }
4. Executive Function Layer: Detailed project plans and resource allocation.
○ Collection: project_plans
○ Documents: { "project": "Data analysis", "resources": ["CPU", "Memory"], "priority": "High" }
5. Cognitive Control Layer: Tasks and their dynamic priorities.
○ Collection: task_queue
○ Documents: { "task": "Analyse sensor data", "priority": 3 }
6. Task Prosecution Layer: Execution logs and environment interactions.
○ Collection: execution_logs
○ Documents: { "task": "API Call", "status": "Error", "details": "Retry limit exceeded" }
(Not sure how these relate to a database, maybe the AI was a little off the mark with this)
This exercise has definitely given me a better idea on what is required but if anyone wants to contribute feel free as I am sure that there are parts of this that are way off the reality.
Beta Was this translation helpful? Give feedback.
All reactions