Skip to content

docs(synap): fix pipeline example — add user query path and wire memory_writer#520

Closed
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-review-comment-3435602430
Closed

docs(synap): fix pipeline example — add user query path and wire memory_writer#520
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-review-comment-3435602430

Conversation

Copilot AI commented Jun 18, 2026

Copy link
Copy Markdown

The "Use in a Pipeline" example fed memory_retriever.messages directly into ChatPromptBuilder.template, leaving no path for the user's current query, and memory_writer was added to the pipeline but never connected.

Changes

  • Replace ChatPromptBuilder with OutputAdapter — merges retrieved memory messages with the current user message ({{ memories + user_messages }}), matching the pattern used by mem0-haystack
  • Wire memory_writer — connect llm.replies → memory_writer.messages to actually persist conversation turns
  • Add pipeline.run(...) call — shows how to supply both the retrieval query and the user message at runtime
pipeline.connect("memory_retriever.messages", "memory_context.memories")
pipeline.connect("memory_context.output", "llm.messages")
pipeline.connect("llm.replies", "memory_writer.messages")

result = pipeline.run(
    {
        "memory_retriever": {"query": query},
        "memory_context": {
            "user_messages": [ChatMessage.from_user(query)],
        },
    }
)

@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
haystack-integrations Ready Ready Preview, Comment Jun 18, 2026 12:17pm

Request Review

Copilot AI changed the title [WIP] Fix code based on review comment 3435602430 docs(synap): fix pipeline example — add user query path and wire memory_writer Jun 18, 2026
Copilot AI requested a review from kacperlukawski June 18, 2026 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants