How I isolated credentials in a multi-tenant agent platform with per-chat MCP subprocesses

International_Gap713 · reddit · 2026-11-24

An engineer building a no-code platform where customers create their own AI agents (support bots over docs, sales agents reading CRMs) shares what worked — concluding that agent quality is mostly a systems problem, not a prompt problem.

1. Credentials belong to the chat, not the agent

2. Show the model fewer tools: with 50 tools, selection degraded and descriptions ate context; a cheap routing step scores tools against each user message and exposes only the top few

3. Hybrid retrieval: pure embeddings missed exact strings (error codes, SKUs); combining OpenAI embeddings with BM25, reranking, then compressing chunks to relevant sentences worked — the reranker made the biggest difference

4. Validate everything before execution: strict Pydantic schemas for all tool calls and answers, LangGraph state machines for multi-step flows

Original post →

More from coding & agent

coding & agent channel →