Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Discord Backers on Open Collective Sponsors on Open Collective Donate us Support us Follow us on Twitter

Description

Nest framework TypeScript starter repository.

Project setup

$ npm install

Compile and run the project

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Run tests

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Deployment

When you're ready to deploy your NestJS application to production, there are some key steps you can take to ensure it runs as efficiently as possible. Check out the deployment documentation for more information.

If you are looking for a cloud-based platform to deploy your NestJS application, check out Mau, our official platform for deploying NestJS applications on AWS. Mau makes deployment straightforward and fast, requiring just a few simple steps:

$ npm install -g @nestjs/mau
$ mau deploy

With Mau, you can deploy your application in just a few clicks, allowing you to focus on building features rather than managing infrastructure.

Resources

Check out a few resources that may come in handy when working with NestJS:

  • Visit the NestJS Documentation to learn more about the framework.
  • For questions and support, please visit our Discord channel.
  • To dive deeper and get more hands-on experience, check out our official video courses.
  • Deploy your application to AWS with the help of NestJS Mau in just a few clicks.
  • Visualize your application graph and interact with the NestJS application in real-time using NestJS Devtools.
  • Need help with your project (part-time to full-time)? Check out our official enterprise support.
  • To stay in the loop and get updates, follow us on X and LinkedIn.
  • Looking for a job, or have a job to offer? Check out our official Jobs board.

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

DukAnI - AI-Powered WhatsApp Concierge Bot

DukAnI is an intelligent WhatsApp concierge bot that helps users with travel, dining, and shopping recommendations using AI-powered search and personalized user profiles.

πŸ—οΈ Architecture

The application follows a modular NestJS architecture with the following components:

  • Bot Module: Handles WhatsApp messaging using whatsapp-web.js
  • Agent Module: Processes messages using LangChain-style tool orchestration
  • Groq Module: Integrates with Groq API for LLaMA 3 completions
  • Tavily Module: Provides search capabilities for hotels, flights, restaurants, and products
  • Profile Module: Manages user memory and preferences with JSON-based storage

πŸš€ Quick Start

Prerequisites

  • Node.js 20+
  • npm or yarn
  • WhatsApp account for QR code scanning

1. Install Dependencies

npm install

2. Set Up Environment Variables

Create a .env file in the root directory:

# API Keys
GROQ_API_KEY=your_groq_api_key_here
TAVILY_API_KEY=your_tavily_api_key_here

# App Configuration
PORT=3000
NODE_ENV=development

# WhatsApp Web Configuration
WA_SESSION_PATH=./wa-session
WA_CHROME_ARGS=--no-sandbox,--disable-setuid-sandbox

3. Get API Keys

4. Run the Application

# Development mode
npm run start:dev

# Production mode
npm run build
npm run start:prod

5. Connect WhatsApp

  1. When the app starts, a QR code will be displayed in the terminal
  2. Open WhatsApp on your phone β†’ Linked Devices β†’ Link a Device
  3. Scan the QR code with your phone
  4. The bot will be ready to receive messages!

πŸ“± Message Flow

WhatsApp Message β†’ Bot Service β†’ Agent Service β†’ Tools (Tavily/Profile) β†’ Groq LLM β†’ Response

Example Conversations

Hotel Search:

User: "Find me a hotel in Mombasa for next weekend"
Bot: 🏨 Here are some great hotels in Mombasa for your weekend trip:
     
     1. Serena Beach Resort & Spa - Luxury beachfront resort
     2. Voyager Beach Resort - Family-friendly with great amenities
     3. Bamburi Beach Hotel - Budget-friendly option
     
     Would you like me to help you with booking details?

Restaurant Recommendations:

User: "I want Italian food in Nairobi"
Bot: 🍝 Here are top Italian restaurants in Nairobi:
     
     1. Mediterraneo - Authentic Italian cuisine
     2. About Thyme - Modern Italian with local twist
     3. Artcaffe - Casual Italian favorites
     
     Based on your previous preferences, I'd recommend About Thyme! 

πŸ› οΈ API Endpoints

The bot exposes several admin endpoints:

  • GET /api/bot/status - Check WhatsApp connection status
  • GET /api/bot/info - Get connected WhatsApp account info
  • POST /api/bot/restart - Restart WhatsApp client
  • POST /api/bot/send - Send message to specific phone number
  • GET /api/bot/test - Health check endpoint

πŸ”§ Development

Project Structure

src/
β”œβ”€β”€ bot/           # WhatsApp client and message handling
β”œβ”€β”€ agent/         # AI agent with tool orchestration
β”œβ”€β”€ groq/          # Groq API service for LLM
β”œβ”€β”€ tavily/        # Search service integration
β”œβ”€β”€ profile/       # User memory and preferences
β”œβ”€β”€ app.module.ts  # Main application module
└── main.ts        # Application entry point

Adding New Tools

To add a new tool to the agent:

  1. Create the tool in agent.service.ts:
this.tools.set('newTool', {
  name: 'newTool',
  description: 'Description of what the tool does',
  parameters: { /* tool schema */ },
  execute: this.executeNewTool.bind(this),
});
  1. Implement the execution method:
private async executeNewTool(params: any, context: AgentContext): Promise<any> {
  // Tool implementation
}

Testing

# Unit tests
npm run test

# E2E tests
npm run test:e2e

# Test coverage
npm run test:cov

πŸ“Š User Profiles

The bot automatically creates and maintains user profiles with:

  • Personal Info: Name, location, budget preferences
  • Preferences: Cuisine types, hotel preferences, travel class
  • Favorites: Saved restaurants, hotels, destinations
  • Conversation History: Recent interactions for context

Profiles are stored as JSON files in data/profiles/.

πŸ”’ Security Notes

  • Keep API keys secure and never commit them to version control
  • The bot currently works only in private chats (group messages are ignored)
  • WhatsApp session data is stored locally in the configured session path

🚧 Roadmap

  • Database integration (PostgreSQL/MongoDB)
  • Advanced conversation memory
  • Multi-language support
  • Voice message handling
  • Booking integration APIs
  • Admin dashboard
  • Analytics and metrics

πŸ“ License

This project is licensed under the UNLICENSED license.

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch
  3. Follow TypeScript and NestJS best practices
  4. Add tests for new functionality
  5. Submit a pull request

πŸ“ž Support

For support, please check the bot status endpoint or review the application logs for debugging information.

Kindly to test the AI bot, send a message to +254111225035 on WhatsApp.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages