Skip to content

aijianiula0601/rag_ai_search

Repository files navigation

RAG AI Search

An intelligent search system based on RAG (Retrieval-Augmented Generation) that supports multiple LLM models, including GPT and local Ollama models.

alt text

For Chinese version, please check README_cn.md

Features

  • Support for multiple LLM models (GPT and local Ollama models)
  • Streaming output generation
  • Display of reference document sources
  • History record saving and querying
  • Responsive interface design

To Do

  • Optimize real-time search
  • Optimize generation result efficiency, such as first detecting whether to search, then searching, otherwise directly generating
  • Support for multi-round dialogue

System Requirements

  • Python 3.8+
  • Flask
  • Azure OpenAI API access (for GPT)
  • Ollama service (for local models)

Installation Steps

  1. Clone the project
git clone https://github.com/your-repo/rag-ai-search.git
  1. Install dependencies
pip install -r requirements.txt
  1. Install Ollama
  • Install Ollama

    Reference: Ollama Installation

  • Install Ollama model after installation

    ollama run llama3:8b
  • Configure Ollama service address

    Configure Ollama service address in config/settings.py

    OllamaConfig.BASE_URL = "http://127.0.0.1:4008"
  1. Install Search Engine
  • Install search engine

    Reference: Install Search Engine

  • Configure search engine

    Configure search engine in config/settings.py

    SearchConfig.SEARX_BASE_URL = "http://127.0.0.1:11434"
  1. Configure Azure OpenAI API

    Create a .env file in the project root directory and configure the following environment variables:

gpt4o_mini_api_key='your_api_key'
gpt4o_mini_api_version='your_api_version'
gpt4o_mini_azure_endpoint='your_azure_endpoint'
GPT calling method: utils/gpt4_client.py

Note: If you don't have a GPT key, you can directly use the Ollama model without configuring Azure OpenAI

Starting the Search System

  1. Start Web Service
python web/app.py
  1. Open browser and visit: http://localhost:5000

  2. Select Model:

    • GPT: Uses Azure OpenAI service
    • Ollama Model: Uses locally deployed model
  3. Enter your question and wait for the answer

    • System will display reference document sources
    • Real-time streaming display of generated results
    • Support for viewing history records

Technical Architecture

alt text

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published