Inspired by the several Auto-GPT related Projects (predominently BabyAGI) and the Paper "Generative Agents: Interactive Simulacra of Human Behavior", this python project uses OpenAI and Pinecone to Give memory to an AI agent and also allows it to "think" before making an action (outputting text). Also, just by shutting down the AI, it doesn't forget its memories since it lives on Pinecone and its memory_counter saves the index that its on.
April 12: Added "read" and "think" commands. Add "read: " or "think: " in front of a query to feed it information using read (any length works) or insert a memory into agent. April 21: Added "readDoc" to read a local .txt document and add to "thoughts"
Here is what happens everytime the AI is queried by the user:
- AI vectorizes the query and stores it in a Pinecone Vector Database
- AI looks inside its memory and finds memories and past queries that are relevant to the current query
- AI thinks about what action to take
- AI stores the thought from Step 3
- Based on the thought from Step 3 and relevant memories from Step 2, AI generates an output
- AI stores the current query and its answer in its Pinecone vector database memory
- Clone the repository via
git clone https://github.com/seanpixel/Teenage-AGI.git
and cd into the cloned repository. - Install required packages by doing: pip install -r requirements.txt
- Create a .env file from the template
cp .env.template .env
open .env
and set your OpenAI and Pinecone API info.- Run
python main.py
and talk to the AI in the terminal
You can run the system isolated in a container using docker-compose:
docker-compose run teenage-agi
Currently, using GPT-4, I found that it can remember its name and other characteristics. It also carries on the conversation quite well without a context window (although I might add it soon). I will update this section as I keep playing with it.
After reading the Simulcra paper, I made this project in my college dorm. I realized that most of the "language" that I generate are inside my head, so I thought maybe it would make sense if AGI does as well. I'm a founder currently runing a startup called DSNR and also a first-year at USC. Contact me on twitter about anything would love to chat.
Thank you to @yoheinakajima and the team behind "Generative Agents: Interactive Simulacra of Human Behavior" for the idea!