Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ JINA_CODE_API_KEY=""
VECTOR_SIZES="384,512,768,1024,1536,3072"
RUST_LOG="INFO"
BM25_ACTIVE="true"
PAGEFIND_CDN_BASE_URL="lZP8X4h0Q5Sj2ZmV,aAmu1W92T6DbFUkJ,DZ5pMvz8P1kKNH0r,QAqwvKh8rI5sPmuW,YMwgsBz7jLfN0oX8"
SHOPIFY_SECRET_KEY="foobar"
GROQ_API_KEY="loremipsum"

##### Firecrawl #####
NUM_WORKERS_PER_QUEUE=8
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,4 +97,6 @@ pdf2md/ch_migrations/chm.toml
clients/trieve-shopify-extension/shopify.app.skept-trieve-extension-test.toml
clients/trieve-shopify-extension/shopify.app.skept-laptop-trieve-extension.toml
charts/charts/**/*.tgz
clients/trieve-shopify-extension/.env.skept-trieve-extension-test
clients/trieve-shopify-extension/.env.skept-trieve-extension-test
.idea
docker-compose-cpu-embeddings.override.yml
53 changes: 47 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@

**Are we missing a feature that your use case would need?** - call us at [628-222-4090](mailto:+16282224090), make a [Github issue](https://github.com/devflowinc/trieve/issues), or join the [Matrix community](https://matrix.to/#/#trieve-general:trieve.ai) and tell us! We are a small company who is still very hands-on and eager to build what you need; professional services are available.

## Local development with Linux
## Local Development

### Installing via Smithery

Expand All @@ -66,8 +66,9 @@ To install Trieve for Claude Desktop automatically via [Smithery](https://smithe
npx -y @smithery/cli install trieve-mcp-server --client claude
```

### Debian/Ubuntu Packages needed packages
### System Dependencies

#### Linux (Debian/Ubuntu)
```sh
sudo apt install curl \
gcc \
Expand All @@ -81,12 +82,23 @@ libssl-dev \
openssl
```

### Arch Packages needed

#### Linux (Arch)
```sh
sudo pacman -S base-devel postgresql-libs
```

#### MacOS
```sh
# Install Xcode command line tools
xcode-select --install

# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install required packages
brew install pkg-config openssl
```

### Install NodeJS and Yarn

You can install [NVM](https://github.com/nvm-sh/nvm) using its install script.
Expand Down Expand Up @@ -142,9 +154,9 @@ cp .env.dashboard ./frontends/dashboard/.env
2. Replace the value for `LLM_API_KEY` to be your own OpenAI API key.
3. Replace the value for `OPENAI_API_KEY` to be your own OpenAI API key.

### Export the following keys in your terminal for local dev
### Override the following keys in your terminal for local dev

The PAGEFIND_CDN_BASE_URL and S3_SECRET_KEY_CSVJSONL could be set to a random list of strings.
The PAGEFIND_CDN_BASE_URL and S3_SECRET_KEY_CSVJSONL can be set to a random list of strings.

```
export OPENAI_API_KEY="your_OpenAI_api_key" \
Expand All @@ -163,6 +175,35 @@ cat .env.chat .env.search .env.server .env.docker-compose > .env
./convenience.sh -l
```

### Start embedding servers

We offer 2 docker-compose files for embedding servers. One for GPU and one for CPU.

```sh
docker compose -f docker-compose-cpu-embeddings.yml up -d
```

or

```sh
docker compose -f docker-compose-gpu-embeddings.yml up -d
```

* Note on embedding servers. If you want to use a separate GPU enabled device for embedding servers you will need to update the following parameters

```
SPARSE_SERVER_QUERY_ORIGIN
SPARSE_SERVER_DOC_ORIGIN
EMBEDDING_SERVER_ORIGIN
SPARSE_SERVER_QUERY_ORIGIN
```

#### Using CPU embeddings on MacOS
```
cp docker-compose-cpu-embeddings.override.mac docker-compose-cpu-embeddings.override.yml
docker-compose -f docker-compose-cpu-embeddings.yml -f docker-compose-cpu-embeddings.override.yml docker up -d
```

### Install front-end packages for local dev

```
Expand Down
21 changes: 21 additions & 0 deletions docker-compose-cpu-embeddings.override.mac
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Docker Compose overrides for macOS development with CPU embeddings
# To use this file: docker-compose -f docker-compose-cpu-embeddings.yml -f docker-compose-cpu-embeddings.override.yml up
# For Linux development, don't include this override file

version: '3'

services:
splade-doc:
platform: linux/amd64

splade-query:
platform: linux/amd64

jina:
platform: linux/amd64

bgem3:
platform: linux/amd64

reranker:
platform: linux/amd64
4 changes: 2 additions & 2 deletions docker-compose-cpu-embeddings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ services:
- ./data:/data

bgem3:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.2
command: --model-id BAAI/bge-m3 --revision main
ports:
- "7000:80"
volumes:
- ./data:/data

reranker:
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.5
image: ghcr.io/huggingface/text-embeddings-inference:cpu-1.8.2
command: --model-id BAAI/bge-reranker-base --revision main
ports:
- "8000:80"
Expand Down
7 changes: 7 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: '3'

services:
clickhouse-db:
environment:
# Loop back to the host machine to reach the embedding server
- EMBEDDING_SERVER_URL=http://host.docker.internal:6000
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ services:
dashboard:
image: trieve/dashboard
build:
context: ./frontends
dockerfile: ./dashboard/Dockerfile
context: .
dockerfile: ./frontends/dashboard/Dockerfile
networks:
- app-network
ports:
Expand All @@ -261,8 +261,8 @@ services:
chat:
image: trieve/chat
build:
context: ./frontends
dockerfile: ./chat/Dockerfile
context: .
dockerfile: ./frontends/chat/Dockerfile
networks:
- app-network
ports:
Expand All @@ -275,8 +275,8 @@ services:
search:
image: trieve/search
build:
context: ./frontends
dockerfile: /search/
context: .
dockerfile: ./frontends/search/Dockerfile
networks:
- app-network
ports:
Expand Down