businesses is • text summarization • and the ability to query company documents. Typically for a company, GenAI is employed to create an AI capable of answering closed-domain questions, such as those related to a company's knowledge base. GenAI Common Usage Context Photo de Steve Johnson sur Unsplash Lack of Familiarity with Custom Data LLMs use deep learning on extensive datasets but are typically trained on broad public data, limiting their understanding of specific, proprietary information. This results in static LLMs that may give inaccurate or outdated answers when dealing with untrained data. Custom Data Utilization for Effective AI Applications For tailored responses, organizations require LLMs to grasp their domain, providing specific answers from unique datasets. For example, customer support and internal Q&A bots must offer company-specific solutions, posing a challenge to build without retraining models Technical limitations Maximum tokens, hallucinations, Complex Prompting Main Issues
offers granular control and high specialization, but implementation can be challenging due to the need for labeled data, computational costs, and intensive resource requirements Quelles solutions ? Context Photo de Steve Johnson sur Unsplash -2- Implement the RAG pattern RAG stands for retrieval-augmented generation. This technique passively analyzes the latest user input and conversation context, using embeddings or search techniques to enhance the AI model's context with specialized knowledge. RAGs enable dynamic context updates, improved accuracy, increased prompt length, and efficient inference computation
customizing LLMs with domain-specific data, RAG is simple and cost-effective. Organizations can deploy RAG without needing to customize the model. This is especially beneficial when models need to be updated frequently with new data. What is RAG? Key benefits 2 Reducing inaccurate responses, or hallucinations By grounding the LLM model's output on relevant, external knowledge, RAG attempts to mitigate the risk of responding with incorrect or fabricated information (also known as hallucinations). Outputs can include citations of original sources, allowing human verification. 1 Providing up-to-date and accurate responses RAG ensures that the response of an LLM is not based solely on static, stale training data. Rather, the model uses up-to-date external data sources to provide responses. 3 Providing domain-specific, relevant responses Using RAG, the LLM will be able to provide contextually relevant responses tailored to an organization's proprietary or domain-specific data. Retrieval Augmented Generation
data as lists of numbers. This numerical representation captures the meaningful properties and relationships of the objects. Vactor Database allows you to store embeddings vector and performs vector search based on similarity Retriever helps you search and retrieve information from your indexed documents based on an unstructured query Architecture Pattern
by language models. It enables applications : To be context-aware to connect a language model to sources of context (prompt instructions, few shot examples, content to ground its response in, etc.) To reason by relying on a language model to reason (about how to answer based on provided context, what actions to take, etc.) LangChain provides standard, extendable interfaces and integrations for Models, Retrievals, Tools and utilities for prompting, document treatment
Javascript. LangChain Integration supported ? ~100 LLMs, ~30 Chat Models, ~100 Documents Loaders & Transformers, ~ 30 Embeddings Engine, ~50 Vector Stores, and so on … What about the other language ? As LangChain is a framework that expose standard API and pattern. Community has declined LangChain in another language. Dart LangChain LangChain for Flutter developer What about Dart LangChain ? Development started 6 months ago and it supports all core functionalities Integration supported ? Support OpenAI, Google and majors Vector Store
will summarize and let us chat with an upload document on-the-fly Key Features Load - Upload an document from disk or grab content from an URL Summarize - Provide a short summary of the content and extract key points Converse - Chat with the content uploaded Summarize & Converse Let’s build a FlutterApp for that
Build the interface with Flutter framework Dart Langchain Use the framework to load, summarize and converse with content Google Vertex AI Use Google LLM & Embeddings engine
only on the given text? "{context}" The length of the summary should be appropriate to capture the main points of the text, without including unnecessary information and contains 100 words maximum: SHORT SUMMARY: '''; List<Document> documents = await _splitDocuments(chunkSize, chunkOverlap); BaseCombineDocumentsChain summarizeChain = SummarizeChain.mapReduce( llm: llm, combinePrompt: PromptTemplate.fromTemplate( SHORT_SUMMARY_PROMPT_TEMPLATE) ); summary = await summarizeChain.run(documents); Summarize Chain