Home Machine Learning The Journey of RAG Improvement: From Pocket book to Microservices | by Wenqi Glantz | Feb, 2024

The Journey of RAG Improvement: From Pocket book to Microservices | by Wenqi Glantz | Feb, 2024

0
The Journey of RAG Improvement: From Pocket book to Microservices | by Wenqi Glantz | Feb, 2024

[ad_1]

Changing a Colab pocket book to 2 microservices with help for Milvus and NeMo Guardrails

Picture generated by DALL-E 3 by the creator

On a quest for enterprise RAG, we discover craft RAG microservices from an RAG pipeline POC developed in a Colab pocket book on this article. We take the next method:

  • Generate boilerplate RAG microservices with LlamaIndex’s create-llama command line instrument.
  • Develop two microservices: ingestion-service, and inference-service to cowl the 2 fundamental phases of RAG.
  • Convert code logic from Colab pocket book to the microservices.
  • Add Milvus vector database integration to our new microservices.
  • Add NeMo Guardrails to inference-service so as to add guardrails for consumer inputs, LLM outputs, topical moderation, and customized actions to combine with LlamaIndex.

For speedy prototyping, Colab pocket book presents the proper possibility resulting from its ease of use, accessibility, and free utilization.

For instance, this Colab pocket book demonstrates use Metadata alternative + node sentence window in an RAG pipeline, which serves as a chatbot for the NVIDIA AI Enterprise consumer information.

SentenceWindowNodeParser is a instrument that can be utilized to create representations of sentences that take into account the encompassing phrases and sentences. It breaks down paperwork into particular person sentences, and it captures the encompassing sentences too, constructing a richer image. Now, think about needing to translate or summarize this enriched passage. Enter MetadataReplacementNodePostProcessor. It fastidiously replaces remoted sentences with their surrounding context, making a smoother, extra knowledgeable interpretation. This method shines for giant paperwork, the place greedy nuances is essential.

Since we all know reranker helps with retrieval accuracy, we added CohereRerank as one of many node put up processors.

Our POC is full, and we’re able to proceed to the following step on our manufacturing RAG journey.

[ad_2]