JAVA版本的检索增强生成(RAG)项目,包括知识库、搜索 | JAVA version of retrieval enhancement generation(RAG) project ,including knowledge base, search
Go to file
moyangzhan feaa50fb77 增加:管理员->系统管理模块接口 2024-06-11 19:11:11 +08:00
adi-admin 增加:管理员->系统管理模块接口 2024-06-11 19:11:11 +08:00
adi-bootstrap 增加:管理员->知识库模块接口 2024-05-31 19:43:29 +08:00
adi-chat 增加:管理员->知识库模块接口 2024-05-31 19:43:29 +08:00
adi-common 增加:管理员->系统管理模块接口 2024-06-11 19:11:11 +08:00
docker-compose 修改pom 2024-02-18 18:37:45 +08:00
docs 增加:管理员->系统管理模块接口 2024-06-11 19:11:11 +08:00
image/README modify readme 2024-02-15 15:38:06 +08:00
.gitignore fix: 上下文理解 2024-04-12 09:19:17 +08:00
LICENSE Initial commit 2023-08-08 10:45:05 +08:00
README.md update readme 2024-05-23 13:44:20 +08:00
README_en.md update readme 2024-04-08 23:07:23 +08:00
pom.xml fix: 上下文理解 2024-04-12 09:19:17 +08:00

README_en.md

Getting Started

中文

LangChain4j-AIDeepin Langchain4j-aideepin is an open source, offline deployable Retrieval Enhancement Generation (RAG) project based on large language models such as ChatGPT and application frameworks such as Langchain4j.

Website

http://www.aideepin.com

Feature

  • Login & Register
  • Multiple Conversation | Multiple character
  • AI Draw
  • Prompt
  • Quota
  • Knowledge base(RAG)
  • AI Search(RAG)
  • Multiple models switch at will
  • Multiple search engine switch at will

Support Models

  • ChatGPT 3.5
  • 通义千问
  • 文心一言
  • ollama
  • DALL-E 2

Support Search Engines

Google

Bing (TODO)

百度 (TODO)

Introduction

This repository is a back-end project, front-end project in langchain4j-aideepin-web

Backend

jdk17

springboot3.0.5

langchain4j(Java version of LangChain)

Postgresql(需要安装pgvector扩展)

Frontend

vue3+typescript+pnpm

Build and run this project

Init

a. Init database

  • Create database schema: aideepin
  • Run: docs/create.sql
  • Update language model config:

Openai setting

update adi_sys_config set value = '{"secret_key":"my_openai_secret_key","models":["gpt-3.5-turbo"]}' where name = 'openai_setting';

Dashscope setting

update adi_sys_config set value = '{"api_key":"my_dashcope_api_key","models":["my model name,eg:qwen-max"]}' where name = 'dashscope_setting';

Qianfan setting

update adi_sys_config set value = '{"api_key":"my_qianfan_api_key","secret_key":"my_qianfan_secret_key","models":["my model name,eg:ERNIE-Bot"]}' where name = 'qianfan_setting';

Ollama setting

update adi_sys_config set value = '{"base_url":"my_ollama_base_url","models":["my model name,eg:tinydolphin"]}' where name = 'ollama_setting';
  • Search engine setting

Google:

update adi_sys_config set value = '{"url":"https://www.googleapis.com/customsearch/v1","key":"my key from cloud.google.com","cx":"my cx from programmablesearchengine.google.com"}' where name = 'google_setting';

b. Init properties

  • postgresql: spring.datasource in application-[dev|prod].xml
  • redis: spring.data.redis in application-[dev|prod].xml
  • mail: spring.mail in application.xml

Compile & Run

  • Enter the project root directory:
cd langchain4j-aideepin
  • Package
mvn clean package -Dmaven.test.skip=true
  • Run:

a. Run by jar

cd adi-bootstrap/target
nohup java -jar -Xms768m -Xmx1024m -XX:+HeapDumpOnOutOfMemoryError adi-chat-0.0.1-SNAPSHOT.jar --spring.profiles.active=[dev|prod] dev/null 2>&1 &

b. Run by docker

cd adi-bootstrap
docker build . -t aideepin:0.0.1
docker run -d \
  --name=aideepin \
  -e APP_PROFILE=[dev|prod] \
  -v="/data/aideepin/logs:/data/logs" \
  aideepin:0.0.1

TODO

Enhance RAG

More search engineBING、百度

Screenshot

AI Chat 1691583184761

AI Draw

1691583124744

Knowlege base kbindex

kb01

Embedding

kb02

kb03

Quota

!1691583329105.png