BUG:Devr.AI Agent loses user_profile for returning users and fails to persist conversation summaries & cumulative interaction counts

Aperta
#311 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@shubhumre777 ci sta già lavorando.

Dal 27/10/2026.

  • #312 di @shubhumre777 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python, supabase
Ambito
ai, backend, databases

Direzione di ricerca

Read backend/app/agents/devrel/nodes/gather_context.py and backend/app/agents/devrel/nodes/summarization.py, then run tests/test_devrel_memory.py to understand the reported failures. Check how returning-user profiles enter AgentState, how summaries are stored, and how interaction totals are updated across summarization cycles. Done means the profile is retained and summaries and cumulative counts persist correctly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is there an existing issue for this?
  • I have searched the existing issues
What happened?
Description

While investigating the LangGraph workflow for the DevRel Agent (backend/app/agents/devrel/), I identified three connected bugs in the cross-session memory and summarization pipeline that prevent long-term context persistence:

  1. Returning Users Lose user_profile in gather_context_node (gather_context.py):

    • When a returning user's previous conversation context (prev_context) is found in Supabase, gather_context_node performs an early return containing conversation_summary and key_topics, but omits "user_profile": profile_data.
    • In contrast, the fallback path for new users explicitly attaches result["user_profile"] = profile_data. As a result, returning users always have an empty user_profile in AgentState.
  2. Conversation Summaries Are Not Persisted During Active Workflow (summarization.py):

    • When interaction_count reaches SUMMARIZATION_THRESHOLD (15), summarize_conversation_node generates new_summary and new_topics via the LLM, but never calls store_summary_to_database().
    • Because the agent uses InMemorySaver(), summaries generated during active sessions are lost if the server restarts before clear_thread_memory() is externally invoked.
  3. total_interactions Count Is Overwritten/Reset Instead of Accumulated (summarization.py):

    • summarize_conversation_node returns "interaction_count": -current_count to reset the session interaction counter to 0 via the add reducer.
    • When store_summary_to_database() runs later, it writes "total_interactions": state.interaction_count directly to conversation_context, overwriting previous database totals with 0 (or only the remainder since the last reset) instead of accumulating total interactions across summarization cycles.
Proposed Fix
  • backend/app/agents/devrel/nodes/gather_context.py: Unify the return payload in gather_context_node so that user_profile is preserved in AgentState even when prev_context is loaded from Supabase.
  • backend/app/agents/devrel/nodes/summarization.py:
    • Persist the updated summary and topics in summarize_conversation_node via store_summary_to_database() before resetting interaction_count.
    • Accumulate total_interactions in store_summary_to_database() by adding the current session's interaction_count to the existing total_interactions stored in Supabase.

I have reproduced and successfully validated the fixes with local unit tests (tests/test_devrel_memory.py). I would love to be assigned to this issue and submit a PR!

Record
  • I agree to follow this project's Code of Conduct
  • I want to work on this issue
Lingua principale
Python
Stelle
103
Fork
143
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/Devr.AI

Tutte le issue di AOSSIE-Org/Devr.AI

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.