Skip to content

Commit 1ff9e27

Browse files
committed
config: Use append mode for LanceDB storage
Langchain, in their infinite wisdom, default to the `overwrite` mode. This means that every time you store _any_ document or text in LanceDB, the _entire table_ is erased. This does not make sense for our use case. Closes: AP-503
1 parent 20d91b2 commit 1ff9e27

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

willa/config/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@ def get_lance() -> LanceDB:
126126
base_url=CONFIG['OLLAMA_URL'])
127127
else: # If we add another backend, elif CONFIG['EMBED_BACKEND'] == 'bedrock':
128128
embeddings = BedrockEmbeddings(model_id=CONFIG['EMBED_MODEL'], provider='cohere')
129-
return LanceDB(embedding=embeddings, uri=CONFIG['LANCEDB_URI'], table_name='willa')
129+
return LanceDB(embedding=embeddings, uri=CONFIG['LANCEDB_URI'], table_name='willa',
130+
mode='append')
130131

131132

132133
def get_model() -> BaseChatModel:

0 commit comments

Comments
 (0)