Enhancing Health & Safety with TII Falcon and Pinecone powered conversational agents

Navatech uses Falcon LLM & Pinecone DB for real-time information, monitoring, training, and incident reporting across multiple industries and transforming health and safety.

Enhancing Health & Safety with TII Falcon and Pinecone powered conversational agents
Workers across various sectors uses Navatech's Conversational agents for real-time info, monitoring, training, and incident reporting boosting safety across multiple industries.

In our fast-paced world, technology continues to play an increasingly vital role in elevating health and safety standards across diverse industries. One of the most promising advancements in this arena is the emergence of conversational agents driven by artificial intelligence (AI). These agents offer real-time information, guidance, and support, making them indispensable tools for safeguarding health and safety in a wide array of environments. This blog post will delve into our approach to harnessing the power of TII's Falcon Large Language Model (LLM) and Pinecone Vector Database to craft tailored conversational agents for health and safety applications.

Conversational agents, often known as chatbots or virtual assistants, have evolved significantly from their humble text-matching based origins to sophisticated AI-driven solutions capable of comprehending natural language and context and semantics. This evolution has unlocked a plethora of possibilities for enhancing health and safety measures in various sectors, including manufacturing, healthcare, and construction.

Let's explore the capabilities of TII Falcon and Pinecone before diving into the conversational agent development process.

The Technology Innovation Institute in Abu Dhabi has introduced Falcon, a groundbreaking series of language models. The Falcon family comprises three base models: Falcon-180B, Falcon-40B and Falcon-7B. Falcon-180B sets a new state-of-the-art for open models. It is the largest openly available language model, with 180 billion parameters, and was trained on a massive 3.5 trillion tokens using TII's RefinedWeb dataset. The 180b parameter model currently leads the Open LLM Leaderboard, while the 7B model excels in its weight class.

Notably, Falcon-180B is an exceptional open source model, surpassing many closed-source counterparts in capabilities. This development presents significant opportunities for professionals, enthusiasts, and industries alike, paving the way for exciting applications. At Navatech, we've chosen to harness this locally developed Large Language Model (LLM) to construct conversational agents that deliver health and safety information to our users via mobile devices. We've deployed the 7B model on our AWS tenant as an operational SageMaker Endpoint, serving as the backbone for our conversational agents.

Considering that the Falcon model isn't initially tailored to the Health and Safety domain, we've taken the approach of creating an external knowledge base using Pinecone Vector DB. Vector databases are uniquely designed to manage the intricate structure of vector embeddings—dense numerical vectors representing text. These embeddings capture word meanings and semantic relationships, which are pivotal for machine learning applications. Pinecone indexes these vectors for efficient search and retrieval, making it an ideal tool for natural language processing and AI-driven applications.

Why use Pinecone with Falcon LLM? : Pinecone can quickly search for similar data points in a database by representing data as vectors.This makes it ideal for a range of use cases, including semantic search, similarity search for images and audio, recommendation systems, record matching, anomaly detection, and more. We use Pinecone to build NLP systems that can understand the meaning of words and suggest similar text (documents) based on semantic similarity, and then the Falcon model uses these documents to give the relevant information to the user and sometimes rewrite the answer to suit the query.


Building an Conversational agent with LLMs and Vector Database :

LLM+Vector DB for building conversational agents

In Stage 1 of our process, we begin by ingesting knowledge base sources into the vector store. This involves a series of steps, starting with the meticulous reading of documents, which may be in the form of PDF files within the notebook. Subsequently, we break down these documents into smaller, more manageable chunks, ensuring that we include relevant sections that provide context to the prompts. The next crucial step is the generation of embeddings for each of these chunked documents. These embeddings, which are vector representations, capture the semantic meaning of the text and are essential for our system's understanding. Finally, we add these document embeddings to the vector store, ensuring accessibility for similarity searches and retrievals.

In Stage 2, we pivot to user interaction with our model. This stage begins with the user providing a prompt or asking a question. We then generate a user prompt embedding, which helps in capturing the semantic essence of the user's input. Subsequently, our system searches the vector store, seeking the nearest embeddings representing documents closely related to the user's prompt. Upon retrieval, we extract the actual text from these embeddings, which serve as valuable contextual information and seamlessly integrate it with the user's prompt, enriching it. This enhanced user prompt is then dispatched to our Large Language Model (LLM). Lastly, the LLM processes the augmented prompt and furnishes a summarized response to the user, complete with references to the sources from our knowledge base, facilitating a comprehensive and informative interaction.

Now that we've got the hang of the two main pieces of our conversational agent, let's dive into how we put them together in the agent's architecture and see what they can really do in tandem.

HSE Conversational Agent architecture

In the diagram above, we've encapsulated the conversational agent, constructed using Langchain, within a Lambda function. When a user submits a query, the Langchain component initiates a call to the Pinecone vector index to retrieve relevant documents. These documents are passed to the Falcon model hosted as a SageMaker endpoint to obtain an accurate response. Subsequently, the response is formatted according to the user's query and returned to the user. To facilitate seamless integration with our web and mobile applications, we've exposed this Lambda function through an API Gateway.

Whats next ?

Our roadmap includes a significant effort to refine and adapt Falcon, our conversational AI model, to excel in the domain of health and safety (HSE). This involves a comprehensive process of fine-tuning, where we meticulously train Falcon to provide not just information but highly accurate and contextually relevant guidance to our users. To achieve this, we're committed to encompassing a broad spectrum of Health, Safety, and Environment (HSE) guidelines sourced from regulatory and compliance agencies worldwide. These agencies represent diverse regions and industries with unique HSE standards and regulations. Our ultimate aim is to transform Falcon into a global repository of HSE knowledge, making it an invaluable resource for users regardless of their geographical location or industry focus. By doing so, we're not only ensuring precision but also promoting compliance with HSE regulations on a global scale. Our commitment is driven by a passion for enhancing safety and well-being across industries and borders.


Join Our Team of Innovators!

Join Our Team of Innovators!

Are you a passionate developer seeking exciting opportunities to shape the future of technology? We're looking for talented individuals to join our dynamic team at Navatech Group. If you're eager to be part of groundbreaking projects and make a real impact, we want to hear from you!

Send your resume to careers@navatechgroup.com and take the first step toward a rewarding career with us. Join Navatech Group today and be at the forefront of innovation!