mirror of
https://github.com/Alkatrazz24/Funk-lab.git
synced 2026-07-08 22:04:41 +02:00
feat(stt): mémoire long-terme sémantique via Qdrant (5b) (#10)
Serveur : longterm.py — collection Qdrant stt-memory (embeddings Qwen3 gpu-01, dim auto, Cosine), recall top-k injecté au prompt, remember des tours user. Tout dégrade proprement si Qdrant/embeddings injoignables (la mémoire court-terme tient). Env STT_MEMORY_LONGTERM, STT_QDRANT_URL, STT_EMBED_URL, STT_MEMORY_TOPK. Testé en process : dégradation OK (Qdrant down → mem=0, pas de crash, court-terme tient). Qdrant réparé le 17/06 (5c). Recherche sémantique réelle à valider sur cluster. Claude-Session: https://claude.ai/code/session_013FmcxGsyXZXogiAHQLjnZT Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
70499b7d84
commit
1986ab56d8
7 changed files with 148 additions and 13 deletions
|
|
@ -12,8 +12,20 @@ import httpx
|
|||
from stt_server.config import settings
|
||||
|
||||
|
||||
async def ask(text: str, model: str | None = None, history: list[dict] | None = None) -> str:
|
||||
messages = [{"role": "system", "content": settings.system_prompt}]
|
||||
async def ask(
|
||||
text: str,
|
||||
model: str | None = None,
|
||||
history: list[dict] | None = None,
|
||||
memories: list[str] | None = None,
|
||||
) -> str:
|
||||
system = settings.system_prompt
|
||||
if memories:
|
||||
souvenirs = "\n".join(f"- {m}" for m in memories)
|
||||
system += (
|
||||
"\n\nÉléments de mémoire long-terme (peuvent aider, ignore si hors-sujet) :\n"
|
||||
+ souvenirs
|
||||
)
|
||||
messages = [{"role": "system", "content": system}]
|
||||
if history:
|
||||
messages += history
|
||||
messages.append({"role": "user", "content": text})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue