Prompt
I'm building an agent that talks to our CRM and docs, what stack should I use?
Latest observation
Oct 9, 2026
OpenAI APIWeb search: off
A good stack for an agent that talks to a CRM and internal docs usually has 5 layers:
- LLM layer
- Tool / integration layer
- Retrieval layer for docs
- Orchestration / state layer
- Safety / observability / evals
A practical default stack
1) Model
- OpenAI GPT-4.1 / GPT-4o for strong tool use, structured outputs, and general reasoning
- If you need lower cost/high throughput: a smaller OpenAI model for routine tasks, with a larger model for escalations
2) Agent orchestration
Pick one:
- LangGraph if you want robust multi-step flows, state, retries, branching, approvals
- OpenAI Responses API / Assistants-style tool calling if you want a simpler implementation and can keep orchestration mostly in your app
- LlamaIndex if the center of gravity is document retrieval and knowledge workflows
My default recommendation for enterprise CRM + docs is:
- LangGraph for agent workflow control
- OpenAI tool calling for the actual model interaction
3) CRM + docs integration
- Build thin, explicit API wrappers around:
- CRM: Salesforce, HubSpot, etc.
- Docs: Google Drive, Confluence, Notion, SharePoint, Slack, etc.
- Use typed schemas for every tool input/output.
- Add idempotency keys for write actions.
4) Retrieval for docs
- Postgres + pgvector is a great default if your scale is moderate
- If you expect large-scale semantic search, use:
- Pinecone, Weaviate, or Qdrant
- For ingestion:
- chunking + metadata
- hybrid retrieval if possible (keyword + vector)
- source citations in responses
5) App/backend
- Python + FastAPI is the easiest choice for agent backends
- Use:
- Pydantic for schemas
- Postgres for state, audit logs, and user data
- Redis for queueing, caching, and short-lived session state
- Celery / Temporal / Prefect for async jobs and longer workflows
6) Observability and evals
- LangSmith or OpenTelemetry + your APM
- Store:
- prompts
- tool calls
- retrieved documents
- final outputs
- user feedback
- Add offline evals with a small golden dataset of CRM/doc tasks
If you want the simplest good stack
If you’re optimizing for speed to production:
- Frontend: Next.js
- Backend: FastAPI
- Agent orchestration: LangGraph
- LLM: OpenAI GPT-4.1 or GPT-4o
- Vector store: Postgres + pgvector
- DB: Postgres
- Cache/queue: Redis
- Auth: OAuth / SSO
- Observability: LangSmith + OpenTelemetry
That’s a very solid “default enterprise agent” stack.
If the agent will take actions in CRM
Make sure you add:
- approval steps for risky actions
- read-only mode first
- tool allowlists
- role-based access control
- audit logs
- human-in-the-loop for updates/deletes
- rate limits and retries
For example:
- Read customer info: automatic
- Draft email: automatic but reviewable
- Update CRM fields: require approval for first release
- Delete records / close deals: never autonomous at first
Architecture pattern I’d recommend
A clean pattern is:
- Agent planner
- decides whether to answer, search docs, query CRM, or take action
- Tool executor
- strictly typed API calls
- Retriever
- fetches relevant docs and knowledge
- Policy layer
- checks permissions, safety, and business rules
- Audit layer
- logs everything
This avoids a “free-roaming chatbot” and makes it production-friendly.
What I would choose today
If I were building this now, I’d pick:
- Python + FastAPI
- LangGraph
- OpenAI GPT-4.1
- Postgres + pgvector
- Redis
- Temporal if workflows are long-running
- LangSmith for tracing/evals
- Next.js for the UI
- OAuth/SSO + RBAC
Quick rule of thumb
- Mostly docs Q&A? LlamaIndex + pgvector
- Complex multi-step CRM workflows? LangGraph + tool calling
- Need enterprise control/auditability? FastAPI + Postgres + explicit tools + approvals
If you want, I can suggest:
- a minimal MVP stack,
- a scalable enterprise stack, or
- a reference architecture diagram for your exact CRM/docs setup.