Prompt
I need to build an agent that can read docs, query a database, and create tickets, what stack should I use?
Latest observation
Oct 9, 2026
OpenAI APIWeb search: off
A solid stack for an agent that reads docs, queries a database, and creates tickets is usually:
Recommended stack
1. Agent/orchestration layer
- Python for the main agent runtime
- LangGraph if you want reliable multi-step workflows and tool use
- OpenAI API or another LLM provider for reasoning and tool calling
Why:
- Python has the best ecosystem for data access, parsing, and automation.
- LangGraph is better than a simple prompt loop when the agent needs state, retries, and approvals.
2. Document ingestion / retrieval
- Unstructured, LlamaIndex, or LangChain loaders to ingest docs
- Postgres + pgvector if you want a simpler, production-friendly vector store
- Or Pinecone / Weaviate / Qdrant if you want managed or dedicated vector DBs
For most teams:
- Start with Postgres + pgvector
- Use LlamaIndex or LangChain for retrieval if you want faster implementation
3. Database access
- Postgres is the default recommendation if you can choose
- Use:
- SQLAlchemy for DB access in Python
- Or direct SQL for tighter control
- If the agent needs to query business data safely:
- expose a read-only DB user
- consider a SQL validation layer before execution
4. Ticket creation / integrations
Depends on your ticketing system:
- Jira: Jira REST API
- Linear: Linear API
- ServiceNow: ServiceNow REST API
- Zendesk: Zendesk API
- Or use Zapier/Make only for low-complexity workflows
For production, call the APIs directly from your agent service rather than relying on no-code tools.
5. App/API layer
- FastAPI for exposing the agent as a service
- Add:
- auth
- request logging
- rate limiting
- audit trails
6. Background jobs / reliability
- Celery + Redis or RQ for async tasks
- Or use Temporal if workflows are long-running and need strong reliability
If the agent will:
- ingest docs
- run DB queries
- create tickets asynchronously
then a job queue is very useful.
7. Observability and guardrails
- LangSmith or OpenTelemetry for tracing
- Pydantic for structured outputs and validation
- Human approval step for ticket creation if actions are high impact
- Secrets in Vault, AWS Secrets Manager, or similar
Best practical stack for most teams
If you want a sane, production-ready default:
- Python
- FastAPI
- LangGraph
- OpenAI API
- Postgres + pgvector
- SQLAlchemy
- Jira/Linear/ServiceNow REST API
- Celery + Redis
- Pydantic
- OpenTelemetry/LangSmith
Simpler MVP stack
If you want to move fast with less infrastructure:
- Python
- FastAPI
- LlamaIndex
- Postgres + pgvector
- OpenAI API
- Direct ticketing API
- No queue initially, unless tasks are long-running
Key design recommendation
Make the agent tool-based, not fully autonomous:
- tool 1: search docs
- tool 2: query DB
- tool 3: draft ticket
- tool 4: create ticket only after validation/approval
That gives you much better reliability and control.
If you want, I can also propose:
- a minimal MVP architecture,
- a production architecture, or
- a specific stack based on your ticketing system (Jira, ServiceNow, Linear, etc.).