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

Abierto
#311 2 comentarios 0 reacciones 0 asignados Ver en GitHub

@shubhumre777 ya está trabajando en esto.

Desde el 27/10/2026.

  • #312 de @shubhumre777 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python, supabase
Área
ai, backend, databases

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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
Lenguaje dominante
Python
Estrellas
103
Forks
143
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de AOSSIE-Org/Devr.AI

Todos los issues de AOSSIE-Org/Devr.AI

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.