Skip to content

pythaiml/funAGI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

funAGI

fundamental augmented generative intelligence framework

The funAGI workflow integrates memory management, UI/UX design, core AGI logic, user interaction interfaces, reasoning capabilities, API development, and communication as modules to create a robust and scalable AGI system. Integration of each modular component is crucial to enable funAGI to learn, adapt, and interact intelligently with its environment. The modular framework is designed to be extended to enhance FunAGI's capabilities, making it a versatile tool for fundamental Autonomous General Intelligence development and integration with existing language models. Logging has been seperated into the necessary components for understanding the premise --> conclusion workflow essential to creating a decision from reasoning.

funAGI is designed to create a robust and scalable fundamental augmented generative intelligence system integrated with memory management, user interaction interfaces, reasoning capabilities, and API management into a modular architecture. funAGI key components include the core AGI logic from SocraticRreasoning to learn from data and make decisions, validating and drawing logic conclusions from given premise to generate conclusion. Memory management efficiently stores and retrieves conversation memories and logic creates valid truth. funAGI is designed to build upon past interactions and improve over time. API management handles API keys using dotenv allowing seamless interaction with external models such as OpenAI, groq and claude to generate responses. User interfaces offer both Command Line Interface (funAGIcli) and Graphical User Interface (funAGI) ensuring versatile and user-friendly interaction experiences. funAGI modular design allows for easy scalability and integration of new functionalities, making it a versatile and reliable tool for developing more advanced AGI systems. funAGI is developing to meet the evolving demands of AGI research and application, fostering innovation and efficiency for further development of open source augmented intelligence as a solution.

UIUX has been split into three versions

funAGIcli.py maintains the terminal based interaction
funAGI.py is the UIUX graphical expression input --> response from Socratic conclusion
easyAGI.py is the UIUX graphical expression input --> response from Socratic conclusion with internal reaoning from premise to conclusion displayed ad infinitum
EXPERIMENTAL and hard on your API key with infinite calls v0.0.1

FundamentalAGI Project Setup

For a deeper dive into SocraticReasoning.py visit understanding-socraticreasoning

See also draw_conclusion(self)

project structure

funAGI.py: main script for fundamental AGI
funAGIcli.py run the terminal interaction version
agi.py: Core AGI logic
api.py: API key management
bdi.py: BDI (Belief-Desire-Intention) model
chatter.py: Interface for different chat models
logic.py: Logic table management and evaluation
memory.py: Memory management for storing dialogues and truth values
SocraticReasoning.py: Socratic Reasoning from logic

agi.py AGI workflow

API Key Management (api.py):

Loads API keys from api_keys.json or environment variables.
Manages adding, removing, and listing API keys.

Core AGI Logic (agi.py):

Initializes the AGI with API manager and chatter models.
Learns from data by creating propositions.
Makes decisions by leveraging SocraticReasoning.

Memory Management (memory.py):

Handles creating necessary directories.
Stores and loads conversation memories.
Stores valid truths and dialogue entries.

Socratic Reasoning (SocraticReasoning.py):

Manages premises and draws logical conclusions.
Logs actions and results.
Validates conclusions using LogicTables.

Logic Table Management (logic.py):

Manages logic variables, expressions, and truth tables.
Evaluates expressions and validates truths.
Logs all actions and saves beliefs.

Chat Models (chatter.py):

Interfaces for different chat models like GPT4o, GroqModel, and OllamaModel.

Key Components and Flow

API Key Management:
    APIManager class handles loading, saving, and managing API keys.
    In EasyAGI.__init__, the user is prompted to manage API keys if necessary.

Learning from Data:
    AGI.learn_from_data method processes input data into two propositions.
    These propositions are added as premises to the SocraticReasoning engine.

Making Decisions:
    AGI.make_decisions method invokes the Socratic reasoning process to draw a conclusion.
    The conclusion (decision) is returned.

Main Loop:
    EasyAGI.main_loop handles user input and processes it using the AGI system.
    Decisions are communicated back to the user and stored in short-term memory.

Belief-Desire-Intention Model (bdi.py):

Manages beliefs, desires, and intentions.
Processes BDI components for decision making.


funAGI.py is the UI. fundatmentalAGI funAGI has been published to showcase, audit and debug the easyAGI SocraticReasoning.py and logic.py

#########################################################################

Process Flow from User Input to Response

Step 1: User Input

Action: The user provides an input via the command line.
Input Example: "Explain the workflow to building AGI"

Step 2: Perceive Environment

Method: EasyAGI.perceive_environment
Action: The system captures the user's input.
Output: The user's input string is returned for processing.

Step 3: Learning from Data

Method: AGI.learn_from_data
Action: The user's input string is processed to extract propositions.
Process:
    The input string is split into two propositions based on a delimiter (e.g., ";").
    If the input contains only one proposition, the second proposition is set as an empty string.
    The propositions are added as premises in the Socratic reasoning engine.
Output: Two propositions are returned for further processing.

Adding Premises to Socratic Reasoning:
    Validates and adds each proposition as a premise.
    Logs each addition.

skipped ::::: Processing THOT:
    Iterates through reasoning methods.
    Generates intermediate conclusions.
    Aggregates combined results.

skipped ::::: Logging THOT Data:
    Logs premises, combined results, and final decision.
    Appends to THOT log file (thots.json).

Drawing a Conclusion:
    Generates logical conclusion using language model.
    Validates conclusion.
    Logs conclusion.

Communicating Response:
    Prints final decision to console.
    Logs communicated response.

Storing Conversation Memory:
    Creates DialogEntry with input and decision.
    Saves entry to STM.

This workflow provides a comprehensive view of how user input is processed, reasoned with, and responded to in fundamentalAGI funAGI.py system. Each component plays a critical role in ensuring the AGI provides accurate and logical responses based on the input provided. funAGI is the simplified agi --> SocraticReasoning --> logic --> response dialogue ################################################################

+-------------------+       +-------------------+       +---------------------+
|    User Input     | ----> | Perceive          | ----> | Learning from Data  |
| (Command Line)    |       | Environment       |       | (Extract Propositions)|
+-------------------+       +-------------------+       +---------------------+
                                      |
                                      v
                             +-------------------+
                             | Add Premises to   |
                             | Socratic Reasoning|
                             +-------------------+
                                      |
                                      v
                             +-------------------+
                             |  Process THOUGHT   |
                             |  (Various Reasoning|
                             |   Techniques)      |
                             +-------------------+
                                      |
                                      v
                             +-------------------+
                             |  Log THOUGHT Data |
                             +-------------------+
                                      |
                                      v
                             +-------------------+
                             |  Draw Conclusion  |     +-------------------+
                             |  (GPT-4 Model)    |  ---> [make decision]   |
                             +-------------------+     +-------------------+
                                      |
                                      v
                             +-------------------+
                             |Communicate Response|
                             |  to User           |
                             +-------------------+
                                      |
                                      v
                             +-------------------+
                             | Store Conversation |
                             | Memory (STM)       |
                             +-------------------+

install

(builds an openai API and groq API ready terminal interaction from openai or groq API key
with response from SocraticReasoning.py and logic.py with logging to local folders from memory.py)
logs SocraticReasoning
./mindx/socraticlogs.txt
logs errors
./mindx/errors/logs.txt
logs logic.py truth tables errors to
./mindx/truth/logs.txt
shows truthtable creation in
./mindx/truth/2024-06-23T22:44:49.670605_belief.txt

to do: include statement of belief in belief log; fix SocraticReasoning from ./mindx/socraticlogs.txt

memory of each input / response is stored in
./memory/stm/1719207889.json
as timestamped instruction / response

{"instruction":"agi","response":"a logical conclusion based on the premise of autonomous general intelligence (agi) is that it has the ability to independently perform a wide range of tasks at a level equal to or beyond that of a human being. agi would be capable of understanding, learning, and applying knowledge across a wide range of domains and tasks, and would be able to adapt to new situations and environments. it would be able to understand and respond to natural language, recognize and interpret visual and auditory information, and make decisions and solve problems based on its understanding. additionally, agi would be capable of self-improvement and continue to learn and get better at tasks over time. however, it is important to note that the development of agi also raises ethical and societal concerns that need to be addressed."}

example first output from "create a framework for AGI"

from mixtral using groq produced this reasonable response for meeting AGI framework as criteria

  1. knowledge representation and reasoning: the ability to represent and reason about complex knowledge, including objects, relationships, and events in the world. 2. natural language understanding and generation: the ability to understand and generate natural language in order to communicate effectively with humans. 3. perception and action: the ability to perceive and interact with the physical world through sensors and actuators. 4. learning and adaptation: the ability to learn and adapt to new situations and environments. 5. ethics and values: the incorporation of ethical principles and values to guide decision-making and behavior. 6. safety and security: the incorporation of safety and security measures to prevent unintended behavior and protect against malicious attacks. 7. scalability and efficiency: the ability to handle large amounts of data and complex tasks without requiring excessive computational resources. 8. verifiability and explainability: the ability to prove the correctness and trustworthiness of the agi system, as well as the ability to provide clear explanations of its reasoning and decision-making processes. these components are all crucial for the development of a safe, ethical, and beneficial agi system. however, it is important to note that this framework is not exhaustive, and that the development of agi will likely involve many additional considerations and challenges. for example, agi systems will need to be able to handle uncertainty and ambiguity in a way that is consistent with human reasoning and decision-making. they will also need to be able to deal with missing or incomplete information, and to be able to learn from and make decisions based on limited data. additionally, agi systems will need to be able to interact and cooperate with humans in a way that is safe and beneficial for both parties. this will require the development of effective human-machine interfaces and the ability for agi systems to understand and respond to human emotions, intentions, and social cues. another important consideration is the potential impact of agi on society and the economy. as agi systems become more capable, they may have the potential to disrupt traditional industries and occupations, and to create new ones.

#########################################################################################################################################################################

welcome to fundamental augmented generative intelligence funAGI.py point of departure version breaking changes v1

requirement

groq API key or
openai API key

INSTALL

git clone https://github.com/pythaiml/funAGI/
cd funAGI
python3 -m venv agi
source agi/bin/activate
pip install -r requirements.txt
# activate command line interaction (optional)
python3 funAGIcli.py
# activate easyAGI.py with internal reasoning EXPERIMENTAL (optional)
python3 easyAGI.py
# active graphical UIUX (required)
python3 funAGI.py

Releases

No releases published

Packages

No packages published

Languages

  • Python 90.9%
  • CSS 9.1%