adding in entity extraction layer with semantic search enabled

This commit is contained in:
Storme-bit
2026-04-17 06:18:39 -07:00
parent 902725b7f7
commit 06d7031e44
2 changed files with 45 additions and 4 deletions

View File

@@ -30,4 +30,21 @@ async function searchEpisodes( vector, {limit = ORCHESTRATION.RECENT_EPISODE_LIM
return data.result;
}
module.exports = { searchEpisodes };
async function searchEntities(vector, { limit = 5, scoreThreshold = 0.6 } = {}) {
const body = { vector, limit, score_threshold: scoreThreshold, with_payload: true };
const res = await fetch(
`${BASE_URL}/collections/${COLLECTIONS.ENTITIES}/points/search`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
}
);
if (!res.ok) throw new Error(`Qdrant error: ${res.status}`);
const data = await res.json();
return data.result;
}
module.exports = { searchEpisodes, searchEntities };