Hritul Srivastava
← Lab·Case Study·August 18, 2026

SAGE-AI

Context-aware answers your team can actually trust, at the moment they need them.

SAGE-AI is a production AI assistant built for teams whose knowledge lives in too many places: docs, tickets, chat threads, half-remembered conversations. It doesn't just search that knowledge. It remembers who's asking, holds a real conversation across sessions, retrieves the right documentation on demand, and takes action (scheduling, reminding, looking things up) without losing the thread.

Built for B2B teams where the cost of a wrong or slow answer is measured in escalations, not just annoyance: support-and-ops-heavy organizations, platforms with dense technical documentation, and teams tired of paying for a chatbot that forgets everything the moment the tab closes.

The answer exists. Nobody can find it.

Most teams don't have a "search" problem. They have a trust problem.

Knowledge is scattered across a docs site, a support inbox, a Slack history, and three people's heads. Every new question either gets re-answered from scratch by a human who's answered it forty times before, or it gets handed to a chatbot that confidently makes something up. Neither is cheap. Engineer and support hours get burned re-explaining what's already been written down, and every hallucinated answer (every wrong URL, every invented feature) quietly erodes the one thing a support tool is supposed to build: confidence that the answer in front of you is real.

The real blocker isn't "we need AI." It's that generic search and generic chatbots treat every question like it's the first one anyone's ever asked, with no memory of the person, the account, or the conversation five minutes ago.

Why the last chatbot didn't stick

Plain keyword search breaks the moment a user phrases a question differently than the docs do. Naive vector search does better, but on its own it's still stateless. It retrieves a paragraph, not an answer, and it has no idea who's asking or what they asked three turns ago.

Off-the-shelf RAG chatbots compound this. They bolt an LLM onto a vector index and call it done: no memory across sessions, no distinction between what's durable (a user's role, their preferences, a decision they made) and what's noise, no gating on how confident the retrieval actually is before it gets handed to the model. The result is a bot that's fluent but forgetful: impressive in a demo, frustrating by the third real conversation, and prone to citing documentation that's only tangentially related because nothing stopped it.

An answer is only as good as its context

SAGE-AI is built around one idea: an answer is only as good as the context around it. Instead of a single retrieval step feeding a single model call, SAGE-AI runs a context-aware, agentic pipeline. It pulls together who the user is, what's been discussed in this conversation, what's been learned about this user across every conversation, and what the documentation actually says, and only then decides how to answer. When a question needs an action rather than an answer (schedule a meeting, set a reminder, check the date), it reasons about which tool to use and executes it, with a human confirming anything that has a real-world side effect.

This is the bridge between "chatbot" and "assistant": SAGE-AI treats every message as part of an ongoing relationship with a specific user, not an isolated prompt.

What changes once it's running

Once this is running, the shape of the work changes. Repetitive questions stop reaching a human queue because SAGE-AI already knows the answer, and increasingly knows it before being asked twice, because it remembers what this specific user cares about. Escalations drop because the assistant is grounded in real documentation with a relevance bar it won't cross, rather than guessing. Conversations feel continuous instead of robotic. A user can pick up a thread from last week and the assistant already has the context, without re-explaining who they are or what they were trying to do.

The team gets fewer interruptions. The user gets faster, more consistent answers. And every answer the assistant gives is traceable back to a real source, so trust compounds instead of eroding.

Already running real traffic

SAGE-AI isn't a prototype wrapped around a single API call. It's a multi-layer system already carrying real production traffic:

  • Three independent memory layers (session, short-term, long-term) working together so context never resets mid-conversation.
  • A live retrieval pipeline over MongoDB Atlas Vector Search, with relevance thresholds enforced twice before a document is allowed anywhere near the model's context.
  • Per-user tenant isolation enforced at the query level, not filtered after the fact, across every memory and retrieval layer.
  • A cost-aware model routing layer that scales reasoning effort to the task instead of paying premium-model prices for a title generation.
  • Human-in-the-loop confirmation on every action with a real-world side effect, by design, not as an afterthought.

