A demo of using GenAIScript to create an interactive conversational application. Any GenAIScript configuration could be used. For the demo openai:gpt-4o-mini
works best. If you want to use local models from ollama
comment out the files: ['rag/**/*.*']
or they struggle.
Simulates a chat room where:
- A user inputs messages
- AI participants respond to the conversation
- An AI agent manages and summarizes the conversation
- A virtual cat interjects
- Server: Express/Socket.IO server handling HTTP routes and real-time communication
- CatChat: Main state machine orchestrating the conversation inside a GenAIScript with a run loop
- Cat: AI agent that simulates cat behavior and is subscribed to state changes
- Participant: AI agents representing human participants in the chat
- Scribe: AI agent tracks and stores conversation history
- RAG: A folder containing interesting cat info is referenced by the AI agents
- Node.js
- npm
- GenAIScript VS Code extension (if Debugging)
-
Clone the repository
-
Install dependencies
npm install
-
Configure environment variables (copy
.env.genaiscript.sample
to.env.genaiscript
. [OPENAI_API_KEY=your_openai_api_key
-
Open the folder in VS Code
-
Navigate to the
cat-chat.genai.mts
script and click theRun GenAIScript...
orDebug GenAIScript...
menu option, or run via the terminalnpx genaiscript run cat-chat
-
A browser will launch and open
http://localhost:3000