The Principal Dev – Masterclass for Tech Leads

The Principal Dev – Masterclass for Tech LeadsJuly 17-18

Join

Trieve Logo

Sign Up (1k chunks free) | PDF2MD | Hacker News Search Engine | Documentation | Meet a Maintainer | Discord | Matrix

Github stars Join Discord Join Matrix smithery badge vscode mcp install badge

All-in-one solution for search, recommendations, and RAG

Features

Are we missing a feature that your use case would need? - call us at 628-222-4090, make a Github issue, or join the Matrix community 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

Installing via Smithery

To install Trieve for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install trieve-mcp-server --client claude

Debian/Ubuntu Packages needed packages

sudo apt install curl \
gcc \
g++ \
make \
pkg-config \
python3 \
python3-pip \
libpq-dev \
libssl-dev \
openssl

Arch Packages needed

sudo pacman -S base-devel postgresql-libs

Install NodeJS and Yarn

You can install NVM using its install script.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash

You should restart the terminal to update bash profile with NVM. Then, you can install NodeJS LTS release and Yarn.

nvm install --lts
npm install -g yarn

Make server tmp dir

mkdir server/tmp

Install rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

Install cargo-watch

cargo install cargo-watch

Setup env's

You might need to create the analytics directory in ./frontends

cp .env.analytics ./frontends/analytics/.env
cp .env.chat ./frontends/chat/.env
cp .env.search ./frontends/search/.env
cp .env.example ./server/.env
cp .env.dashboard ./frontends/dashboard/.env

Add your LLM_API_KEY to ./server/.env

Here is a guide for acquiring that.

Steps once you have the key

  1. Open the ./server/.env file
  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

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

export OPENAI_API_KEY="your_OpenAI_api_key" \
LLM_API_KEY="your_OpenAI_api_key" \
PAGEFIND_CDN_BASE_URL="lZP8X4h0Q5Sj2ZmV,aAmu1W92T6DbFUkJ,DZ5pMvz8P1kKNH0r,QAqwvKh8rI5sPmuW,YMwgsBz7jLfN0oX8" \
S3_SECRET_KEY_CSVJSONL="Gq6wzS3mjC5kL7i4KwexnL3gP8Z1a5Xv,V2c4ZnL0uHqBzFvR2NcN8Pb1g6CjmX9J,TfA1h8LgI5zYkH9A9p7NvWlL0sZzF9p8N,pKr81pLq5n6MkNzT1X09R7Qb0Vn5cFr0d,DzYwz82FQiW6T3u9A4z9h7HLOlJb7L2V1" \
GROQ_API_KEY="GROQ_API_KEY_if_applicable"

Start docker container services needed for local dev

cat .env.chat .env.search .env.server .env.docker-compose > .env

./convenience.sh -l

Install front-end packages for local dev

cd frontends
yarn

cd ..

cd clients/ts-sdk
yarn build

cd ../..

Start services for local dev

It is recommend to manage services through tmuxp, see the guide here or terminal tabs.

cd frontends
yarn
yarn dev
cd server
cargo watch -x run
cd server
cargo run --bin ingestion-worker
cd server
cargo run --bin file-worker
cd server
cargo run --bin delete-worker
cd search
yarn
yarn dev

Verify Working Setup

After the cargo build has finished (after the tmuxp load trieve):

Additional Instructions for testing cross encoder reranking models

To test the Cross Encoder rerankers in local dev,

Debugging issues with local dev

Reach out to us on discord for assistance. We are available and more than happy to assist.

Debug diesel by getting the exact generated SQL

diesel::debug_query(&query).to_string();

Local Setup for Testing Stripe Features

Install Stripe CLI.

  1. stripe login
  2. stripe listen --forward-to localhost:8090/api/stripe/webhook
  3. set the STRIPE_WEBHOOK_SECRET in the server/.env to the resulting webhook signing secret
  4. stripe products create --name trieve --default-price-data.unit-amount 1200 --default-price-data.currency usd
  5. stripe plans create --amount=1200 --currency=usd --interval=month --product={id from response of step 3}

Contributors

contributors

Join libs.tech

...and unlock some superpowers

GitHub

We won't share your data with anyone else.