An open API service indexing awesome lists of open source software.

https://github.com/whybe-choi/advanced-rag-project

Advanced Dr.KHU using LlamaIndex ๐Ÿฆ™
https://github.com/whybe-choi/advanced-rag-project

cohere fastapi llama-index playwright-python streamlit

Last synced: 3 months ago
JSON representation

Advanced Dr.KHU using LlamaIndex ๐Ÿฆ™

Awesome Lists containing this project

README

        

# Dr.KHU : ์˜๋ฃŒ ์ƒ๋‹ด ์ฑ—๋ด‡ ๐Ÿค–


Advanced Dr.KHU using LlamaIndex ๐Ÿฆ™


## Introduction
์•„๋ž˜์˜ ์ด๋ฏธ์ง€๋Š” [Medium - Corca : LLM Multi Agent: Customer Service๋ฅผ ๊ธฐ๊น”๋‚˜๊ฒŒ ์ž๋™ํ™”ํ•˜๋Š” ๋ฐฉ๋ฒ•](https://medium.com/corca/llm-multi-agent-customer-service%EB%A5%BC-%EA%B8%B0%EA%B9%94%EB%82%98%EA%B2%8C-%EC%9E%90%EB%8F%99%ED%99%94%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95-2eaec7654385)์—์„œ ๋ฐœ์ทŒํ•œ ์ด๋ฏธ์ง€์ž…๋‹ˆ๋‹ค. ํ•ด๋‹น ์ด๋ฏธ์ง€์™€ ๋™์ผํ•œ ๊ธฐ๋Šฅ์„ ํ•˜๋„๋ก ์ฝ”๋“œ๋ฅผ ๊ฐœ์„ ํ•˜๊ณ  ์žˆ๋Š” ์ค‘์ž…๋‹ˆ๋‹ค.



> 1. Leader Agent๊ฐ€ Key Point Analyzer Agent์—๊ฒŒ ๋ณต์žกํ•œ ์งˆ๋ฌธ์„ ๊ฐ„๋‹จํ•œ ์—ฌ๋Ÿฌ ๊ฐœ์˜ Sub-question์œผ๋กœ ๋‚˜๋ˆ ๋‹ฌ๋ผ๊ณ  ์š”์ฒญํ•ฉ๋‹ˆ๋‹ค.
> 2. Leader Agent๊ฐ€ Sub-question ๋ชฉ๋ก์„ ๋ฐ›์œผ๋ฉด ๊ฐ๊ฐ์˜ Sub-question์— ๋Œ€ํ•˜์—ฌ Question Answerer Agent์„ ์ƒ์„ฑํ•˜๊ณ  ๋‹ตํ•ด๋‹ฌ๋ผ๊ณ  ์š”์ฒญํ•ฉ๋‹ˆ๋‹ค.
> 3. ์ด๋•Œ Question Answerer Agent๋Š” ๊ฐ Sub-question์— ํ•„์š”ํ•œ ์ •๋ณด๋ฅผ Vector Store์—์„œ ์ฐพ์•„์™€์„œ ์ด๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ๋‹ตํ•ฉ๋‹ˆ๋‹ค.
> 4. Leader Agent๋Š” ๊ฐ๊ฐ์˜ Sub-Question์— ๋Œ€ํ•œ ๋‹ต์„ ํ•ฉํ•˜์—ฌ ์‚ฌ์šฉ์ž ์งˆ์˜์— ๋Œ€ํ•œ ๋‹ต์„ ์ƒ์„ฑํ•˜๊ณ , Reviewer Agent์—๊ฒŒ ๊ฒ€ํ† ํ•ด๋‹ฌ๋ผ๊ณ  ์š”์ฒญํ•ฉ๋‹ˆ๋‹ค.
> 5. Reviewer Agent๋Š” Leader Agent๋กœ๋ถ€ํ„ฐ ์ „๋‹ฌ๋ฐ›์€ ๋‹ต๋ณ€์— ๋Œ€ํ•œ ํ”ผ๋“œ๋ฐฑ์„ ๋งํ•ฉ๋‹ˆ๋‹ค. Leader Agent๋Š” ๊ทธ ํ”ผ๋“œ๋ฐฑ์„ ๋ฐ˜์˜ํ•˜์—ฌ ์ตœ์ข… ๋‹ต๋ณ€์„ ์ƒ์„ฑํ•œ ํ›„ ์‚ฌ์šฉ์ž์—๊ฒŒ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.

## How to use
1. ๊ฐ€์ƒํ™˜๊ฒฝ ์„ค์ •
```shell
git clone https://github.com/whybe-choi/advanced-rag-project.git
cd advanced-rag-project
python -m venv venv
source venv/bin/activate
```

2. playwright ์„ค์น˜
```shell
playwright install
```

3. ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ ์„ค์น˜
```shell
pip install -r requirements.txt
```

4. ๋ฐ์ดํ„ฐ ํฌ๋กค๋ง
```shell
python crawling_faq.py
```

5. ChromaDB ์ƒ์„ฑ
```shell
python upload.py
```

6. `.env.example`์„ `.env`๋กœ ๋ฐ”๊พธ๊ณ  `CO_API_KEY` ์ž…๋ ฅ
```text
CO_API_KEY=your-api-key
```

7. streamlit ์‹คํ–‰
```shell
streamlit run app.py
```