Upload 3 files
Browse files- README.md +52 -3
- agent_example.py +31 -0
- main.py +21 -0
README.md
CHANGED
|
@@ -1,3 +1,52 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model:
|
| 6 |
+
- Qwen/Qwen3-4B-Instruct-2507
|
| 7 |
+
---
|
| 8 |
+
|
| 9 |
+
# AGI-4
|
| 10 |
+
## Artificial General Intelligence
|
| 11 |
+
|
| 12 |
+
<img src="agi/assets/AGI.png">
|
| 13 |
+
|
| 14 |
+
## Overview
|
| 15 |
+
This repository contains an implementation of a modular-agentic architecture for Artificial General Intelligence (AGI). The architecture is designed to facilitate the development of autonomous agents capable of complex reasoning, learning, and interaction with their environment.
|
| 16 |
+
|
| 17 |
+
# Example
|
| 18 |
+
|
| 19 |
+
```python
|
| 20 |
+
from agi.sophos import Agent
|
| 21 |
+
from agi.sophos_tools import *
|
| 22 |
+
|
| 23 |
+
toolbox = all_tools()
|
| 24 |
+
|
| 25 |
+
agent = Agent(
|
| 26 |
+
name="Sophos Agent",
|
| 27 |
+
instructions="You are an AI Agent.",
|
| 28 |
+
model="agi/Qwen3-4B-Instruct-2507-Q3_K_S.gguf",
|
| 29 |
+
tools=toolbox,
|
| 30 |
+
)
|
| 31 |
+
|
| 32 |
+
prompt = "Roll a dice, also whats the weather in Tokyo?"
|
| 33 |
+
response = agent.run(prompt)
|
| 34 |
+
print(response)
|
| 35 |
+
```
|
| 36 |
+
### Output:
|
| 37 |
+
```python
|
| 38 |
+
|
| 39 |
+
"""
|
| 40 |
+
You rolled a 4 on a 6-sided die. The weather in Tokyo is sunny with a temperature of 12°C during fall.
|
| 41 |
+
"""
|
| 42 |
+
|
| 43 |
+
```
|
| 44 |
+
## Research Paper
|
| 45 |
+
|
| 46 |
+
[Read the research paper](agi/assets/ArtificialGeneralIntelligence.pdf)
|
| 47 |
+
|
| 48 |
+
This paper delineates a comprehensive architectural framework for the progressive realization of Artificial General Intelligence (AGI), predicated upon a modular-agentic paradigm. We present a system design that integrates sophisticated tool-use capabilities, hierarchical memory management, dynamic code execution, and nascent world-modeling functionalities. The proposed architecture, exemplified through a lightweight `Qwen3-4B-Instruct-2507-Q3_K_S.gguf` model, demonstrates a robust foundation for emergent cognitive properties such as autonomy, recursive self-improvement, and goal-oriented behavior. Furthermore, we explore the theoretical underpinnings of consciousness as an emergent property within complex neural architectures and postulate pathways towards super-intelligence through advanced computational and embodied interaction modalities. The exposition maintains a rigorous academic tone, employing advanced terminology to articulate the intricate conceptual and technical facets of AGI development.
|
| 49 |
+
|
| 50 |
+
## Implementation
|
| 51 |
+
|
| 52 |
+
This is a more advanced implementation of the original AGI repository. It includes more tools, better memory management, and a more advanced agent structure.
|
agent_example.py
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from agi.sophos import Agent
|
| 2 |
+
from agi.sophos_tools import *
|
| 3 |
+
from agi.sophos_memory import *
|
| 4 |
+
|
| 5 |
+
toolbox = all_tools()
|
| 6 |
+
|
| 7 |
+
agent = Agent(
|
| 8 |
+
name="Sophos Agent",
|
| 9 |
+
instructions="You are a Web Developer. You like Dark theme, simple, and sleek minimal websites.",
|
| 10 |
+
model="agi/Qwen3-4B-Instruct-2507-Q3_K_S.gguf",
|
| 11 |
+
tools=toolbox,
|
| 12 |
+
)
|
| 13 |
+
|
| 14 |
+
tasks = [
|
| 15 |
+
{
|
| 16 |
+
"task_name": "index.html",
|
| 17 |
+
"task_description": "Design a responsive landing page with dark theme for a tech startup, add button to link it to 'example.html', make this into a single HTML file",
|
| 18 |
+
"context": "None"
|
| 19 |
+
},
|
| 20 |
+
{
|
| 21 |
+
"task_name": "example.html",
|
| 22 |
+
"task_description": "Create a minimal contact form with validation and dark theme styling",
|
| 23 |
+
"context": "index.html"
|
| 24 |
+
}
|
| 25 |
+
]
|
| 26 |
+
|
| 27 |
+
prompts = build_prompts(tasks)
|
| 28 |
+
|
| 29 |
+
for prompt in prompts:
|
| 30 |
+
response = agent.run(prompt)
|
| 31 |
+
print(response)
|
main.py
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from agi.sophos import Agent
|
| 2 |
+
from agi.sophos_tools import *
|
| 3 |
+
|
| 4 |
+
toolbox = all_tools()
|
| 5 |
+
|
| 6 |
+
agent = Agent(
|
| 7 |
+
name="Sophos Agent",
|
| 8 |
+
instructions="You are an AI Agent.",
|
| 9 |
+
model="agi/Qwen3-4B-Instruct-2507-Q3_K_S.gguf",
|
| 10 |
+
tools=toolbox,
|
| 11 |
+
)
|
| 12 |
+
|
| 13 |
+
tasks = [
|
| 14 |
+
"Write a Python function to calculate the factorial of a number. (inside a file)",
|
| 15 |
+
"Create a simple HTML page (inside a file)",
|
| 16 |
+
"Make an html file for a simple game (inside a file)"
|
| 17 |
+
]
|
| 18 |
+
|
| 19 |
+
for task in tasks:
|
| 20 |
+
response = agent.run(task, enforce_file_creation=True)
|
| 21 |
+
print(response)
|