memory isolation fix

This commit is contained in:
Storme-bit
2026-04-19 01:02:52 -07:00
parent ed57a0331a
commit 56355d232b
7 changed files with 23 additions and 13 deletions

View File

@@ -29,11 +29,11 @@ async function getRecentEpisodes(sessionId, limit = EPISODIC.DEFAULT_SESSIONS_LI
return res.json();
}
async function createEpisode(sessionId, userMessage, aiResponse, tokenCount) {
async function createEpisode(sessionId, userMessage, aiResponse, tokenCount, projectId=null) {
const res = await fetch(`${BASE_URL}/episodes`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ sessionId, userMessage, aiResponse, tokenCount })
body: JSON.stringify({ sessionId, userMessage, aiResponse, tokenCount, projectId })
});
if (!res.ok) throw new Error(`Failed to create episode: ${res.status} ${res.statusText}`);
return res.json();

View File

@@ -33,9 +33,15 @@ async function searchEpisodes( vector, {limit = ORCHESTRATION.RECENT_EPISODE_LIM
return data.result;
}
async function searchEntities(vector, { limit = 5, scoreThreshold = 0.6 } = {}) {
async function searchEntities(vector, { limit = ORCHESTRATION.ENTITIES_LIMIT, scoreThreshold = ORCHESTRATION.ENTITIES_THRESHOLD, projectId = undefined } = {}) {
const body = { vector, limit, score_threshold: scoreThreshold, with_payload: true };
if (projectId !== undefined) {
body.filter = {
must: [{ key: 'projectId', match: { value: projectId ?? null } }]
};
}
const res = await fetch(
`${BASE_URL}/collections/${COLLECTIONS.ENTITIES}/points/search`,
{