mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-01 16:24:44 +00:00
for pgvector
This commit is contained in:
parent
49a440acfb
commit
ac244d18c1
1 changed files with 8 additions and 1 deletions
|
@ -215,6 +215,13 @@ class PGVectorMemoryAdapter(Memory, MemoryBanksProtocolPrivate):
|
||||||
) -> QueryDocumentsResponse:
|
) -> QueryDocumentsResponse:
|
||||||
index = self.cache.get(bank_id, None)
|
index = self.cache.get(bank_id, None)
|
||||||
if not index:
|
if not index:
|
||||||
raise ValueError(f"Bank {bank_id} not found")
|
bank = await self.memory_bank_store.get_memory_bank(bank_id)
|
||||||
|
if not bank:
|
||||||
|
raise ValueError(f"Bank {bank_id} not found in Llama Stack")
|
||||||
|
index = BankWithIndex(
|
||||||
|
bank=bank,
|
||||||
|
index=PGVectorIndex(bank, ALL_MINILM_L6_V2_DIMENSION, self.cursor),
|
||||||
|
)
|
||||||
|
self.cache[bank_id] = index
|
||||||
|
|
||||||
return await index.query_documents(query, params)
|
return await index.query_documents(query, params)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue