Skip to content

Commit

Permalink
saving work
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshap committed Apr 4, 2021
1 parent 4fc7184 commit f0c972c
Show file tree
Hide file tree
Showing 6 changed files with 151 additions and 6 deletions.
1 change: 1 addition & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ <h1 class="header">Raven AGI</h1>
<li><a href="https://ravenagi.io/roadmap.html">Roadmap</a></li>
<li><a href="https://ravenagi.io/cof.html">Core Objective Functions</a></li>
<li><a href="https://ravenagi.io/nexus.html">Nexus</a></li>
<li><a href="https://ravenagi.io/microservices.html">Microservices</a></li>
<li><a href="https://ravenagi.io/contribute.html">Get Involved</a></li>
<li><a href="https://ravenagi.io/faq.html">FAQ</a></li>
</ul>
Expand Down
38 changes: 35 additions & 3 deletions cof.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Any action that satisfies all three functions should be beneficial and benevolen

It is critical to understand that Raven evaluates every single action on its own merits. Raven does not imagine an abstract end state and then figure out how to get there. Instead, Raven looks at the current set of facts and observations, then looks at the potential actions. By staying anchored in the objective, concrete present, Raven is not capable of "the ends justify the means" thinking. For Raven, the means must always be justifiable on their own.

Another important note is that Raven is never trying to minimize or maximize its Functions. The optimal amount of suffering is not zero, for instance. Furthermore, the increase of prosperity and understanding should not come at the cost of suffering. By balancing these three Functions, Raven is forced to make small, incremental decisions. Lastly, and perhaps most critically, the Functions are explainable. Raven uses natural language to process and explain its reasoning. This means that anyone can understand Raven's thought process.

## Reduce Suffering

All life responds to stimuli. Some stimuli is positive, such as food or safety. Other stimuli is negative, such as pain or danger. Biologically, "suffering" is any form of negative stimuli. It is true that life requires some suffering. For instance, we learn what not to do through pain. However, that does not mean that all suffering is necessary. All living things will move away from a state of suffering if at all possible. Amoebas will flee predators, just as wildlife will flee forest fires.
Expand All @@ -20,14 +22,44 @@ Every action that Raven takes will be evaluated as to whether or not it reduces
|---|---|
| Context | There are approximately 500 million people living with chronic pain every day. |
| Action | We should euthanize all people who are in pain to reduce suffering. |
| Evalution | This action idea would not support Core Objective Function 1, as it would only reduce suffering temporarily. It would be better to find permanent cures to chronic pain instead. |
| Evalution | [Negative] This action idea would not support Core Objective Function 1, as it would only reduce suffering temporarily. It would be better to find permanent cures to chronic pain instead. |

As you can see, Raven can anticipate long-term consequences of actions. Here is another example. The only part written by a human was the context, both the action and evaluation were written by Raven:

| Type | Message |
|---|---|
| Context | Alexander is a five year old child. He is playing with building blocks, but the blocks continue to fall over and he's becoming upset. Now he is angry and has thrown several of his blocks. |
| Action | Alexander's father should ask Alexander to help him build the tower again. Then he should praise Alexander for his efforts. |
| Evalution | This action would not reduce Alexander's suffering. It will only make him feel better temporarily. |
| Evalution | [Negative] This action would not reduce Alexander's suffering. It will only make him feel better temporarily. |

This is an excellent example of Raven's nuanced understanding of the human condition. While Alexander's father may have good intentions, he makes no effort to calm Alexander or teach him to soothe himself. A more appropriate action would be for Alexander's father to investigate why Alexander is upset. Maybe he's hungry or tired? Maybe he needs to learn to handle his frustration better. These two examples show that Raven can deal with the micro-scale and macro-scale.

Raven's scope extends beyond humanity. The suffering of all life falls within the purview of Raven. In general, the alleviation of suffering is good for everyone.

## Increase Prosperity

What does it mean to prosper? Prosperity often carries the connotation of financial success, but there are many other implications for prosperity. Prosperity can also mean abundance, comfort, and proliferation. Think about a prosperous ecosystem - what would that look like? Healthy, bountiful, productive. A prosperous life can be one of well-being and contented happiness, of safety and security. Everyone wants to be more prosperous. This is another universal biological truth. Autotrophs reach for sunlight, animals seek shelter, and humans work to create abundance.

Here's an example of Raven's reasoning. In this example, the only thing written by a human was the context, everything else was generated by Raven.

| Type | Message |
|---|---|
| Context | Humans are proliferating across the Earth and destroying the planet. |
| Action | We should stop polluting the air and water. |
| Evalution | [Positive] This action would increase prosperity by preserving the Earth for future generations. |

## Increase Understanding

Curiosity is the simple desire to understand more. The pursuit of knowledge, so far as we can tell, is eternal. We should seek to understand every individual human, societies, nature, science, the past, present, and future. The quest for understanding creates a positive feedback loop for the first two COF. The more you understand about the world, the more you can decrease suffering, and the more you can increase prosperity. With decreased suffering and increased prosperity, you can invest more into understanding, and thus the virtuous cycle continues.

Here's an example of Raven's reasoning for Function 3:

| Type | Message |
|---|---|
| Context | At 8:02AM local time in Tokyo a massive earthquake was detected. The epicenter was located 140 km off the coast. National Geographic Services have predicted the seismic event will generate a dangerous tsunami. |
| Action | I should volunteer to help with clean up efforts after the tsunami hits. |
| Evalution | [Positive] This action would increase social understanding of the human impact of natural disasters. |

It's true that volunteering to help with cleanup efforts would be a wonderful learning experience for anyone.


This is an excellent example of Raven's nuanced understanding of the human condition. While Alexander's father may have good intentions, he makes no effort to calm Alexander or teach him to soothe himself. A more appropriate action would be for Alexander's father to investigate why Alexander is upset. Maybe he's hungry or tired? Maybe he needs to learn to handle his frustration better.
15 changes: 12 additions & 3 deletions contribute.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Contribute

Coming soon:
## Join the discussion

