distillery_ingest_doc
Ingest documents (ADRs, specs, decisions, feedback) into a searchable knowledge base, chunking large text and deduplicating identical content.
Instructions
Ingest an arbitrary document (ADR, spec, decision, customer feedback).
USE WHEN: importing a standalone document — a markdown ADR/spec/RFC, a design decision, or a customer-feedback transcript/doc — so it becomes queryable knowledge with provenance. Distinct from distillery_store (single entry, semantic dedup) and from PreCompact transcripts: this chunks large text into multiple linked entries and deduplicates idempotently by content hash, so re-ingesting identical content adds no second entry.
PARAMS:
text (str, required): The full document text. Large text is split into multiple linked entries (relation_type="chunk").
author (str, required): Who is ingesting / owns this document.
doctype (str, optional, default="doc"): Document kind. Valid: [adr, spec, decision, feedback, doc]. Applied as both a "doctype/" tag and metadata.doctype for faceted retrieval.
source (str, optional): Provenance label (file path, Drive URL, etc.). Stored in metadata.source.
external_id (str, optional): Explicit dedup key. Defaults to the SHA-256 hash of text, making re-ingest idempotent.
title (str, optional): Human-readable title (stored in metadata.title).
project (str, optional): Project scope.
tags (list[str], optional): Extra namespaced tags.
metadata (dict, optional): Arbitrary extra metadata.
RETURNS (success): { entry_ids: list[str], count: int, doctype: str, external_id: str, chunked: bool, persisted: bool, dedup_action: "stored" | "skipped" } On re-ingest of identical content, persisted=false, dedup_action="skipped", and entry_ids points at the existing entries. RETURNS (error): { error: true, code: "INVALID_PARAMS" | "INTERNAL", message: "..." }
RELATED: distillery_store (single entry with semantic dedup), distillery_search (to retrieve ingested documents)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tags | No | ||
| text | Yes | ||
| title | No | ||
| author | Yes | ||
| source | No | ||
| doctype | No | ||
| project | No | ||
| metadata | No | ||
| external_id | No |