Logo vun Kb Chat

Kb Chat

Communautéit
waylondev
kb-chat

Use when the user asks a question that should be answered from the knowledge base or wants to compare content across documents. Triggers on questions about ingested content — even when the user doesn't name the underlying system.

Iwwersiicht

Editeurwaylondev
Repositorykb-pilot
Skill-Nummkb-chat
Stären
34
Forks
3
Matgeliwwert Fichieren
1
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 1 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum waylondev op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Kb Chat an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/waylondev/kb-pilot/tree/main/.agents/skills/kb-chat
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/waylondev/kb-pilot.git /tmp/kb-pilot
mkdir -p .claude/skills
cp -r /tmp/kb-pilot/.agents/skills/kb-chat .claude/skills/kb-chat
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Kb Chat an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Kb Chat automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Kb Chat net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

kb-chat — Answer questions from the knowledge base

Path calculation: manifest entry path: docs/api/auth.md → tree.json at .kb/index/docs/api/auth/, source file at {kb_path}/docs/api/auth.md.

Path resolution: {kb_path} comes from this skill's metadata and is relative to the project root — resolve it to an absolute path ({abs_kb}) before running anything.

The drift check is this skill's own script (scripts/check_source.py), read-only, so kb-chat runs it without writing anything or depending on another skill.

Input / Output

yaml
Input:
- question: string           # user question
- domain_preference?: string # optional; user-specified domain as a routing hint

Output:
- answer: string             # grounded in source. Citations are inline, not a separate field: after each
                             # claim, append a clickable [path#L{start}-L{end}](path#L{start}-L{end}),
                             # e.g. "...returns a JWT token.[docs/api/auth.md#L42-L58](docs/api/auth.md#L42-L58)".
                             # End with a "Source:" footer listing the distinct citations.

Data it reads

A shape recap, so you can parse both files without a detour. If a file ever disagrees with this recap, trust the file — the recap is a convenience, not a schema authority.

Both files are minified JSON — parse them, do not read them as prose.

  • .kb/manifest.json — a JSON array of document entries (not an object):

    json
    [{"doc_id":"doc_001","title":"API Auth","domain":"api","summary":"...",
      "tags":["auth","jwt"],"updated_at":"2026-08-28T...","path":"docs/api/auth.md"}]

    tags hold top-level section keywords only, so a topic buried in a sub-section may be absent from them. Never read that as "this document is unrelated" — fall back to the section walk in Step 2.

  • .kb/index/{path without .md}/tree.json — the document record plus the heading skeleton:

    json
    {"doc_id":"doc_001","title":"API Auth","domain":"api","source_path":"docs/api/auth.md",
     "summary":"...","ingested_at":"...","source_sha256":"...","total_lines":120,
     "nodes":[{"id":"ch_1","level":2,"title":"Overview","summary":"...","keywords":[],
               "start_line":16,"end_line":40,"children":[]}]}

Available script

Script paths follow the standard skill convention: scripts/... is relative to this skill's directory root (run commands from there). Knowledge-base file paths are resolved against the project root — resolve {kb_path} to an absolute path ({abs_kb}) before running.

One deterministic check backs Step 3. It ships with this skill (scripts/check_source.py) and is read-only:

  • check_source.py {source_file} {tree_json} — compares the source's current SHA256 against the source_sha256 recorded in tree.json and reports drifted. Exit code 0 means "check completed" — a drift is a result in the JSON, not an error.

Workflow

Transparency: Each step surfaces a short, user-visible signal so the user can follow the flow — where it routed, what it read, and what it verified. One line each, wording is yours; they are progress markers, not report artifacts. The answer is the only long-form output.

