A minimal CLI chatbot built with LangChain and Google Generative AI (Gemini).
It supports memory so the bot remembers previous messages in the same session.
- Chat with Gemini 2.0 Flash from your terminal.
- Uses LangChain ConversationChain for natural flow.
- BufferMemory keeps track of the conversation context.
- Simple CLI interface with Node.js.
-
Clone this repo:
git clone https://github.com/tanmayvaij/simple-cli-bot.git cd simple-cli-bot -
Install dependencies:
npm install
-
Create a
.envfile in the root directory and add your Gemini API key:GEMINI_API_KEY=your_api_key_here
Run the bot:
npm startThen start chatting:
user: Hello!
ai: Hi there! How can I help you today?
user: Remember my name is Tanmay
ai: Got it! I'll remember your name is Tanmay.
user: What's my name?
ai: Your name is Tanmay.
Exit anytime:
user: exit
- Node.js (TypeScript/JavaScript)
- LangChain JS
- Google Generative AI (Gemini 2.0 Flash)