FAQ Page

The FAQ page at /faq generates a structured question-and-answer document for any topic using the knowledge base. Results are cached for 7 days so repeated visits to the same topic are served instantly.

How it works

  1. The page reads the q, source, and lang query parameters from the URL
  2. It calls GET /api/v1/faq with those parameters
  3. The API checks its database cache — if a matching entry exists and hasn't expired, it returns immediately (cached: true)
  4. On a cache miss, it fetches broad content from the knowledge base (not a top-K search — it retrieves a wider set of chunks to cover the topic comprehensively), then generates 5–10 Q&A pairs using the LLM
  5. The result is written to the cache with a 7-day TTL and returned as Markdown

URL parameters

ParamRequiredDescription
qYesThe topic or question to generate a FAQ for
sourceNoNamespace to search. Default: user_docs. Use all for all namespaces.
langNoBCP 47 language code (en, nl, de, fr). Defaults to auto-detection.

Example URLs:

/faq?q=asset+upload
/faq?q=role-based+access&source=tech_docs&lang=nl
/faq?q=webhooks&source=all

Without a q parameter, the page shows a prompt to provide one.

Caching

The cache key is a combination of the query string, namespace scope, and language. Two requests with the same topic but different languages or sources are cached separately.

Cache TTL is 7 days (expiresAt). After expiry, the next request regenerates the FAQ and refreshes the cache entry. There is currently no admin UI to manually invalidate cache entries — use the database directly if needed.

The response includes a Cached badge when the result came from the cache, so you can tell at a glance whether the content was freshly generated.

Difference from chat

The FAQ pipeline is fundamentally different from chat:

ChatFAQ
RetrievalTop-K semantic searchBroad content fetch
OutputConversational answerStructured Q&A document
HistoryConversation threadStateless
CachingNone7-day TTL
AuthNot requiredNot required

The FAQ endpoint fetches more content than a typical chat query because it needs to cover an entire topic, not just answer a single question.

Linking to the FAQ page

Link to a pre-filled FAQ from anywhere in the Cape product:

https://your-host/faq?q=asset+collections&source=user_docs&lang=en

This is the intended usage pattern — deep-link from help tooltips, onboarding flows, or support pages to a dynamically generated FAQ for that specific topic.

API access

The FAQ can also be consumed programmatically (no auth required):

curl "https://your-host/api/v1/faq?q=asset+upload&source=user_docs&lang=en"

Response:

{
  "query": "asset upload",
  "scope": "user_docs",
  "language": "en",
  "content": "# Asset Upload FAQ\n\n## How do I upload an asset?\n\n...",
  "cached": false
}

content is Markdown and can be rendered in any surface that supports it.