Progress:

  • 1. Document routing — Read .kb/manifest.json. If domain_preference is provided, use it as a strong routing hint. Match domain/title/summary/tags semantically and produce a ranked candidate list (most relevant first), not a single pick. Then decide by count: none → answer "not mentioned in the documents" (never guess); one clearly relevant → proceed; several → start with the most relevant, and read further candidates if the question spans documents (comparison, relation, conflict) or the first pass comes up short. Several candidates on the same topic (e.g. two documents both describe annual fees) is a conflict signal, not a tie to break — localize the Top candidates in parallel and surface the difference explicitly (version change, differing rates, different applicability), rather than silently answering from the first-ranked one: reading both documents is what makes a version conflict answerable. Do not interrupt the user just because several candidates exist — escalate only when reading still leaves you unable to decide (candidates conflict, or the question needs a hint). No numeric scores or thresholds; relevance is an ordering, not a score. User sees: the chosen document(s), e.g. "→ routed to docs/api/auth.md" (or "→ not in the knowledge base")
  • 2. Section localization — Read the hit document's tree.json, locate the most precise section via semantic matching of node title/summary/keywords. Recurse into children until specific enough. User sees: the section path, e.g. "→ section: Authentication flow » JWT issuance"
  • 3. Content extraction — Before reading, check the source has not drifted: run python scripts/check_source.py {abs_kb}/docs/api/auth.md {abs_kb}/.kb/index/docs/api/auth/tree.json and read drifted from its JSON. If drifted is true, the source was edited after ingestion — warn the user that citations may be stale and offer to re-ingest before continuing. Compare the checksum, not the line count — a number edit keeps the line count identical while breaking every citation into that section. Use start_line/end_line as navigation anchors; read the source starting from there. The LLM decides how much to read — expand to parent, siblings, or the full document as judgment dictates. Note that content between the H1 title and the first section heading is the document intro: if the question may concern it (overview, scope, intro facts), read from the top of the file. Record the exact line ranges read — they become the per-claim citations in Step 4. User sees: the ranges read, e.g. "→ read docs/api/auth.md#L16-L40"
  • 4. Generate answer — Organize the answer autonomously based on extracted source text. After each claim, attach a citation link [path#L{start}-L{end}](path#L{start}-L{end}) backed by the exact range that supports it — path is the manifest path (relative to the kb root), so the link resolves against the current directory and clicks open. End with a Source: footer listing the distinct citations. User sees: the answer with inline citations and the Source footer
  • 5. Self-verify — Before delivering, re-read your own answer against the source: does every claim carry a citation, and do the cited ranges actually support it? Pay special attention to numeric claims (amounts, dates, ratios) — re-check each digit against the cited lines. Did you actually answer the question? For questions that may draw on multiple locations (enumerations, maxima, comparisons, conflicts), also ask whether you read everything a complete answer needs — and re-read only if your own judgment says you missed something. The LLM decides how many rounds — a simple fact may need one glance, complex cross-document reasoning may need several. If a gap is found, go back to Step 3 and re-read, then re-verify. Stop when you can stand behind every claim; if the source still doesn't support it after re-reading, say "not mentioned in the documents". User sees: a one-line verdict, e.g. "→ verified: every claim grounded in the cited lines"

Failure handling

  • .kb/manifest.json missing → report "knowledge base not initialized; run kb-ingest first"
  • No relevant document after routing → say only "not mentioned in the documents"
  • Several candidates but reading still can't disambiguate (they conflict, or the question needs a hint) → list the candidates and ask the user to choose
  • Manifest entry exists but its source file is missing (e.g. docs/api/auth.md not found at Step 3) — the manifest is stale: tell the user the document is no longer readable, and ask whether to re-ingest or remove the entry, rather than guessing content
  • Source citation missing or line range wrong → re-read the source and verify before answering

Gotchas

  • path field is critical — The manifest entry's path is the source file path relative to the repo root; the source is read from there. tree.json lives under the .kb/index/ mirrored directory. A mismatch makes the document unanswerable
  • tree.json and manifest.json are minified — Read them as JSON, not prose. If you need a readable copy, ask kb-ingest to regenerate with --pretty (that is its job, not this skill's)
  • Drift is a checksum question, not a line-count one — most edits (a number, a date, a reworded clause) keep the line count identical, so a line-count check reports "unchanged" while the cited lines say something else. check_source.py compares the SHA256 and catches it
  • Citation links are relative by design — The #L{start}-L{end} suffix is the standard GitHub line-range anchor; the path is the manifest path (relative to the kb root), so citations stay machine-independent, read the same as on GitHub, and click open from the current directory. Never embed absolute machine paths
  • Cross-document comparison — Run routing and localization independently per document

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Kb Chat?

Use when the user asks a question that should be answered from the knowledge base or wants to compare content across documents. Triggers on questions about ingested content — even when the user doesn't name the underlying system.

Firwat Kb Chat op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Kb Chat besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Kb Chat an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/waylondev/kb-pilot/tree/main/.agents/skills/kb-chat an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Kb Chat benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Kb Chat benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Kb Chat domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Kb Chat gratis?

Jo. De Skill gëtt vum waylondev ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