Long-term conversational agents need memory that is lightweight but can represent relations and state changes. QGMem addresses this by converting dialogue histories into atomic, event-indexed memory units and consolidating related units into dynamic traces that track evolving states. At query time, hybrid retrieval and query-aware reranking select a compact working memory, and a local graph over those facts is encoded into a graph token that goes to the LLM alongside the text.
Across six benchmarks including conflict resolution and ultra-long dialogues, QGMem outperforms existing flat and graph memory systems, with gains on retrieval, multi-hop evidence composition, and conflict-aware reasoning. The approach keeps generated context compact and works across Qwen3-8B, Llama3.1-8B-Instruct, and GPT-4o-mini.