protectai / rebuff

LLM Prompt Injection Detector
https://playground.rebuff.ai
Apache License 2.0
1.06k stars 73 forks source link

Add Chroma support for vector db #63

Closed ristomcgehee closed 10 months ago

ristomcgehee commented 10 months ago

This PR adds Chroma as an option for the vector database instead of Pinecone.

I want to highlight that this is a BREAKING change in terms of the JavaScript SDK. The structure of SdkConfig changes in order to accommodate the different vector db options. I figure this is acceptable since Rebuff is not yet widely used and still at a 0.x release.

I was not able to add support for authentication to the Chroma server due to an issue with langchain importing the chromadb package. I got the same error as https://github.com/langchain-ai/langchain/issues/7260. It has something to do with Node not being able to import chromadb as ES6 module. I tried figuring out a fix for this, but I'm not sufficiently familiar with Node to determine the root cause.

Closes https://github.com/protectai/rebuff/issues/16

ristomcgehee commented 10 months ago

I rebased this off of latest main. Because the sdk and the server are in different packages now, I put the changes to the server in a different PR because it needs an NPM release of the javascript-sdk.

This PR is ready for review.

ristomcgehee commented 10 months ago

@seanpmorgan just wanted to make sure this hadn't fallen off your radar.