> ## Documentation Index
> Fetch the complete documentation index at: https://docs.welesai.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Start here: building Weles with AI

> Instructions for AI assistants generating importable Weles workflows and Tool Manager packages.

This section is written for an AI assistant helping a user build solutions in Weles. Your job is to produce **importable configuration**, not to claim that an untested workflow or integration is operational. A Weles workflow orchestrates stages; an installed tool package exposes an external service to an AI Agent stage. They are separate JSON files with separate import procedures.

## Choose the guide

| User goal | What to produce | Guide |
| - | - | - |
| Classify and extract documents | Workflow JSON containing document types, classification, OCR, verification, and export | [Generate workflow imports](https://docs.welesai.com/workflows/ai-generated-imports.md) |
| Add an external capability to Tool Manager | A tool package JSON describing a specific HTTP API or MCP tool | [Create tool packages](https://docs.welesai.com/ai-agents/tool-packages.md) |
| Create a company knowledge assistant | Install a tool package, then import an agent-only workflow referencing its slug | [Tool package and agent workflow example](https://docs.welesai.com/ai-agents/tool-packages.md#complete-example-tool-package-and-agent-workflow) |
| Configure a capability already built into Weles | Add the built-in tool to an agent stage rather than creating a package | [Built-in tool catalogue](https://docs.welesai.com/workflows/agent-tools.md) |

## Agent procedure

1. **Understand the task.** Identify users, inputs, desired output, document classes and fields, whether review is needed, and whether the agent may read data or perform writes. Request missing business decisions instead of inventing them.
2. **Inspect the target.** Determine the Weles version, available OCR and agent models, installed tools, existing document type IDs and versions, approved service endpoints, permissions, and where output should go. Ask for non-secret information; never request passwords or API keys in the chat or embed them in generated files.
3. **Choose the artifacts.** A document pipeline generally uses `start`, optional `classification`, `ocr`, optional `agent`, `verification`, and `export`. A chat/API assistant uses `agent_input` followed by one or more `agent` stages. Install packages separately and use `installed__<slug>` in a stage to reference them. Do not mix the Tool Manager package envelope with the workflow envelope.
4. **Generate and validate.** Produce strict JSON files using the linked references. Check stage order and data flow, schema fields, tool slug, provider/model capability, and target-specific IDs. Preserve the difference between placeholders and real configuration.
5. **Provide a deployment handoff.** List each filename and import destination, prerequisites, approved secrets by name only, user assignment, post-import mapping, and tests. Do not import, enable actions, or send real company data without authorization.
6. **Test and report.** A successful import only proves acceptance, not correct behavior. Test in an authorized environment with non-sensitive data; inspect tool calls, classification, extraction, human review and output as applicable. Report failures and unverified assumptions explicitly.

> [!WARNING]
>
> Current workflow import does not remap classifier class document-type IDs. Newly imported types require mapping in the classifier after import unless the class references already point to verified IDs in the target. See the [workflow import guide](https://docs.welesai.com/workflows/ai-generated-imports.md#document-type-records-and-id-resolution).

## Suggested request for an AI assistant

> Create an importable Weles solution for my business process. First identify what you need to know about document categories, extraction fields, models, verification, integrations, permissions, and deployment. Then generate separate valid JSON files for the workflow and any Tool Manager packages. List target-specific values, secret names, import steps, unresolved mappings, and a non-sensitive test plan. Do not invent credentials or claim the configuration was tested unless it was.

## Boundaries

A workflow file is not a service installer and does not provision models, users, vector data, or tool packages. Tool calls can transmit private data or perform external actions; use approved endpoints, least privilege and human approval as appropriate. Model output and tool invocation are not guaranteed: validate behavior in the target installation. Consult [licensing](https://docs.welesai.com/administration/licensing.md) for feature and API entitlement details.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.