Problem with building email history in one thread and qdrant data base

Qdrant behavior — I need “helper,” not “gatekeeper”

Right now my pipeline uses Qdrant as the knowledge base. The agent retrieves from Qdrant and if nothing relevant is found it escalates to a human. I want the opposite behavior:

  • Qdrant = assistive retrieval (RAG context), not the sole source of truth.

  • No automatic escalation on “no hit” or low similarity — instead, the agent should either:

    • generate a best-effort reply from general policy/templates,

    • ask a clarifying question,

    • or follow a fallback decision tree (but still not escalate).

Questions:

  • Recommended way to wire this in n8n so Qdrant is optional, not a hard gate? (Branching patterns, function nodes, or confidence thresholds you like?)

  • Practical similarity cutoffs / top-k defaults for production (to avoid hallucinations yet keep recall)?

  • Chunking & metadata tips (e.g., product → locale → policy version) to improve retrieval without forcing escalation.

  • Any example workflows/snippets where an agent:

    1. tries retrieval,

    2. if low confidence, switches to fallback templates or asks for more info,

    3. logs the decision (for auditing) — all without escalating.

2) Email thread continuity — include prior messages & avoid thread mixing

I want every reply sent by the agent to attach/quote prior messages with the customer so the thread stays readable. Also, when 2–3 emails arrive at once, I need to avoid mixing threads.

Questions:

  • Exact Gmail / Workspace headers & fields to keep replies in the same thread and preserve history (e.g., threadId, In-Reply-To, References, Message-ID) — what’s the reliable combo in practice?

  • Best way to fetch and append the last N messages as quoted history before sending a reply (so users see the full context).

  • Concurrency patterns that work well in n8n:

    • queueing one worker per threadId,

    • idempotency keys (e.g., threadId + lastMessageId),

    • using historyId / label locks to prevent double-answers,

    • simple mutex/Redis lock examples welcome.

  • How do you dedupe when the same customer sends multiple emails quickly (e.g., race conditions between triggers)?

thank u!!

what are you thanking me for?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.