Remembering Chatbot user in RS

  • 3 Replies
  • 4454 Views
*

gporceng18

  • Roomba
  • *
  • 1
Remembering Chatbot user in RS
« on: March 19, 2018, 12:21:04 pm »
First time posting. While using rivescript and Javascript is there anyway to save developed variables from a conversation into an object for later use? My intent is to be able to call on the object later in the chat or at least be able to use the rivescript variables in javascript. How can I go about this, very much a noob at this but am fascinated none the less.

*

Art

  • At the end of the game, the King and Pawn go into the same box.
  • Trusty Member
  • **********************
  • Colossus
  • *
  • 5865
Re: Remembering Chatbot user in RS
« Reply #1 on: March 19, 2018, 06:31:14 pm »
Welcome to AiDreams!

There was a fellow who, several years ago, developed some methods to allow his RiveScript bot to be able to SAVE information and later RECALL it as needed. In other words, he gave it a usable memory. I believe he also had other nice features but it was a bit involved to set up. Unfortunately, when I tried his bookmarked link I'd saved it was broken.

There may be some other users of RiveScript, other than myself, who are doing something similar to this or perhaps Noah Petherbridge might weigh in on this if you inquired at the RiveScript site or thereabouts.

Of all the things I've done with RS,, I'd really like for it to be able to save parts of our conversations for later use.

This would also help keep the bot on target with regard to context and topic flow. Hopefully, someone will chime in.
In the world of AI, it's the thought that counts!

*

kirsle

  • Roomba
  • *
  • 2
    • Kirsle.net
Re: Remembering Chatbot user in RS
« Reply #2 on: January 16, 2022, 12:49:49 am »
RiveScript creator here, this is an old thread but in case anyone finds it and is curious:

By default RiveScript keeps user variables in running memory but you can use the getUservars and setUservars functions to export and import them, so you can save a copy (as JSON data) in between runs of your bot. RiveScript's original niche is in being a long-running process with a bot loaded in memory able to remember you from one reply to the next. Some general strategies:

* Your program should initialize RiveScript once (loadDirectory, etc.) and enter a "main loop" of awaiting messages to reply to, and it'll keep your variables for the duration of the running session. e.g., if embedded on a web page using rivescript.js the program keeps running while the page is open, until the user reloads or leaves the site, and it will remember them fine during this time.
* For "server side use" if at all possible, still initialize RiveScript once and use that bot instance to handle user requests.

rivescript.js has several examples: https://github.com/aichaos/rivescript-js/tree/master/eg look at the persistence and json-server examples in particular.

In more recent years there are alternative user session adapters for some implementations, so you can directly persist variables into a Redis cache making this a whole lot more robust, see the "redis" example at the above link.

*

Zero

  • Eve
  • ***********
  • 1287
Re: Remembering Chatbot user in RS
« Reply #3 on: January 16, 2022, 11:41:03 am »
Thanks for the input.

I think I would insert an optional callback right in the setVariable() function of rivescript.js, and make it available in the public API through a setPersistenceCallback() function, so I (the user) can inject my own persistence callback at initialization.

Welcome to AiDreams :)

 


Requirements for functional equivalence to conscious processing?
by DaltonG (General AI Discussion)
November 19, 2024, 11:56:05 am
Will LLMs ever learn what is ... is?
by HS (Future of AI)
November 10, 2024, 06:28:10 pm
Who's the AI?
by frankinstien (Future of AI)
November 04, 2024, 05:45:05 am
Project Acuitas
by WriterOfMinds (General Project Discussion)
October 27, 2024, 09:17:10 pm
Ai improving AI
by infurl (AI Programming)
October 19, 2024, 03:43:29 am
Atronach's Eye
by WriterOfMinds (Home Made Robots)
October 13, 2024, 09:52:42 pm
Running local AI models
by spydaz (AI Programming)
October 07, 2024, 09:00:53 am
Hi IM BAA---AAACK!!
by MagnusWootton (Home Made Robots)
September 16, 2024, 09:49:10 pm
LLaMA2 Meta's chatbot released
by spydaz (AI News )
August 24, 2024, 02:58:36 pm
ollama and llama3
by spydaz (AI News )
August 24, 2024, 02:55:13 pm
AI controlled F-16, for real!
by frankinstien (AI News )
June 15, 2024, 05:40:28 am
Open AI GPT-4o - audio, vision, text combined reasoning
by MikeB (AI News )
May 14, 2024, 05:46:48 am
OpenAI Speech-to-Speech Reasoning Demo
by MikeB (AI News )
March 31, 2024, 01:00:53 pm
Say good-bye to GPUs...
by MikeB (AI News )
March 23, 2024, 09:23:52 am
Google Bard report
by ivan.moony (AI News )
February 14, 2024, 04:42:23 pm
Elon Musk's xAI Grok Chatbot
by MikeB (AI News )
December 11, 2023, 06:26:33 am

Users Online

317 Guests, 1 User
Users active in past 15 minutes:
squarebear
[Trusty Member]

Most Online Today: 467. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles