Add conversation route + wire NLP intelligence into memory writes#5
Merged
Merged
Conversation
Two fixes to make the agent actually answer well and use the NLP layer: 1. Conversation node (fixes "no proper answer") Previously every message was forced into memory/knowledge/execution/ repo_analysis. A general question like "can u explain me" got classified as `memory`, found nothing, and the LLM apologised about an empty memory store instead of just answering. Added a `conversation` route that is now the router's default: it answers naturally with the LLM, injecting relevant stored memories as optional context (never as a gate), and uses prior turns for continuity. Ambiguous/failed classification now falls back to conversation instead of execution. 2. NLP intelligence wired into knowledge writes The Python spaCy/sentence-transformers service was built but never called during chat. nodeKnowledge now makes a best-effort call to /analyze/memory after storing, folds the extracted entities/ relationships into the knowledge graph via ingestKnowledgeGraph, and reports the counts back to the user. It is fully non-blocking: an 8s-timeout AbortController and try/catch mean a down/slow service degrades to a plain "saved to memory" — persistence never depends on NLP. Verified against local Ollama: conversation answers real questions (no more memory apology), memory recall works, knowledge writes succeed with the NLP service both up (entities/relationships land in graph.db) and down (graceful fallback). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the "no proper answer" problem seen in the local workspace and makes the NLP layer actually do something.
1. Conversation route (the missing piece)
Every message was previously forced into
memory/knowledge/execution/repo_analysis. A general question like "can u explain me" got classified asmemory, retrieved nothing, and the LLM apologised about an empty memory store instead of answering. Added aconversationnode that is now the router's default — it answers naturally with the LLM, injects relevant stored memories as optional context (never as a gate), and uses prior turns for continuity. Ambiguous/failed classification now falls back to conversation instead of the JSON-only execution planner.2. NLP intelligence wired into knowledge writes
The Python spaCy + sentence-transformers service existed but was never called during chat.
nodeKnowledgenow makes a best-effort call to/analyze/memoryafter storing, folds extracted entities/relationships into the knowledge graph, and reports the counts. Fully non-blocking (8s AbortController + try/catch) — a down service degrades to a plain "saved to memory."Test plan (verified against local Ollama)
"can u explain me"→ real answer, no memory apology"Explain how transformers work"→ substantive conversational answer"Remember that Yashas prefers PostgreSQL"→ stored; with NLP up, reported "2 entities and 1 relationship";graph.dbshowsyashas PREFERS postgresql"What is my favorite database?"→ recalled correctly🤖 Generated with Claude Code