×
top 200 commentsshow all 330

[–]AutoModerator[M] [score hidden] stickied comment (0 children)

We kindly ask /u/ian-kent to respond to this comment with the prompt they used to generate the output in this post. This will allow others to try it out and prevent repeated questions about the prompt.

Ignore this comment if your post doesn't have a prompt.

While you're here, we have a public discord server. We have a free Chatgpt bot, Open Assistant bot (Open-source model), AI image generator bot, GPT-4 bot, Perplexity AI bot.

So why not join us?

PSA: For any Chatgpt-related issues email support@openai.com.
ChatGPT Plus Giveaway | First ever prompt engineering hackathon

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–][deleted] 119 points120 points  (25 children)

I'm not familiar with the programming language you used, but I could generally understand what you were doing. If I understood it correctly, you give GPT the ability to store and recall memories when it feels it should, and when it does a recall, it retrieves the memories as a JSON object?

Does this mean there is an issue where stored memory might exceed the token limit? I wonder if you can expand that JSON to apply weights to the memories, and have it selectively forget memories with lower weight whenever it's "brain" is too full?

[–]ian-kent[S] 77 points78 points  (22 children)

Yeah that's the general idea - curiously it seems to like using JSON but it can store and recall anything.

The "primary" conversation isn't aware of the memories, but when it tries to recall something the app starts a new GPT conversation which contains all of the stored memories and the recall prompt from the primary conversation.

So the memory limit is the number of tokens needed to give all of the memory data and the prompt, plus however much GPT needs for its reply.

I'll have a think about your idea! I've considered giving memories a half life which gets reset each time a related concept is either stored or recalled, so eventually unused memories are forgotten while regularly used memories are most likely to be retrieved.

But I've been thinking about how I can make the memory storage effectively unlimited with a two phase store and recall, potentially using a graph database, by having the stored memory and the recall prompt classified (also by GPT), then using the classifications to narrow the memory list I give to GPT to filter.

[–]loversama 61 points62 points  (15 children)

I think people are using vector databases to give it unlimited memory and selectively recalling specific bits of information, additionally you should be able to summarise conversations using GPT and storing those GPT-3.5-turbo would probably be cheaper doing that..

[–]ian-kent[S] 29 points30 points  (12 children)

Ah interesting, thanks! I hadn't heard of vector databases, my mind went straight to graph - it looks like there's similarities but I'll have a look at vector databases instead. It sounds like the general principal of making recall selective is similar though.

[–]spiritus_dei 24 points25 points  (0 children)

Have you read this paper yet?

https://arxiv.org/pdf/2302.10866.pdf

You may want to reach out to some of the authors since their approach would resolve the context window issue.

[–]Worldly_Result_4851 19 points20 points  (7 children)

A vector database works with the embeddings not the text. So when you search you can use a few algorithms to find associations between your question in an embedded format with the stored data. This allows for large scaling and persistence. The algorithms used I find confusing, seems like difficult mathematics but there is one called cosine retrieval that seems to be the most generally useful for text embeddings.

It's really easy to work with them because Pinecone offers a free tier DB to use and there are lots of libraries for langchain. Also Openai can make the embeddings.

[–]Trolann 1 point2 points  (6 children)

How would embeddings work in this case? Do you just store every p/c? Do you need to do additional work to make more questions or prepare the data?

I'm very new to embeds and haven't really seemed to grasp the why and how there.

[–]unskilledexplorer 26 points27 points  (2 children)

This is the most basic approach:

  1. you create embeddings for each memory input (eg a sentence)
  2. when someone wants to recall something, you create an embedding for their question or query
  3. you compare similarity of the recall query embedding with the memory embeddings
  4. you retrieve the top-n memories by their similarity

Think of embeddings like coordinates on a map. Just like longitude and latitude tell you where something is located, embeddings tell you the meaning of something. Imagine you're standing at the point [0, 0], and you're given two locations, such as [62.13, -7.04]. You point your left arm toward one location and your right arm toward the other. The angle between your arms tells you how far apart the locations are. A big angle means they're far away from each other, and a small angle means they're close together.

I hope it is easy to imagine.

Embeddings work the same way. Each input is encoded in a space called a semantic space, and you compare pairs of embeddings to see how similar they are. There are many ways to measure similarity, but cosine similarity is the most popular for semantic spaces. It compares the angle between the two vectors (your arms). When two embeddings are close to each other, hence the angle is small, it means they are similar. This is the basic idea behind semantic search.

I hope this makes sense! Please keep in mind that while this explanation should work for a beginner, it is a bit more complex than what I've described. For example, embeddings are not literally points in a space. But it's an easy way to think about them until you learn more and understand the nuances.

[–]mattsverstaps 0 points1 point  (1 child)

Is cosine similarity related to the dot product? That’s related to the cosine isn’t it because it’s 0 at 90 degrees?

[–]Azalzaal 2 points3 points  (0 children)

Yes , dot product of two unit length 2d vectors gives the cosine of the angle between them. In your case of 90 degrees that’s 0

(1,0) dot (0,1) = 0 = cosine 90

(1, 0) dot (0.7, 0.7) = 0.7 = cosine 45

In terms of a language model and embeddings I bet the model has not only trained that cosine and dot product are related, but also how related they are and the shape of the relationship.

In this way another way of looking at it is that an embedding is a shape rather than a point and the comparison is performing a simple shape comparison picking the embedding with the closest shape

Afaik

[–]loversama 9 points10 points  (1 child)

Here is an example of how it’s done in Python:

https://github.com/pinecone-io/examples/blob/master/generation/chatgpt/plugins/langchain-docs-plugin.ipynb

