AI CHAT
RAG answers with source citations
Every answer BeforeQuery generates includes links back to the exact source — doc page, ticket, or repository file. Users verify, click through, and trust.
What powers every answer
A production-grade RAG stack you do not have to build yourself
RAG Pipeline
Smart retrieval- LLM query rewrite and expansion before retrieval
- Semantic vector search with embedding model
- BM25 keyword matching for precision
- Reciprocal rank fusion for result merging
- Cross-encoder re-ranking for top result quality
- Multi-collection queries across sources
Answer Quality
Citation-first- Inline source citations on every answer
- Direct links to exact doc page and anchor
- Suggested questions and related articles
- Confidence scoring and low-confidence fallback
- Hallucination prevention via grounding checks
- Structured output for code and tables
Conversation
Context-aware- Multi-turn conversation memory
- Pronoun and reference resolution
- Session persistence across widget reloads
- Suggested follow-up questions after each answer
- Clear conversation and start over
- Shareable conversation links
SURFACE ANSWERS ANYWHERE
One RAG pipeline, every channel
The same AI Chat engine powers your embeddable widget, your Slack bot, your Discord server, your Teams integration, and your Chat API. Change a source document and every channel reflects the update within minutes.
- Embeddable widget with full style override support
- React component for deeper integration
- JavaScript SDK for custom UI builds
- POST /chat API for server-side or mobile callers
- Slack, Discord, and Teams bots with citation links
POST /v1/chat
REQUEST
{
"project_id": "proj_abc123",
"question": "How do I rate-limit the API?",
"session_id": "sess_xyz"
}RESPONSE
{
"answer": "Use the X-RateLimit-* headers...",
"citations": [
{
"title": "Rate Limiting Guide",
"url": "https://docs.example.com/rate-limits",
"excerpt": "All API calls are subject to..."
}
],
"confidence": 0.94
}Frequently Asked Questions
Common questions about BeforeQuery AI Chat
BeforeQuery uses best-in-class models from Anthropic and OpenAI depending on the task. The retrieval and reranking layer is model-agnostic. Enterprise customers can bring their own LLM endpoint.
After retrieval, each source chunk is tracked with its URL and page title. The LLM is prompted to cite sources inline. The final response JSON includes a structured citations array with URL, title, and excerpt for each source used.
When retrieval confidence is below the threshold, BeforeQuery returns a transparent fallback message rather than hallucinating. You configure the fallback text — typically pointing users to a support channel.
Yes. The Chat API supports server-sent events (SSE) streaming. The widget uses streaming by default for a fast perceived response time.
Each session_id maps to a conversation context window. BeforeQuery summarizes older turns to stay within the LLM context limit. Sessions expire after 24 hours of inactivity.
Ship AI chat in your docs today
Connect a knowledge source and embed the widget in under 5 minutes.
Get Started Free