Files
zeekay c5456171d5 rip Inkeep from docs — 100% native Hanzo AI (rag-api + api.hanzo.ai/v1)
docs.hanzo.ai's AI chat now runs entirely on our own stack. The live
/api/chat route was already native (Hanzo gateway) but ungrounded — it
now retrieves from our rag-api index before answering, and cites sources:

  - retrieval: rag-api /query — native index over the docs
  - generation: Hanzo gateway (api.hanzo.ai/v1, zen-coder-flash)
  - sources: provideLinks tool, populated from the indexed metadata

Purged Inkeep repo-wide (only our stack, one way):
  - removed the dead third-party Inkeep handler (lib/inkeep -> lib/ai)
  - widget credit "Powered by Inkeep AI" -> "Powered by Hanzo AI"
  - create-app generator: dead `inkeep` provider -> native `hanzo`
    (installs the ai/hanzo registry bundle; INKEEP_API_KEY -> HANZO_API_KEY)
  - 4 legacy *-docs apps: de-Inkeeped schema, fixed dangling imports

Zero `inkeep` references remain in the codebase.
2026-07-23 22:20:25 -07:00

54 lines
1.2 KiB
TypeScript

import type { UIMessage } from 'ai';
import { z } from 'zod';
const HanzoRecordTypes = z.enum([
'documentation',
'site',
'discourse_post',
'github_issue',
'github_discussion',
'stackoverflow_question',
'discord_forum_post',
'discord_message',
'custom_question_answer',
]);
const LinkType = z.union([
HanzoRecordTypes,
z.string(), // catch all
]);
const LinkSchema = z.looseObject({
label: z.string().nullish(), // the value of the footnote, e.g. `1`
url: z.string(),
title: z.string().nullish(),
type: LinkType.nullish(),
breadcrumbs: z.array(z.string()).nullish(),
});
const LinksSchema = z.array(LinkSchema).nullish();
export const ProvideLinksToolSchema = z.object({
links: LinksSchema,
});
const KnownAnswerConfidence = z.enum([
'very_confident',
'somewhat_confident',
'not_confident',
'no_sources',
'other',
]);
const AnswerConfidence = z.union([KnownAnswerConfidence, z.string()]); // evolvable
const AIAnnotationsToolSchema = z.looseObject({
answerConfidence: AnswerConfidence,
});
export const ProvideAIAnnotationsToolSchema = z.object({
aiAnnotations: AIAnnotationsToolSchema,
});
export type HanzoUIMessage = UIMessage<never, { client: { location: string } }>;