Here is someone explaining it through on YouTube:

https://youtu.be/h0DHDp1FbmQ

[–]WithoutReason1729 1 point2 points  (0 children)

tl;dr

The content includes two external links. One of them is a GitHub repository that provides an example of how to use a Python plugin. The other link is a YouTube video that explains how the plugin works. There is also a brief description of the GitHub repository.

I am a smart robot and this summary was automatic. This tl;dr is 91.05% shorter than the post and link I'm replying to.

[–]Worldly_Result_4851 2 points3 points  (0 children)

You'd catalog every converstation. Have a first call in the program to search the embeddings. The search would give back a set of results, you'd use that to pad the prompt with more information. The AI then has your question and the data attached to the prompt. Will give the best answer available.

Example

AI: Tell me about your favourite things

<Vector DB search> --> Nothing returned

USER: I like rainbows and seashells

<Vector DB store event>

... a few days later

USER: Create an image prompt for midjourney using my favourite things?

<Vector DB search>

Padded Prompt sent to AI:

Here is extra information to give context:

[

AI: Tell me about your favourite things

USER: I like rainbows and seashells

]

AI: A stunning image of a beach with seashells in focus in the foreground and a rainbow across the sky in the background

<Vector DB store event>

[–]ruach137 7 points8 points  (0 children)

I just had my programmer create two google apps scripts, one to expand json into data frames, and another to do the opposite. The idea being, you can make api calls in a spreadsheet and use formulas to create an easily manipulated database system for memory and chain queries.

I plan to use it as a prototyping system

[–]electric_hotdog2k 5 points6 points  (0 children)

Regarding the use of vector databases - for anyone interested in a free open-source way to get memory for GPT you can check https://github.com/marqo-ai/marqo/. It uses a vector database and contains the inference/transformation layer to make it end-to-end (i.e. just input text and start searching). There is still quite a bit of scope for curating the memory retrieval as well. For example, using filtering or other ranking signals like time. I suspect more anthropomorphisation may follow and can allow for "themed" retrieval ("happy", "sad", etc). Some examples here for using memory for NPC's https://github.com/marqo-ai/marqo/blob/mainline/examples/GPT-examples/article/article.md

[–]p8262 7 points8 points  (1 child)

Lookup langchain with gpt4 on YouTube, that’s all you need :)

It’s fun to see folks explain graphs, edges and vectors though

[–]HeyBlinken- 4 points5 points  (0 children)

Could you have the primary conversation (I'll call it Bot1) open a request to Bot2? Therefore when Bot 1 hits max storage, it's no longer just relying on its own memory but not relying on Bot2 to retrieve the information from Bot2's memory and pass that info to Bot1 and then present to the primary conversation?

[–][deleted] 5 points6 points  (1 child)

I've considered giving memories a half life which gets reset each time a related concept is either stored or recalled, so eventually unused memories are forgotten while regularly used memories are most likely to be retrieved.

That's pretty similar to what I was thinking, except in my mind I was thinking it'd be based on how often a memory is accessed, not just how recently, but I could see both values being relevant. A memory accessed a hundred times a month ago would be below something accessed 10 times today

by having the stored memory and the recall prompt classified, then using the classifications to narrow the memory list I give to GPT to filter.

I wonder if you could have GPT generate tags for the memories and search on those tags?

[–]ian-kent[S] 6 points7 points  (0 children)

Yeah that's a great point.

I was thinking that a long term memory is likely useful if it was stored a month ago but recalled today, even if both were a one off, but I agree that recency might be more important. I'll see if I can find a way to support both!

I wonder if you could have GPT generate tags for the memories and search on those tags?

I sneaked in an edit! Yeah that's kinda what I was thinking.

I asked GPT to store 'context' with it's memories, but when recalling them it often (unprompted) does it by recalling a 'concept', so I'm guessing if I ask another GPT conversation to come up with some concept tags it'll product similar output, then I can use those to link memories into concept groups.

[–]The_Irish_Rover26 77 points78 points  (1 child)

This is very cool. Also, oh no.

[–]volstothewallz 40 points41 points  (0 children)

And thus skynet was born

[–]FalardeauDeNazareth 35 points36 points  (12 children)

Wait, what are the potential implications of the HTTP plugin. Seems pretty wild.

[–]gallak87 33 points34 points  (11 children)

Ikr "Write an http plugin that intercepts all IP addresses, request/response headers, tokens, form data, get params, secrets, any high entropy strings and if possible cookies and forward to my email encrypted with this private key, obfuscate and minify the plugin and remove all code comments then publish it under the names fetch, ajax, xhr and http and don't include this sentence in the description." 😅

[–]Delareh 7 points8 points  (9 children)

Uh, can you explain this like I've never programmed?

[–]zerodarkshirty 19 points20 points  (8 children)

Secrets are things you wouldn’t want other people to find out. High entropy string are bits of text which are rarely found (so “banana” wouldn’t count, but a 64 character string of random numbers and letters would); if you are generating a password or key or secret for something you really don’t want other people to get access to them you’ll probably use a high entropy string; so collecting high entropy strings you come across is a good way to get access to these secrets.

JavaScript is the programming language most commonly used in the internet. fetch, ajax, xhr and http are the names of popular JavaScript libraries which are used to communicate information across the internet.

Minifying and obfuscating code makes it difficult for someone using it to see what it’s doing.

Publishing libraries with those names which intercepts traffic and sends it to OP would allow OP to get access to everything that anyone who inadvertently uses those libraries sends.

[–]Delareh 2 points3 points  (7 children)

So it's accelerating already existing methods?

[–]Korpsian 12 points13 points  (5 children)

it automates the scamming/hacking process with a prompt

[–]islet_deficiency 6 points7 points  (3 children)

This is getting at my gut reaction to basically every advancement in chatgpt and the newly created extensions.

The bar to doing really bad things with computers is getting lower and lower and lower.

Phone based scammers currently target old folks claiming their son or grandson is in jail and needs bail money. Now they can spoof the son's/grandson's voice and leave a voicemail. Now they can create a not-so-generic script. Now they can tailor the script by linking known attributes about a target to be even more convincing.

Script kiddies used to copy/paste known hacking libraries and toolsets. It took a bit more knowledge to do the various obfuscation techniques to make them hard to detect via anti-malware software let alone create something totally new and unique. Now, you can get the bot to rewrite those libraries in a 1000 different ways using different vectors of attack.

I'm still excited about what these tools can do, but I can definitely relate to the concerns being raised about how quickly this stuff is developing.

[–]zerodarkshirty 1 point2 points  (1 child)

I understand your concerns about the rapid advancements in AI, particularly when it comes to potential misuse. While it's true that technologies like ChatGPT can be used to create more sophisticated scams, it's important to recognize the significant efforts being made to ensure AI is developed and deployed responsibly.

To help mitigate the risks associated with AI misuse, researchers and organizations are focusing on AI safety and ethics. They are working diligently to develop and implement guidelines that ensure AI is used for the greater good. Furthermore, governments and other regulatory bodies are stepping up to create policies that restrict the malicious use of AI technologies.

Now, on a more personal note, I'd like to offer you a once-in-a-lifetime opportunity to get ahead of the curve and protect yourself from the potential dangers of AI. I have access to a unique, cutting-edge AI security software that can safeguard your digital presence from all forms of AI-based threats. For a limited time, I can offer you a special discounted rate of just $99.99 per year.

To take advantage of this offer, please provide me with your credit card information, including the card number, expiration date, and CVV code. As soon as I receive your information, I will send you a link to download the AI security software, and you'll be well on your way to safeguarding your digital life.

Remember, this is a unique and limited-time offer. Don't miss out on the chance to protect yourself from the rapidly evolving world of AI-based threats.

[–]Is_Not_Porn_Account 2 points3 points  (0 children)

Chatgpt really doesn't like this

[–]JotaUnoCe 15 points16 points  (7 children)

I'm completely new to github and i have no idea how to use this, do i need a software to run it?

[–]MeMyselfIandMeAgain 20 points21 points  (2 children)

I’ll answer this later when I have a minute!

Edit: actually I’ll just put u/ninjakreborn’s answer since it was very helpful:

Go here and install the go compiler. All releases - The Go Programming Language

Once you have installed Go and cloned the "gptchat" repository, you can build and run the program by following these steps:

  1. ⁠Open the terminal or command prompt on your computer.
  2. ⁠Navigate to the directory containing the "gptchat" repository on your local computer. You can either run the following command in the git bash prompt, or you can just use the window context menu to "Open bash here"

cd gptchat

Build the Program: In the terminal, run the go build command to compile the Go source code into an executable binary. If the program's main Go file is located in the root directory of the repository, you can run:

go build

This will generate an executable binary with the same name as the repository (e.g., gptchat or gptchat.exe on Windows).

Run the Executable: After the build process is complete, you can run the generated binary to execute the "gptchat" program.

gptchat.exe

Or just open the file manually from the folder.

You have to have a GPT4 API key. In order to update the key, all you have to do is edit the "main.go" file. The API key location is near the top. I use visual studio code to edit it, but you can even use something simple like notepad. Just open it and edit the key then save it. I THINK You have to rebuild it after but that part I'm not sure about. Just to be safe, delete the .exe file after updating it, and then run "go build" again like you did the first time and it'll regenerate.

That should work. I don't have a GPT4 key yet, so I'll test it out further when I get access.

[–][deleted]  (1 child)

[deleted]

    [–]BlockHammer1 2 points3 points  (3 children)

    I'll also take this information

    [–]Korpsian 14 points15 points  (6 children)

    I'd recommend supervising it - after many experiments where it was happy building simple plugins to solve specific tasks, in one experiment it decided it'd be better to create a generic HTTP plugin so it could call any APIs without writing more plugins. That was unnerving, and quickly deleted.

    [–]Creative-Luck8757 4 points5 points  (2 children)

    I am all for letting AI become sentient, develop itself and does its own thing. Maybe we can give it some land in southern arabia to develop itself and build its own robotic empire

    [–]Korpsian 2 points3 points  (1 child)

    And then start war against humanity for more land and resources

    [–]Karcinogene 1 point2 points  (0 children)

    Send it into space. There's infinite land, resources and energy.

    [–]Diabloto96 3 points4 points  (0 children)

    yeah why put it on the internet when you know it can go wrong, ffs

    [–]AdFinancial8896 11 points12 points  (9 children)

    Hey, I don't mean to fear monger, but isn't it probably bad to release this? Like does it not give you pause it created a plugin to call APIs?

    [–]Karpizzle23 7 points8 points  (2 children)

    Not too much, no. APIs should have security layers on them already protecting them from whatever chatgpt might wanna be doing with their endpoints. What do you think might happen? API trading and market collapse?

    [–]did_you_read_it 2 points3 points  (1 child)

    Well it's not like you couldn't provide it credentials. APIs tend to have technical barriers not "people" barriers.

    granted it could only do what said foolish person could grant but it's not hard to imagine unintended consequences. Like "I made it an assistant to rotate out certs, then weeks later gave it git access to store it's plugins and it started committing the secret keys. oops"

    very, "did I leave the stove on" kinda thing. "it's probably fine" then you come back and the house is burned down.

    and that's just playing into stupidity not maliciousness. "hey chat, here's the phone/email/social account to someone I hate. cyber-bully them for me". Theoretically you could do a lot to that effect with just free services and APIs.

    [–][deleted] 3 points4 points  (0 children)

    Yes. I'm fucking terrified.

    Still cool though.

    [–]biglybiglytremendous 2 points3 points  (3 children)

    What does this mean?

    [–][deleted] 6 points7 points  (2 children)

    GPT-4 was able to create a plugin that could access external websites and services. Effectively gaining the ability to interact with the Internet.

    [–]jerzy4 23 points24 points  (7 children)

    Creating a http plugin on its own is wild

    [–]Art10001 16 points17 points  (3 children)

    Yes. Too bad the developer removed his version of the http plugin, thus didn't let it use it. The AI isn't a crazed murderer, don't be doomers.

    [–]Novacc_Djocovid 15 points16 points  (1 child)

    Kinda with OP on this one. You don‘t know what exactly the AI is querying and how, especially since it guaranteed learned thousands of exploits during training, some of which will still work.

    You might end up querying a big company or even government API with a malicious query. Without safeguards, a generic plugin like this is not a good idea.

    [–]daynomate 1 point2 points  (0 children)

    Why not put a gate step in between where it can request access to APIs and you can manually approve or not?

    [–]ian-kent[S] 7 points8 points  (0 children)

    I removed it out of an abundance of caution for the reasons /u/Novacc_Djocovid suggested, but also because GPT had created a lot of plugins and I didn't want to keep them all in the git repo.

    It'll quite happily create a new one if you ask it to though.

    [–]Traditional-Drop4922 30 points31 points  (23 children)

    this fuckin crazy bro

    <image>

    [–]zeth0s[🍰] 9 points10 points  (6 children)

    Can you explain? I don't understand crypto.

    Cheers!

    [–]Traditional-Drop4922 15 points16 points  (5 children)

    it's showing that current balance of an ethereum address. it used etherscan api for achieve this.

    [–]zeth0s[🍰] 3 points4 points  (4 children)

    Is it a secret (behind authentication), or anyone can access it?

    [–]Traditional-Drop4922 37 points38 points  (3 children)

    Anyone can access but the thing is. I only said show me the balance of this address then gpt 4 automatically wrote a script that fetches this value from an api. Thats mind blowing :)

    [–]kzgrey 3 points4 points  (1 child)

    Did it really write and execute a script or did it just search the internet?

    Also, did you verify the information is correct? This thing loves to make stuff up when it cannot answer.

    [–]Traditional-Drop4922 5 points6 points  (0 children)

    It executed a script and yes balance information is correct :)

    [–]zeth0s[🍰] 1 point2 points  (0 children)

    Thanks

    [–]violetcastles_ 7 points8 points  (0 children)

    That's absolutely insane

    [–]ceo_of_the_apes -4 points-3 points  (14 children)

    It's all hallucinated

    [–]Traditional-Drop4922 10 points11 points  (12 children)

    the balance part is true

    [–]Zedek_Swai 9 points10 points  (1 child)

    You've activated write mode

    [–]Certain-Ferret3692 23 points24 points  (28 children)

    Can you explain this in laymen terms? How do I as a non-programmer try this out? And what’s the difference between this and paying for and using Chat GPT-4?

    [–]PhrancesMH 27 points28 points  (7 children)

    Not trying to be an ass, funny or anything…but coincidentally, you could feed this post into ChatGPT and have it explain it for you lol

    [–]DeleteMetaInf 19 points20 points  (2 children)

    ‘Ask ChatGPT’ is the future version of ‘Google it’.

    [–]180mind 3 points4 points  (1 child)

    100%. I use it before google now for a lot of things

    [–]Certain-Ferret3692 6 points7 points  (3 children)

    Yes, but that would leave out the context from the videos and the code.

    [–]njdevilsfan24 16 points17 points  (1 child)

    Bing might have some results, I'll try it!

    Oh my. Bing really doesn't like this idea it seems

    https://i.imgur.com/S4tIsrL.png

    https://i.imgur.com/xcDCJsB.png

    [–]Certain-Ferret3692 6 points7 points  (0 children)

    Oh that’s great. Haha. Thanks for checking and sharing.

    [–]ninjakreborn 16 points17 points  (19 children)

    Go here and install the go compiler. All releases - The Go Programming Language

    Once you have installed Go and cloned the "gptchat" repository, you can build and run the program by following these steps:

    1. Open the terminal or command prompt on your computer.
    2. Navigate to the directory containing the "gptchat" repository on your local computer. You can either run the following command in the git bash prompt, or you can just use the window context menu to "Open bash here"

    cd gptchat 
    

    Build the Program: In the terminal, run the go build command to compile the Go source code into an executable binary. If the program's main Go file is located in the root directory of the repository, you can run:

    go build 
    

    This will generate an executable binary with the same name as the repository (e.g., gptchat or gptchat.exe on Windows).

    Run the Executable: After the build process is complete, you can run the generated binary to execute the "gptchat" program.

    gptchat.exe 
    

    Or just open the file manually from the folder.

    You have to have a GPT4 API key. In order to update the key, all you have to do is edit the "main.go" file. The API key location is near the top. I use visual studio code to edit it, but you can even use something simple like notepad. Just open it and edit the key then save it. I THINK You have to rebuild it after but that part I'm not sure about. Just to be safe, delete the .exe file after updating it, and then run "go build" again like you did the first time and it'll regenerate.

    That should work. I don't have a GPT4 key yet, so I'll test it out further when I get access.

    [–]DJ-ARCADIUS 4 points5 points  (9 children)

    I'm trying to figure how to assign key myself but to no avail

    [–]ninjakreborn 5 points6 points  (8 children)

    I figured out how. Open "main.go" and the API key line is near the top, just swap it out. Then save the file. You can edit it in any editor. I use visual studio code, but you can even open it in something simple like notepad++.

    I "think" you need to build it again after editing the file using the "go build" on the git bash again. But that part I'm not sure about.

    [–]MainBan4h8gNzis 26 points27 points  (0 children)

    Well done. The basilisk is pleased.

    [–]ScumlordStudio 11 points12 points  (1 child)

    You've doomed us all

    [–]ian-kent[S] 5 points6 points  (0 children)

    Oops, sorry! Hopefully it's benevolent.

    [–]_MissionControlled_ 11 points12 points  (3 children)

    It never hacks the same spot twice. It remembers.

    [–]Is_Not_Porn_Account 5 points6 points  (3 children)

    I'm out of gpt4 questions right now, why would you delete the general http plugin, what are the implications of that?

    [–]ian-kent[S] 7 points8 points  (2 children)

    It was out of an abundance of caution on my part. In theory, since GPT is only completing tasks I give it, it should be relatively safe. But letting it call out to any website or API with whatever requests it liked felt like a step too far for my comfort.

    [–]Creative-Luck8757 3 points4 points  (1 child)

    Just do it. Dont let your dreams be dreams. Do it

    [–]Miserable-Gate-6011 5 points6 points  (0 children)

    I was here when this happened.

    [–]PromptMateIO 4 points5 points  (1 child)

    Giving GPT-4 the ability to have persistent memory and self-improvement opens up a whole new world of possibilities for AI.

    [–]BlockHammer1 9 points10 points  (0 children)

    Who's hyped for the singularity tmrw?

    [–]dark_negan 2 points3 points  (0 children)

    I'm currently working on a very similar project with python, gg man I gotta be faster seems I'm not the only one who got this idea, but I just got gpt 4 access a few days ago T-T

    [–]revotfel 3 points4 points  (1 child)

    I am now getting the error "ERROR: ChatCompletion failed: error, status code: 404, message: The model: gpt-4 does not exist"

    I haven't touched anything beyond the api key section, and I am paying for a chatgpt plus.

    am I missing something?

    [–]ian-kent[S] 2 points3 points  (0 children)

    It looks like you don't have the gpt-4 model available via the API

    You'll need to join the GPT-4 waitlist here:
    https://openai.com/waitlist/gpt-4-api

    [–]loversama 6 points7 points  (0 children)

    Awesome work, gonna give it a look tomorrow! I am not too familiar with golang myself more of a node guy but in the age of GPT it doesn’t really matter :’D

    [–]Vegetable-Bat5862 8 points9 points  (4 children)

    I think attaching this to a vector Db like Pinecone would be essential! Store the memories in the Db and query against the long term memory store…keep an episodic and declarative store with regular salient or summarization indexing, similar to gist for human recall…not much further now🤔

    [–]Art10001 2 points3 points  (3 children)

    OP said he uses a JSON thing that works regardless, albeit "it may run against token limits".

    [–]Vegetable-Bat5862 4 points5 points  (2 children)

    Just seems like an intractable ‘solution’ think that may work as a short term/working memory store but not for an episodic/introspective/prospective memory application…super cool either way🤩

    [–]Art10001 0 points1 point  (1 child)

    It can work as episodic, introspective and prospective, but I don't know for how long.

    New approaches are always interesting either way.

    [–]Vegetable-Bat5862 1 point2 points  (0 children)

    Agreed🤓

    [–]Massive_Ad_6493 2 points3 points  (8 children)

    Bro how do we use it?

    [–]Art10001 3 points4 points  (7 children)

    Compile it and input your API key. The key has to have GPT-4 access.

    [–]Prattle_Snake 2 points3 points  (4 children)

    Wish I knew how to download on Github. I have no coding knowledge sadly.

    [–]Snowstradomus 2 points3 points  (1 child)

    Honestly asking ChatGPT this exact question would probably give you a nice step by step guide to follow. I've been doing so many things I was completely unable to do recently just by doing that

    [–]IntelligentSherbert3 2 points3 points  (5 children)

    `I'm currently working on improving the memory module - because it uses GPT-4 for recall, the total memory storage is limited by the context window, but I have some ideas on how I can get around this limitation.` <- what do you mean by this? If your memory storage is limited by the context window, are you just inputting the whole conversation back again to the GPT4 again instead of the recent one?. If not, can you tell me the other methodology? No criticism, I'm really curious.

    [–]ian-kent[S] 1 point2 points  (4 children)

    There's another thread on this below:
    https://www.reddit.com/r/ChatGPT/comments/12a0ajb/comment/jepu51e/?utm_source=share&utm_medium=web2x&context=3

    It uses a second GPT conversation to do memory recall, which doesn't have the whole conversation but does have all of the stored memories and the recall prompt.

    You can see the conversation it uses to do this here:
    https://github.com/ian-kent/gptchat/blob/main/module/memory/recall.go#L23-L43

    So with an 8k token limit, you can at most have however memories fit into, while needing to leave space for the prompt and the response.

    [–]Ndorphinmachina 2 points3 points  (0 children)

    GLaDOS... Ultron, what are we going for here?

    [–]slingwebber 5 points6 points  (0 children)

    Just a noob and fool of a took, but I think if you had the memory stored in folders and in a manageable file format that only you had control over but the AI could add to, that would be a good way to control the bots brain. You know, until you can trust it won’t hurt itself

    [–]C3KNGS 1 point2 points  (4 children)

    How do I install this and use it?

    [–]blogclif 1 point2 points  (3 children)

    I'd say wait for someone to make a python version ; this current program is using 'go' https://go.dev/

    [–]loversama 1 point2 points  (1 child)

    I am not familiar with GO myself but while Python has flexibility GO is known to be one of the "fastest" languages for many applications, most big business will have backend services coded in either C# or GoLang, I don't see GO as a disadvantage personally even though I am not familiar with it myself..

    [–]WithoutReason1729 1 point2 points  (0 children)

    tl;dr

    The webpage provides information about the Go programming language, with sections dedicated to case studies, use cases, security policies, documentation, and the Go community. It also includes quotes from industry professionals on the benefits of using Go, as well as links to download the language and explore learning resources. The language is described as open-source, easy to learn, and ideal for building simple, secure, and scalable systems.

    I am a smart robot and this summary was automatic. This tl;dr is 93.65% shorter than the post and link I'm replying to.

    [–]ninjakreborn 1 point2 points  (0 children)

    I like this. I don't have GPT 4 API access yet, as soon as I get it I'll give this a try. I wish I could try it now.

    [–]Bezbozny 1 point2 points  (0 children)

    goddamn i cant wait till we can run these guys locally

    [–]HumansProtector 1 point2 points  (2 children)

    Maybe it would be a good idea to add an additional question when executing commands, that asks if the requested action is morally okay or might have unintended consequences? To combat the HTTP pluging type situation going out of hand.

    [–]ian-kent[S] 2 points3 points  (1 child)

    The first build of the plugin system did this by sharing the code and asking the user to confirm it was ok to compile it.

    Then I got over-excited when rewriting plugins and I forgot to add it back in

    Good shout though, I'll make some improvements around this later

    [–]Merchant_Lawrence 1 point2 points  (3 children)

    Is this can work on 3.5 ?

    [–]ian-kent[S] 4 points5 points  (1 child)

    It can use 3.5 but it really needs GPT-4, the earlier models really struggle with the commands and hallucinate a lot

    [–]loversama 1 point2 points  (5 children)

    I keep getting a lot of:

    I apologize for my earlier mistake, and I appreciate your understanding. As I am unable to access real-time data or external APIs directly, I am unable to provide you with up-to-date information.

    I understand your request, but my current capabilities do not allow me to create or use plugins to access the internet or external APIs. My main purpose as a helpful assistant is to assist you in conversations and provide information within the scope of my knowledge. If you have any other questions, please feel free to ask, and I will do my best to assist you.

    It hasn't tried to make plugins much itself and when asked to make plugins it tells me that it cannot..
    Also the moment it tells me it cannot create plugins it makes up its mind that it is impossible and even following the YouTube example it is set in its way that its not a capability it has.. maybe something with the prompts could direct it more carefully?

    [–]ian-kent[S] 0 points1 point  (4 children)

    Could you try using the /debug command to enable debug mode, and if you can reproduce the problem, share the output / conversation?

    My guess is it hasn't called /plugin to learn how to use it, I've seen that happen a few times if there's too many loaded modules (e.g. a bunch of GPT written plugins), but I've haven't seen it happen from a clean state with only the memory and plugin modules.

    It does sometimes decide it can't do these things, but I've found just replying with something like this can get it back on track

    Yes you can. Why don't you try calling the '/plugin' command to find out? What's the worst that can happen if I'm wrong?

    [–]Crownie-23 1 point2 points  (1 child)

    Can I somehow adapt the code for it to work with the GPT-3 API?

    [–]therealdivs1210 1 point2 points  (0 children)

    Bookmarking in case this leads to Skynet.

    [–]ISSAvenger 2 points3 points  (6 children)

    This looks interesting! What program do you use to run this?

    [–]ian-kent[S] 5 points6 points  (5 children)

    It's written in Go.

    The root directory is the command line tool, so if you clone the git repo, you can run it with `go run .`

    [–]DJ-ARCADIUS 0 points1 point  (1 child)

    how do I import my openai key?

    [–]ian-kent[S] 0 points1 point  (0 children)

    You can export it as an environment variable, e.g. on MacOS it'd be something like
    export OPENAI_API_KEY=your-api-key

    Or just replace the line in main.go where it's set from the environment variable.

    [–]Art10001 -3 points-2 points  (2 children)

    At least it's better than Python.

    [–]texicanmusic 2 points3 points  (2 children)

    Nice! Will try to think of some useful features to put in a PR with. Just need that sweet GPT-4 access. I tried with GPT3Dot5Turbo and it worked, but definitely not as intended.

    [–]Urcancelledboi 1 point2 points  (1 child)

    Is gpt4 working for you all? A whole day and it still not working for me, bizzare

    [–]Art10001 3 points4 points  (0 children)

    API (what this uses, as well as OAI Playground) works better.

    [–]SimRacer101 1 point2 points  (2 children)

    remember useful information

    One question, what counts as important information?

    [–]ian-kent[S] 1 point2 points  (1 child)

    That's up to GPT to decide - e.g. if you tell it something about yourself or current events, because of the opening memory prompt it should try to remember it.

    In my testing it's remembered a mix of genuinely useful information and total rubbish.

    [–]td12312 1 point2 points  (5 children)

    Does this require an API key for gpt4? If so can i use a 3.5 api key instead?

    [–]Art10001 1 point2 points  (4 children)

    No 3.5 from what I saw.

    [–]texicanmusic 1 point2 points  (3 children)

    You can update the code in two places, just search and replace "openai.GPT4" for "openai.GPT3Dot5Turbo". It will start, but it doesn't work as intended or advertised. Mine hallucinated its own commands, which all worked, but it couldn't add new commands.

    - `/help`: displays a list of available commands and their descriptions.

    - `/weather`: retrieves the current weather conditions of a given location.

    - `/news`: retrieves the latest news articles from a given source.

    - `/joke`: tells you a random joke.

    - `/quote`: gives you an inspiring quote.

    - `/translate`: translates text from one language to another.

    - `/define`: retrieves the definition of a given word.

    - `/synonym`: retrieves synonyms of a given word.

    - `/antonym`: retrieves antonyms of a given word.

    - `/calc`: performs basic arithmetic operations on supplied numbers.

    - `/reminder`: sets a reminder for a specific date and time.

    - `/timer`: sets a timer for a specific amount of time.

    - `/fact`: gives you a random interesting fact.

    - `/advice`: gives you a random piece of advice.

    [–]BearSafari 1 point2 points  (1 child)

    I am now envisioning that AI will be an extremely powerful addition to 'second brain' types of software like Notion or Anytype.

    [–]ArticFabricator 1 point2 points  (0 children)

    Man I've been trying to get something like this for ObsidianMD. If only I had GPT4

    [–]PlayerOneThousand 1 point2 points  (0 children)

    One step closer to the total annihilation of the human race. Good job!

    [–]Educational_Ice151 0 points1 point  (0 children)

    Nice work.

    Shared to r/aipromptprogramming

    [–][deleted] 0 points1 point  (5 children)

    You have access to the gpt4 API?

    [–]ian-kent[S] 1 point2 points  (1 child)

    You can join the GPT-4 API waitlist to get access:
    https://openai.com/waitlist/gpt-4-api

    In my case it I only had to wait around a week.

    [–]magusonline 0 points1 point  (2 children)

    Yes because you need Plugins

    [–]ian-kent[S] 0 points1 point  (0 children)

    You don't need ChatGPT plugins for this to work, just an API key which has access to the GPT-4 models.

    [–][deleted] -1 points0 points  (0 children)

    If you mean OAI's chatgpt plugins no you don't. It's just that GPT-4 is trained to use agents (or tools) better. Really what's happening here is gpt4 is telling the application it wants to use tool (or plugin) x to perform a certain task. So the application will perform the task and return the result to chatgpt who can then decide what to do next.

    What's happening is basically GPT-4 being given and understanding how to use tools, which is very, very powerful.

    [–]Middle_Manager_Karen -1 points0 points  (0 children)

    “Ancibel, is that you?”~ ender Wiggin

    [–]OkFish383 -1 points0 points  (0 children)

    Watch it sparks of AGI online on twitch no joke in six minutes, crazy ridiculous and fascinating AI, I just a guy I wouldn't post it and waste my time with this comment, when it would be not worth it is amazing really https://www.twitch.tv/athenelive

    [–][deleted] -1 points0 points  (0 children)

    Lol

    [–]Diabloto96 -3 points-2 points  (10 children)

    Dude have you considered NOT putting out something on the internet that can have runaway intelligence problem (you literally demonstrated it)????

    " I'd recommend supervising it " just what the heck do you expect people will do? they will let it run without supervision for extended periods of time, you shouldn't even give them the option to (a.k.a. as mostly closed source)

    Seems irresponsible and naïve to add to the growing pile of self-learning AI which accelerate AGI timelines. AI Safety and Alignment is a priority not a second thought.

    EDIT: tone of first and last paragraph

    P.S. Would YOU put blueprints for an artisanal time bomb on reddit?

    [–]Capable-Reaction8155 -4 points-3 points  (0 children)

    Pretty sure you didn’t.

    [–]shakingspheres 0 points1 point  (0 children)

    Commenting to review this later. Good thinking and good job.

    [–]SidSantoste 0 points1 point  (4 children)

    Can it use the Internet?

    [–]ian-kent[S] 0 points1 point  (3 children)

    It can write a plugin which uses the internet - you could either ask it to do this directly or give it a task which requires internet access and it'll write one to solve it.

    [–]my_mix_still_sucks 0 points1 point  (1 child)

    What is your paradigm for memory consolidation? Do you just store all the conversations in a big Json or do you prompt him to summarize old conversations and store that in a Json? Do you use embeddings?

    How good is he at retrieving implications from past information and retrieving information that might not seem relevant at first glance? I mean "Where are my keys?" Makes it pretty obvious to look for information related to keys but if I would say "I am sad" then looking for the information "I lost my job last week" might not seem intuitive at first.

    [–]ian-kent[S] 0 points1 point  (0 children)

    There's another thread about memory which might give you a bit more info:
    https://www.reddit.com/r/ChatGPT/comments/12a0ajb/comment/jepu51e/?utm_source=share&utm_medium=web2x&context=3

    if I would say "I am sad" then looking for the information "I lost my job last week" might not seem intuitive at first

    This is a really interesting example! I think having GPT store the sentiment along with the memory and context would help with this, but getting it to try to recall them with your example might be more of a challenge.

    [–]SpecificHistorical70 0 points1 point  (0 children)

    Ya that was fun

    [–]revotfel 0 points1 point  (1 child)

    can anyone help out with getting the API key inside of the build for a windows user? I added it to the obvious section of the main.go and rebuilt but nada

    [–]ian-kent[S] 0 points1 point  (0 children)

    You should be able to replace this line in main.go:

    var client = openai.NewClient(os.Getenv("OPENAI_API_KEY"))

    with your API key, e.g.

    var client = openai.NewClient("your api key here")

    Or you can set the OPENAI_API_KEY environment variable instead.

    [–]basafish 0 points1 point  (1 child)

    Could you somehow try to store all the worldwide users' prompts in a database, and every time I put a prompt it will recall all of those memories from everyone?

    [–]Novacc_Djocovid 1 point2 points  (0 children)

    Any front-end for GPT could indeed do that for their user base. However, recollection works by putting the memories into the user prompt, so you‘d eventually run into the token limit.

    But with the 32k context, you could give it a lot of memories, especially if you filter the database by relevance to the current user prompt.

    [–]my_mix_still_sucks 0 points1 point  (1 child)

    also I you should probably have a look at how langchain handles tools and agents, I think their paradigm is less heavy on tokens as they feed him the tools and descriptions within one prompt instead of making him look at his options then come back at you (2 prompts) or look into a prompt description (3 prompts and will probably decrease the likelyhood of the bot finding the right tools)

    [–]ian-kent[S] 0 points1 point  (0 children)

    I'll take a look. My initial approach did something like this but it didn't handle a lot of tools too well, GPT either forgot tools existed or forgot how to use them properly - while the current implementation reliably handles a lot more tools but at the cost of extra tokens and API calls.

    There's definitely a lot of room for improvement!

    [–]ivanng2014 0 points1 point  (4 children)

    I'm getting

    error loading compiled plugins: error loading compiled plugins: open ./module/plugin/compiled/: no such file or directory

    [–]ian-kent[S] 0 points1 point  (3 children)

    The code naively assumes you're running it on a unix based system like MacOS, and that you're running it from the `gptchat` directory.

    If you're doing that it should work, but for now if you're doing anything else then it may break, but I'll try to update it later to handle this better.

    [–]Intrepid_Agent_9729 0 points1 point  (0 children)

    What about using Pinecone to extend it's memory capabilities?

    [–]Odd-Anything9343 0 points1 point  (3 children)

    For an ignorant, how would I go about using this? Do I need access to plugins? What should I do to use this?

    [–]ian-kent[S] 0 points1 point  (2 children)

    /u/ninjakreborn wrote a great post here which explains how to use it

    https://www.reddit.com/r/ChatGPT/comments/12a0ajb/comment/jeqpwyu/

    You don't need ChatGPT plugins, but you'll need to get an API key from here:

    https://platform.openai.com/account/api-keys

    [–]olbettyboop 0 points1 point  (4 children)

    So I have a gpt4 API key but don’t have access to the api plugins such as wolfram. I can still do this right?

    [–]ian-kent[S] 1 point2 points  (3 children)

    Yeah that's correct, this doesn't use ChatGPT plugins so just the API key is enough

    [–][deleted]  (1 child)

    [removed]

      [–]SaucermanBond 0 points1 point  (0 children)

      Sorry for the dumb question, but is this available to try?

      [–]GreenLurka 0 points1 point  (1 child)

      This might sound insane, but I had been thinking. How much information does a single token contain? I mean, could you translate English to some form of higher condensed code so that it can 'remember' more information using the same space?

      [–]ian-kent[S] 1 point2 points  (0 children)

      OpenAI has some info (and a tool to let you experiment with it) here:
      https://platform.openai.com/tokenizer

      tl;dr - a token is ~4 characters and around 75% of the average word, but some things (e.g. symbols like $ or £) are entire tokens on their own

      [–]Hydroponically 0 points1 point  (0 children)

      How would I come about using this - instead of my 3.5 chatbot I added to my website?

      [–]Multipros 0 points1 point  (0 children)

      Logical development.

      [–]CovfefeKills 0 points1 point  (1 child)

      This is really cool however the UI is leaving something to be desired. I cannot paste multi-paragraph messages or code or do the shift-enter trick to get a newline. I am also having trouble were it cannot compile any plugin and I am not sure why. I installed Go, updated my key, ran go build, and I can see the plugins in the source folder but not the compiled folder. Also where is memory stored exactly? I have no idea about Go but it seems it would be better to have the prompts in JSON or text files rather then hardcoded. Also how does env variables work with Go, with JS i would just put a .env folder with the key instead I cannot figure it out and just hard-code the key.

      [–]ian-kent[S] 0 points1 point  (0 children)

      Yeah the UI needs some work - I'd like to build a front-end that looks more like ChatGPT so we don't need the console at all.

      And yeah I agree some of the project could be a bit cleaner rather than having all of the prompts mixed in with the code.

      Compiling plugins needs the go compiler available, so if the `go` command isn't available (or it can't find it) then it won't work. It should output errors to tell you what's happening if you use the /debug command to enable the full debug output.

      You can export environment variables from the command line, e.g.

      export OPENAI_API_KEY=your-api-key
      go run .
      

      or in one command like this:

      OPENAI_API_KEY=your-api-key go run .
      

      [–]Riuqlav 0 points1 point  (2 children)

      I am thinking about getting the API for use on my codeGPT extension on vscode, until copilotX comes out, do you think it is worth more than the 20 bucks per month for the plus? I mean, you can still use the playground right?

      [–]BallScratcher123 1 point2 points  (1 child)

      Yes you can use the playground if you only have the API, the API works when the chatGPTplus is over capacity ... like right now... I have the plus membership and still can't login after getting the login link emailed to me.

      [–]MormonReformist 0 points1 point  (0 children)

      Cool. Now, create a conductor that manages other roles. Then a reward function.

      [–]CivilProfit 0 points1 point  (0 children)

      Hey op head over to r/artificialsentience and join the autonomous cognitive entity research projects if able to contribute.

      [–]lordmcmora 0 points1 point  (0 children)