Skip to content

PRATIK082/autosar-rag

 
 

Repository files navigation

autosar-chat

This is a AUTOSAR documents specific retriever based on LLM and RAG.

Environmental requirements

  • Operation System
    • Linux/MacOS (recommend)
    • Windwons
  • Docker
  • Python: 3.9.6 (compatibility issue may occur if version too hign)

Installation

1. Install ollama and pull models

Pull the llama3:

ollama pull llama3

Pull the Embeddings model:

ollama pull nomic-embed-text

2. Create a virtual environment

python3 -m venv ~/.venvs/aienv
source ~/.venvs/aienv/bin/activate

3. Install libraries

pip install -r cookbook/requirements.txt

4. Install Docker

Install docker according to this doc Docker

5. Run PgVector

  • Run using a helper script
./cookbook/run_pgvector.sh
  • OR run using the docker run command
docker run -d \
  -e POSTGRES_DB=ai \
  -e POSTGRES_USER=ai \
  -e POSTGRES_PASSWORD=ai \
  -e PGDATA=/var/lib/postgresql/data/pgdata \
  -v pgvolume:/var/lib/postgresql/data \
  -p 5532:5432 \
  --name pgvector \
  phidata/pgvector:16

6. Run Qdrant

  • Run using a helper script
./cookbook/run_qdrant.sh
  • OR run using the docker run command
docker run -itd --name=qdrant \
    -p 6333:6333 \
    -p 6334:6334 \
    -e "QDRANT__SERVICE__API_KEY=123456" \
    -e "QDRANT__SERVICE__JWT_RBAC=true" \
    -v /home/qdrant_storage:/qdrant/storage:z \
        qdrant/qdrant

NOTE:

If following error occured in the step 5 or step 6, please try to change the mirror of docker

docker: error pulling image configuration: download failed after attempts=6: dial tcp 199.16.156.11:443: connect: connection refused.

7. Run RAG App

streamlit run app.py
  • Open localhost:8501 to view your local RAG app.

  • Add PDFs or ask question directly

  • Example PDF: ./cookbook/data/AUTOSAR/AUTOSAR_CP_SWS_DiagnosticCommunicationManager-54-78.pdf

About

This is a AUTOSAR documents specific retriever based on LLM and RAG.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 79.3%
  • HTML 10.5%
  • Jupyter Notebook 9.7%
  • Shell 0.5%