Skip to content

ogbozoyan/security-chat

Repository files navigation

Security Chat

Spring AI based web application whose purpose is to demonstrate how to easily build RAG applications on Spring stack.

All models runs locally which is requires OLLAMA.
Frontend Backend

What is RAG ?

Retrieval-augmented generation (RAG) is a technique for enhancing the accuracy and reliability of generative AI models with facts fetched from external sources.

How to implement RAG ?

Implement RAG based on lectures of subject:

  1. Find related literature
  2. Convert to txt/pdf
  3. embed all of them

Build

MacOS

Unfortunately OLLAMA docker image requires NVIDIA GPU drivers see issue. The only way to run it locally, is manual build.

Linux

Docker compose

docker compose up --build
docker compose up -d

Manually

  1. Install Ollama
  2. Pull models
ollama pull nomic-embed-text:latest #you can choose your own model
ollama pull llama3.1:latest #you can choose your own model
ollama serve
  1. Run Postgres using docker
docker run -d \
  --name pgvector-container \
  -e POSTGRES_DB=core \
  -e POSTGRES_PASSWORD=admin \
  -e POSTGRES_USER=admin \
  -p 5432:5432 \
  -v pgvector-data:/var/lib/postgresql/data \
  --label "org.springframework.boot.service-connection=postgres" \
  pgvector/pgvector:pg16
  1. Build and Run Web
cd web
npm i
npm start
  1. Build and Run Backend
cd core
gradle bootRun

About

Cyber security specialist chat

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published