Overview
Agentic Chat is an AI workspace that combines document search, long-term memory, web research, and OAuth-connected apps so it can answer with better context and take real action on your behalf.
The system intelligently decides what context to pull in before the model sees a message, including past conversation memory, relevant document chunks, live web searches, or URL content, and assembles it into the prompt automatically.
A LangGraph orchestrator manages the process, running a planner, an agent, and a tool execution loop. The agent can connect to various applications like Gmail, Google Calendar, Drive, Docs, Sheets, Slack, Notion, GitHub, and Linear through Composio. Crucially, any action that writes, sends, or deletes data requires explicit user approval before execution.
The technology stack includes Next.js 16, React 19, PostgreSQL with pgvector for vector search, Prisma, Better Auth for Google sign-in, and UploadThing for file storage. Users have the option to bring their own OpenAI key, which is encrypted at rest and never sent to the client. LangSmith is used to trace every step of the graph.
How It Was Built
- Developed the LangGraph orchestrator from scratch, featuring a planner node for request breakdown, a supervisor agent for decision-making, and a tool node for execution, all within a loop with PostgreSQL checkpointing for conversation resumption after approvals.
- Built an end-to-end document pipeline: file upload via UploadThing, parsing for various file types (PDF, DOCX, XLS, CSV), 800-token semantic chunking, OpenAI embeddings stored in pgvector, hybrid retrieval, and Cohere reranking for relevant chunk surfacing.
- Integrated Composio for dynamic loading of user-connected tools based on OAuth accounts, including routes for connection, callbacks, and status, along with a dangerous-action allowlist and verb-based detection for write operations requiring approval.
- Implemented the BYOK (Bring Your Own Key) flow with AES-256-GCM encryption for user API keys, and a server-side proxy for secure decryption and forwarding to OpenAI.
- Integrated SSE streaming from LangGraph's event stream to the client for real-time updates on token chunks, tool progress, approval requests, and planning steps, with full abort support.
Impact
- A semantic cache with pgvector similarity search efficiently reuses prior answers for repeated or similar queries, reducing redundant embedding and generation calls.
- Composio streamlined OAuth integration, replacing per-service plumbing with a single integration covering 9 toolkits and 94 actions.
- Approval cards provide a critical safety layer, gating all write/send/delete actions proposed by the agent for explicit user confirmation.
- BYOK enables teams to leverage their existing OpenAI contracts without sharing plaintext keys.
Highlights
- The LangGraph loop with PostgreSQL checkpointing ensures conversation state is maintained across approval interrupts, allowing the agent to resume seamlessly.
- A three-tier web scraping mechanism (Readability → Firecrawl → Jina Reader) enables the agent to access content from most web pages, including those rendered with JavaScript.
- A two-layer safety system for Composio actions, including an explicit allowlist and a verb detector, ensures secure operation.
Tech Stack
- Next.js 16
- React 19
- TypeScript 6
- LangGraph 1.3.2
- LangChain
- LangSmith
- OpenAI SDK v6
- Composio
- Exa Search
- Firecrawl
- Cohere Reranking
- Mem0
- PostgreSQL + pgvector
- Prisma v6
- Better Auth
- RAG
- BYOK (AES-256-GCM)
- Tailwind CSS 4