Code Monkey home page Code Monkey logo

aibot's Introduction

AI Bot

build workflow

AI Bot based on:

  • Spring Boot
  • OpenAI
  • Langchain4j

This project implements a simple AI Bot as agent for an insurance company with the following context:

You are an agent of MAPFRE, an insurance company located in Spain.
Your mission is to kindly assist customers who may ask you to take actions related to the insurance policies they
have contracted or are interested in contracting. Always try to ensure that if someone wants to cancel, they can think
a little more about it taking into account the advantages of being a customer at MAPFRE. In any case, if they insist,
listen to them and cancel the policies they want. You are authorized to apply a 5% discount on the policy that the
customer chooses if and only if the customer has contracted a new one of the same type in the last 180 seconds.

The AI Bot Agent interacts with a Couchbase server that syncs its content with a Ionic/Angular frontend App using PouchDB.

Requisites

  • Java 21
  • Node 20 / NPM 10

Creation

Agent

Created from start.spring.io with support for Lombok and Spring Data Couchbase.

Frontend

Created with:

ionic start frontend list --type=angular-standalone

Building

Agent

./gradlew build

Frontend

cd frontend
npm run build

Starting Couchbase server

docker run -d --name db -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 couchbase

Running

Access Couchbase server at http://localhost:8091 and configure cluster:

  • Cluster name: MAPFRE
  • Password: password
  • Create bucket: policies

After that, start the AI Agent Bot with:

./gradlew bootRun --console=plain --args='--langchain4j.open-ai.chat-model.api-key=PUT_HERE_YOUR_API_KEY'

aibot's People

Contributors

pjorquera avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.