Unveiling Invobot: Your Futuristic Inventory Management Sidekick π€π
Unlock the power of Conversational AI and Large Language Models with QraphQL
Introduction π
As someone with a deep fascination for the realms of AI and NLP, when I came across the Grafbase hackathon, I was intrigued by the idea of combining the two. The recent advancements in Large Language Models like LangChain and GPT have broken the preconceived notions of what AI and NLP could do. It was then that the idea of InvoBot was born, a helpful Inventory assistant designed to make Inventory handling a breeze. Using InvoBot, you can fetch inventory details, update stock, add products and remove items in a flash, that too just by a text! Follow along as we dive into how this amazing bot came to be
Technologies Used π οΈ
For this project, I used two main platforms, Grafbase and Botpress
Grafbase : Grafbase helps you to develop and deploy GraphQL APIs in just a few minutes. It provides a unified data layer, exposing your APIs to multiple front-end applications and services. This proved beneficial for me since I was able to directly embed Grafbase API into a third-party platform without having to do any extra setup!
Botpress : Botpress is an open-source conversational AI platform that empowers developers to create, deploy, and manage chatbots and virtual assistants. With its modular architecture and rich customization options, Botpress offers a versatile solution for building interactive and intelligent conversational experiences. It also allows users to harness the capabilities of the GPT 3.5 turbo LLM to enhance the user experience.
Project Links ποΈ
Development π»
InvoBot was created using BotPress, a platform that provides a visual builder to make chatbots. It enables developers to create workflows to simulate user conversations to train the bot to give responses or perform specific actions. This is the workflow I built for InvoBot
We can also execute code within the bot for specific user actions/events/prompts. I used this feature to make API calls to my Grafbase backend to perform the Create, Read, Update and Delete functionalities.
I spun up the grafbase project using the CLI, and deployed it on grafbase via GitHub. Grafbase provides comprehensive docs that walk you through the entire development from setup to deployment. You can check them out here :
For the database, I used Mongo Atlas, a powerful document-based database and connected it to my Grafbase project via its Data API. I created several resolvers to add, read, update and delete the data.
This is my GraphQL schema :
type Item {
id: ID!
productCode: String!
name: String!
description: String!
manufacturer: String!
seller: String!
quantity: Int!
price: Float!
}
# Defining input for creating a new product
input AddStockInput {
productCode: String!
name: String!
description: String!
manufacturer: String!
seller: String!
quantity: Int!
price: Float!
}
input UpdateStockInput {
quantity: Int!
}
extend type Mutation {
createItem(input: AddStockInput!): Item
@resolver(name: "add-stock")
updateItem(productCode: String!, input: UpdateStockInput!): Item
@resolver(name: "update-stock")
deleteItem(productCode: String!): Boolean @resolver(name: "delete-stock")
}
extend type Query {
stock(limit: Int = 10): [Item] @resolver(name: "get-stock")
item(productCode: String!): Item @resolver(name: "get-item")
}
Conclusion β‘
InvoBot was developed with a simple vision to make tasks easier and powerful capabilities to achieve this. The meticulous task of monitoring products, tracking quantities, and ensuring smooth operations demanded a more efficient solution. Invobot emerged as a response to this challengeβa smart assistant that harnesses the power of AI and NLP to revolutionize inventory management and expands the horizons of virtual assistants. I would like to thank Grafbase and Hashnode for giving me this opportunity