If you want to see it live rather than read about it, that's what the demo is for.

Under the hood

SAGE-AI's request pipeline is built as a set of specialized services, each owning one concern: session state, short-term memory, long-term memory, retrieval, model orchestration, and tool execution. Here's how a message actually moves through the system.

Instant, streaming responses

Every conversation has a live, low-latency state layer backed by Redis, separate from the durable record in MongoDB. The rolling conversation window (up to the last 100 messages) lives in Redis as a single addressable structure per chat, so the system isn't round-tripping to the database on every turn just to know what was said a minute ago. User profile data is cached the same way, with a database fallback if the cache ever misses, so a cold cache never becomes a broken request.

This is also where responsiveness is engineered in: as a message comes in, SAGE-AI streams progress back to the user in real time, surfacing what it's doing at each stage (retrieving documentation, checking memory, calling a tool) as the answer is being assembled, rather than leaving the user staring at a blank screen until the full response is ready. Redis is the backbone that makes that live, low-latency experience possible, alongside the same layer enforcing per-minute and per-day usage limits so no single session can degrade service for everyone else.

Remembering the conversation

Within a single conversation, SAGE-AI doesn't just keep raw transcript. It actively extracts what matters. After each exchange, a lightweight extraction pass pulls out "crux points": the salient facts worth remembering from that specific turn. These are embedded and stored per-conversation, and every 5 messages the system also regenerates a rolling summary of the conversation so far. When a new message comes in, both the crux points and the summary are pulled back in via semantic similarity. The assistant isn't just remembering that something was said, it's remembering the parts that were actually important.

Remembering the person

Short-term memory resets with the conversation. Long-term memory doesn't. Facts worth keeping (a user's role, their preferences, a decision they made) are promoted into a durable, per-user memory store in MongoDB Atlas, indexed for semantic vector search. A classifier decides, per fact, whether it's durable enough to promote, so long-term memory doesn't fill up with noise. Retrieval is tenant-isolated at the query level: the vector search itself is scoped to the requesting user, not filtered afterward, so one user's history can never leak into another's context. Storage is bounded with importance-weighted eviction, so the memory store stays sharp rather than sprawling indefinitely.

Assembling the full picture

Every incoming message triggers a parallel context-assembly step: short-term memory search, conversation summary, and long-term memory search all run concurrently rather than in sequence, then get merged with the user's profile and the retrieved documentation into a single grounded context for the model. Token budgets are enforced at three independent layers (per message, per conversation, and per day) so cost and context size stay predictable regardless of how long a conversation runs.

Finding the right documentation

Documentation retrieval runs on MongoDB Atlas Vector Search with OpenAI embeddings. Rather than a single similarity search, SAGE-AI expands a query into multiple variants, handling abbreviations and synonyms a user might use instead of the documentation's exact wording, searches across all of them, then deduplicates and reranks by relevance score. Results are held to a similarity threshold before they're allowed into the model's context, and a second, stricter relevance pass filters the final set again before generation. It's a deliberate double-gate against citing documentation that's merely adjacent rather than actually relevant.

Premium reasoning only where it matters

Not every call SAGE-AI makes needs the same amount of reasoning. The system routes by task: the primary conversational response gets the full reasoning budget, while lightweight administrative calls (generating a chat title, deciding whether a fact belongs in long-term memory) run on a capped reasoning budget, and a set of deterministic, pre-model checks intercept known intents before they ever reach the model at all. On top of task-based budgeting, SAGE-AI is built provider-agnostic: it can route between model providers by task and cost profile rather than being locked to a single vendor, so the economics of running the assistant scale sensibly with usage instead of linearly with every message.

Taking action, with your approval

