HomeAIThe Journey of RAG Improvement: From Pocket book to Microservices | by...

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


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

Towards Data Science

Picture generated by DALL-E 3 by the writer

On a quest for enterprise RAG, we discover tips on how to 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 principal 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 person inputs, LLM outputs, topical moderation, and customized actions to combine with LlamaIndex.

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

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

SentenceWindowNodeParser is a instrument that can be utilized to create representations of sentences that contemplate 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 rigorously replaces remoted sentences with their surrounding context, making a smoother, extra knowledgeable interpretation. This method shines for big paperwork, the place greedy nuances is essential.

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

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



Supply hyperlink

latest articles

explore more