GenAIExamples Documentation

repository·main·Indexed 20 days ago

https://github.com/opea-project/genaiexamples

Microservice-based generative AI application samples using OPEA components. It provides ready-to-use patterns for RAG, code generation, and summarization, featuring detailed deployment guides for AgentQnA on AMD GPU (ROCm), Intel Xeon processors, and Intel Gaudi accelerators. The documentation covers configuration for vLLM, TGI, and OpenAI-compatible APIs, as well as instructions for data ingestion and agent validation.

Tokens
317.9K
Snippets
871
Records
1.2K
Agent score
72%

What's inside GenAIExamples

  1. Overview of Visual Question and Answering (VQA)

    main

    Visual Question Answering (VQA) is a task where a model answers open-ended questions based on an input image. The input is a combination of an image and a text question, and the output is a natural language answer.

    Common use cases include:

    • Accessibility: Assisting visually impaired individuals.
    • Education: Interactive learning with visual materials.
    • Customer Service/E-commerce: Answering user questions about products.
    • Image Retrieval: Finding images based on specific visual characteristics (e.g., "Is there a dog?").
  2. Overview of the DBQnA Application

    main
    The DBQnA application allows users to interact with databases using natural language. It leverages OPEA microservices to translate natural language queries into SQL, executes the generated SQL against a database (such as PostgreSQL), and returns real-time results. This enables users to query databases without requiring SQL knowledge.
  3. Overview of Arbitration Post-Hearing Assistant features

    main

    The Arbitration Post-Hearing Assistant is a GenAI module that processes post-hearing transcripts or arbitration documents to extract structured insights.

    Typical Workflow:

    1. Upload/Stream: Provide a post-hearing transcript.
    2. LLM Analysis: An LLM backend (integrating with vLLM or TGI) analyzes the text.
    3. Structured Output: The system returns a JSON object containing extracted entities and a summary.

    Extracted Entities include:

    • Case number
    • Parties involved (claimant/respondent)
    • Arbitrator(s)
    • Hearing date and time
    • Next hearing schedule and purpose
    • Hearing outcomes and reasons
  4. Overview of ChatQnA Customized UI features

    main

    The ChatQnA Customized UI provides a full-featured interface for interacting with generative AI models. Key capabilities include:

    • Text Chat: Initiate conversations via text input. Dialogue content can be customized by uploading files.
    • File Management: Upload files locally or via remote links to use as a knowledge base. You can also delete specific uploaded files.
    • Chat History: Historical records are retained even after page refreshes.
    • Session Controls: Clear the current dialog box to start fresh. The UI tracks 'End to End Time' to show the duration of the current conversation.
    • Navigation: The chat automatically scrolls to the bottom on new messages, and users can manually scroll to the top using a dedicated icon.
  5. Overview of the Code Translation Application

    main

    The Code Translation Application (CodeTrans) is an end-to-end workflow designed to convert code from one programming language to another (e.g., Python to Java, or JavaScript to TypeScript) while preserving original functionality. It leverages Large Language Models (LLMs) to perform source-to-source translation or transpilation.

    The application is built using component-level microservices defined in the GenAIComps repository and demonstrates Text Generation Inference across various hardware platforms.

  6. Overview of Code Generation (CodeGen) Example

    main

    The Code Generation (CodeGen) example is an AI application designed to assist developers by generating computer code from natural language prompts or existing code context. It uses Large Language Models (LLMs) to provide capabilities such as code completion, translation, summarization, refactoring, and error detection.

    Architecture

    The application uses a microservice-based architecture. A gateway orchestrates requests between the user interface and backend services, which include:

    • Core LLM: For code generation.
    • Retrieval-Augmented Generation (RAG): For providing context-aware responses using a vector database.
    • CodeGen-MegaService: A collection of microservices including Embedding, Retrieval, Agents, and the LLM service.
  7. Overview of the Finance Agent Example

    main

    The Finance Agent is a hierarchical multi-agent system designed for financial document processing and analysis. It automates three primary workflows:

    1. Summarization: Summarizing long financial documents and extracting key points using the OPEA DocSum microservice.
    2. Question Answering: Answering specific queries about financial documents (e.g., SEC filings) using a dedicated worker agent.
    3. Investment Research: Conducting research on public companies to generate comprehensive investment reports using a worker agent.

    Users interact with the system via a graphical user interface (UI) to submit requests or upload documents for processing. A supervisor agent manages the workflow by delegating tasks to either worker agents or the summarization microservice.

  8. Overview of the Document Summarization Application

    main

    The Document Summarization Application is a use case designed to create summaries of various document types, including news articles, research papers, technical documents, legal documents, and multimedia files (PDFs, Notion pages, etc.).

    It leverages LangChain to implement summarization strategies and uses Text Generation Inference (TGI) to facilitate LLM inference. The application is built using component-level microservices defined in GenAIComps.

  9. Overview of the AvatarChatbot Application

    main

    The AvatarChatbot application is an implementation of an AI avatar chatbot built using OPEA component-level microservices. It demonstrates a multi-platform AI interaction flow involving audio and visual components.

    Core Architecture and Information Flow

    The application operates as a 'Megaservice' composed of several specialized microservices that interact with open-source services:

    1. ASR (Automatic Speech Recognition) Microservice: Interacts with the Whisper service to process user audio queries.
    2. LLM (Large Language Model) Microservice: Interacts with the TGI (Text Generation Inference) service to process text.
    3. TTS (Text-to-Speech) Microservice: Interacts with the T5 (Speecht5) service to generate speech from text.
    4. Animation Microservice: Interacts with the Wav2Lip service to generate visual animations based on audio/video queries.

    Data Flow Sequence: User Audio Query $\rightarrow$ UI $\rightarrow$ Gateway $\rightarrow$ ASR $\rightarrow$ LLM $\rightarrow$ TTS $\rightarrow$ Animation.

  10. Overview of VideoQnA Application

    main

    VideoQnA is a framework designed to retrieve videos based on user prompts. It utilizes video embeddings to perform vector similarity searches within Intel's VDMS vector database. The system is optimized to run entirely on Intel Xeon CPUs and supports long-form videos and time-based search capabilities.

    Key technical characteristics:

    • RAG Workflow: Implements Retrieval-Augmented Generation using LangChain, Intel VDMS VectorDB, and Text Generation Inference.
    • Video Processing: Converts videos into feature vectors using mean aggregation for storage in the VDMS vector store.
    • Query Logic: Performs similarity searches in the vector store to find matching videos, which are then passed to a Large Vision Model (LVM) for contextual inference.