Beyond answering questions, SAGE-AI can act: checking the date and time, creating reminders, scheduling meetings, pulling in live information when a question needs it. Tool availability isn't wide open. A deterministic classifier decides which tools are even relevant to a given message before the model sees them, so the assistant isn't tempted into calling something unrelated. And critically, any tool with a real-world side effect (a reminder, a calendar invite) doesn't fire automatically. It returns a pending action that requires explicit user confirmation before anything actually happens. The model can propose. Only the user can commit.

Who can see what

Every request is authenticated via signed, cookie-based session tokens, with entitlement checks (plan/feature access) layered on top and cached for performance with an explicit invalidation path when a subscription changes. Every chat and message is scoped to its owning user and checked on every read and write. There is no code path where one user's conversation is reachable from another's session. Requests are schema-validated before they reach any business logic, and error responses are sanitized so internal failures never leak implementation details back to the client.

Keeping it honest

Input is validated before it ever reaches the model: length-bounded, and screened for patterns that shouldn't be sent to an LLM at all (credentials, sensitive identifiers). The system prompt itself carries explicit constraints: don't invent features or URLs that aren't in the documentation, don't request or store sensitive personal information, stay within what's actually grounded. Retrieval relevance thresholds function as a factuality guardrail, keeping weakly-related documents out of the model's context in the first place. And as covered above, anything with a real-world consequence requires human confirmation, the strongest guardrail available against an agent overstepping its role.

When something breaks, you still get your answer

SAGE-AI is designed so that no single failure point takes down the user's experience. Caches fall back to the durable store when they miss. Memory-write failures (the background work of extracting and saving what's worth remembering) are isolated so they never block or fail the user-facing response; the user gets their answer even if the memory pipeline hiccups behind the scenes. Retry logic with validation guards the parts of the pipeline most exposed to transient failure. The system is layered defense-in-depth rather than a single chain that breaks at its weakest link.

Questions teams ask first

"How much engineering effort does this take to integrate?" SAGE-AI is a service layer, not a rip-and-replace platform migration. It sits alongside your existing documentation and data. Retrieval is configured against your content, not the other way around.

"Is our data secure?" Every layer (session state, short-term memory, long-term memory, retrieval) is tenant-isolated at the query level, not filtered after the fact. Authorization is enforced on every read and write, and nothing about one user's conversation is ever reachable from another's session.

"Will it hallucinate?" Every answer is grounded against retrieved documentation held to an explicit relevance threshold, gated twice before it reaches the model. The system is explicitly instructed never to invent features, URLs, or details that aren't in the source material, and anything with a real-world consequence requires human confirmation before it happens.

"What's the implementation timeline?" Because retrieval, memory, and orchestration are already built and battle-tested, implementation is primarily a configuration and content-connection exercise, not a from-scratch build.

"What if we want to switch tools later?" The model layer is provider-agnostic by design. SAGE-AI isn't locked to a single LLM vendor, which means your investment in the surrounding system (memory, retrieval, guardrails) isn't tied to any one model's pricing or availability.

Where it fits best

  • Support-heavy platforms drowning in repeat questions that are already answered somewhere in the docs, but not in a form anyone can find fast enough.
  • B2B products with dense technical documentation (API references, integration guides, changelogs) where a wrong answer costs an engineer's afternoon.
  • Ops and internal-tools teams who need an assistant that remembers context across a work session, not just a search bar with a chat UI bolted on.

Why SAGE-AI exists

SAGE-AI was built by Hritul, the engineer behind hritul.com, out of frustration with chatbots that forget everything the moment a session ends. Most "AI chatbot" products treat every message as a cold start: no memory, no sense of who's asking, no real distinction between an answer worth trusting and a plausible-sounding guess. SAGE-AI is the opposite bet: that a good assistant behaves less like a search box and more like a colleague who remembers the last conversation.

See it running on your docs

If your team is losing hours to questions that are already answered somewhere, or a chatbot that answers confidently but incorrectly, let's talk about what SAGE-AI would look like running on your documentation.