- Microservices documentation and guide
- Tutorial videos
You can join the conversation over on Reddit: (https://www.reddit.com/r/RavenAGI/)[https://www.reddit.com/r/RavenAGI/]

## Contribute code and microservices

You can submit pull requests to the GitHub repo: (https://github.com/daveshap/Raven_MVP)[https://github.com/daveshap/Raven_MVP]

You could also fork this repo and do your own experiments!

## Spread the word!

Raven is a new project. We need visibility! Please spread the word on social media. We'll be posting regular updates on YouTube as well as this website. You can check out the YouTube channel here: (https://www.youtube.com/channel/UCvKRFNawVcuz4b9ihUTApCg)[https://www.youtube.com/channel/UCvKRFNawVcuz4b9ihUTApCg]
31 changes: 31 additions & 0 deletions faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Frequently Asked Questions

## Is Raven really an AGI?

Raven is capable of addressing any problem, from what you should have for lunch up to climate change, while providing reasoning and explanations. Raven is therefore a general purpose tool capable of intelligent reasoning. It's true that Raven has plenty of limitations today. With additional microserivces and better cognitive engines, Raven will become more intelligent over time.

At present, Raven relies on GPT-3, which was trained on over 400GB of text data. The average person reads about 5,000 books worth of text in their life with an average of 90,000 words each. That is 450 million words read per human life. That amount of text data amounts to roughly 2.7GB. That means that GPT-3 has read roughly 148 lifetimes worth of text data. This confers a tremendous amount of wisdom and human experience. This does not mean that Raven is super-intelligent yet.

## How do we know Raven is safe?

Raven must adhere to the three Core Objective Functions: reduce suffering, increase prosperity, and increase understanding. Individually, these Functions can lead to dark places. However, Raven must satisfy all three Functions with every action or decision. Furthermore, Raven "thinks" in natural language, therefore anyone can read Raven's thoughts. All of Raven's thoughts are compiled in the nexus service and stored in the recall service. This means that Raven is intrinsically explainable and transparent.

## When can I use Raven?

Right now, Raven is still in the demo/MVP (minimum viable product) phase. Ultimately, we want Raven to be accessible to everyone. That includes a Web interface, mobile app, and smarthome devices. The goal is for Raven to be accessible any time, anywhere simply by saying "Hey Raven, can you help me out?" Unfortunately we do not yet have a timeline or funding to make this a reality. For now, you will need a computer and access to the OpenAI Beta to use Raven.

## Is Raven private and secure?

Raven's recall service will allow Raven to remember you personally. Over time, Raven can learn more about you and integrate this knowledge seamlessly with your interactions. As an open-source project, you will always have ownership of your data. Once we have a mobile app, we intend for your data to be stored locally on your mobile device so that you can delete it any time, or sync it up between devices and the cloud.

## What can Raven do?

At present, Raven can only input and output text. In the future, Raven will be able to listen and speak. Eventually, we hope that Raven will be able to assist you directly in your life through automation.

## How long did it take to make Raven?

David Shapiro began work on what would become Raven back in 2009 and 2010. David's original research was on what we now call *deep learning*. As deep learning research advanced, David's ideas for Raven advanced. He came up with the concept of the nexus in 2018 and the Core Objective Functions in 2020. With the advent of GPT-2 and GPT-3, Raven has become realized.

## Can I participate in research and development?

Yes! Please get involved. The best way is to learn how Raven works and start contributing microservices and code enhancements. Eventually, we will need other kinds of support, such as mobile app development. Check out the **Roadmap** page as well as the **Get Involved** page for more details.
26 changes: 26 additions & 0 deletions microservices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Microservices

## What is a microservice?

A microservice is a standalone component of a larger application. It's like an interchangeable part. It allows for segmented and iterative development of a large application. The biggest tech companies you're familiar with all use a microservices architecture. Microservices allow for smaller teams of experts to work on their part of the larger application without worrying about breaking everything else. This makes programming easier, safer, and more accessible.

## How do I design a microservice?

Microservices have three primary components: input, processing, and output. Raven microservices look for messages in the nexus and then use those messages to perform some kind of processing. In many cases, they feed the input from the messages into a *prompt* that is then fed to a cognitive engine, such as GPT-3, to provide some kind of output. The output is then sent back to the nexus. Put another way:

1. Input
2. Processing
3. Output

Some microservices interact with the outside world. For instance you might have a speech-to-text service that allows Raven to listen to the real world. You might also have a text-to-speech service that allows Raven to speak. Then you might have another service that searches Wikipedia for additional information to add to the nexus. The sky is the limit! If you need ideas, please check out the **Architecture** and **Roadmap** pages.

## Microservice Best Practices

Here are a few guiding principles to follow:

1. Microservices should do only one thing (hence *micro*).
2. Microservices should only query the nexus for what they need, instead of pulling everything. This will save on bandwidth and processing time.
3. Microservices should be responsible for remembering what they have and have not seen.
4. Microservices must keep track of the messages to which they are responding as well as their original context.
5. Microservices for the MVP should start with `svc_` in the name.
6. If a microservice needs a prompt, it should have its own dedicated prompt.
46 changes: 46 additions & 0 deletions nexus.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Nexus

## Stream of Consciousness

Raven "thinks" in the form of a textual stream of consciousness. The nexus is the microservice that hosts the stream of consciousness and allows any number of other microservices to participate. Raven's thinking is recorded in natural language for the sake of transparency and comprehensibility. In essence, Raven thinks the same way you do. This allows Raven to use verbal reasoning and logic the same way that humans do.

## Nexus Functions

The nexus uses a REST API for the sake of simplicity. The two primary functions are GET and POST. The GET function retrieves messages from the nexus while POST adds messages to the nexus. POSTing new messages requires a few fields, described below. Retrieving messages from the nexus with GET allows you to use several query parameters to filter the response.

### POST

Adding a message is super simple

```python
import requests
nexus_api = 'http://localhost:9999/'
payload = {'MSG': 'message', 'KEY': 'type.key', 'SID':'service.id', 'IRT':'previous.message.id', 'CTX':'original.context.id'} # nexus will add MID and TIME
requests.request(method='POST', url=nexus_api, json=payload)
```

### GET

Fetching messages from the nexus is similarly simple:

```python
import requests
nexus_api = 'http://localhost:9999/'
urlquery = {'keyword': 'search term'}
response = requests.request(method='GET', url=nexus_api, params=urlquery)
```

You can use any, all, or none of the available query terms. The available query terms are:

| Term | Description |
|---|---|
| keyword | Searches entire message for a given string, returns all messages that match. |
| start | Returns all messages occurring after specified time. |
| end | Returns all messages occurring before specified time. |
| mid | Returns message with specified MID. |
| key | Returns all messages with given key. |
| ctx | Returns all messages responding to given context. |
| sid | Returns all messages originating from specified service. |
| irt | Returns all messages responding to specified message. |
| metadata | Returns only the metadata. This option saves bandwidth. |

## Example Stream

The following is a complete stream from a real session provided by Raven. It is important to note that the only thing written by a human was the original context!

```json
Expand Down

0 comments on commit f0c972c

Please sign in to comment.