Skip to content

Commit 1ef2db3

Browse files
committed
initial commit
0 parents  commit 1ef2db3

20 files changed

+6330
-0
lines changed

.dockerignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
data

.env.template

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
POSTGRES_HOST=pg
2+
POSTGRES_PORT=5432
3+
POSTGRES_USER=postgres
4+
POSTGRES_PASSWORD=postgres
5+
POSTGRES_DB=postgres
6+
REDIS_URL=redis://redis:6379
7+
OLLAMA_URL=http://host.docker.internal:11434
8+
OLLAMA_MODEL=llama3

.github/workflows/test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- name: Install dependencies
23+
run: npm ci
24+
25+
- name: Compile TypeScript
26+
run: npx tsc --noEmit

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
node_modules
3+
.env
4+
data

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM node:20
2+
3+
WORKDIR /app
4+
5+
COPY package*.json ./
6+
7+
RUN npm install
8+
9+
COPY . .
10+
11+
RUN npm run build
12+
13+
ENTRYPOINT ["npm", "run", "start"]

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# 📚 RAG My Docs
2+
3+
[![Test](https://github.com/Kaltsoon/rag-my-docs/actions/workflows/test.yml/badge.svg)](https://github.com/Kaltsoon/rag-my-docs/actions/workflows/test.yml)
4+
5+
A CLI application for building a [RAG](https://blogs.nvidia.com/blog/what-is-retrieval-augmented-generation/) for GitHub repository's markdown files and using it as a context for an LLM to ask questions related to the repository's documentation.
6+
7+
The client code is implemented using TypeScript. PostgreSQL with [pgvector](https://github.com/pgvector/pgvector) is used as a vector database. Redis is used for caching purposes.
8+
9+
## Requirements
10+
11+
Docker and [Ollama](https://ollama.com/).
12+
13+
## How to use?
14+
15+
1. Setup [Ollama](https://ollama.com/) and pull the `llama3:8b` model by running `ollama pull llama3:8b`. You can use other Ollama models as well, see next step for configuration instructions.
16+
2. Create a `.env` and with the contents of the `.env.template` file. Feel free to change the environment variables, e.g. `OLLAMA_MODEL` variable to change the model.
17+
2. Run the containers by running `docker compose up -d pg redis`.
18+
3. Once the containers are ready, run the CLI application by running `docker compose run -it --rm cli` and follow the instructions provided by the application.

compose.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
services:
2+
cli:
3+
build:
4+
context: ./
5+
env_file: .env
6+
container_name: rag-my-docs-cli
7+
redis:
8+
image: redis/redis-stack-server
9+
volumes:
10+
- redis_data:/data
11+
container_name: rag-my-docs-redis
12+
pg:
13+
image: pgvector/pgvector:pg16
14+
restart: always
15+
environment:
16+
- PGDATA=/data
17+
- POSTGRES_PASSWORD=postgres
18+
volumes:
19+
- pg_data:/data
20+
container_name: rag-my-docs-postgres
21+
volumes:
22+
redis_data:
23+
ollama_data:
24+
pg_data:

data/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)