# AI Integration

> Combine language models with TX Text Control: local models, chat and analysis of documents, RAG, the MCP document server, agent workflows and samples.

- **Product:** TX Text Control .NET Server
- **Section:** Documentation
- **Kind:** Topic
- **Path:** TX Text Control .NET Server > AI Integration
- **677 words**
- **Web URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/
- **LLMs URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/llms-full.txt

---

A contract that answers questions, an invoice created from a sentence, a policy check that cites its sources: each of these combines a language model with documents. In TX Text Control .NET Server, the model interprets the request, and `ServerTextControl` reads, creates, edits and exports the documents. The TX Text Control AI preview adds local models, document tools and private knowledge, and older samples show the same ideas with OpenAI's hosted API.

### How AI Fits Into a Document Application

1. **Text for the model.** `ServerTextControl` extracts the text of a PDF, DOCX or other document, or exports it as Markdown, which keeps headings, lists and tables with fewer tokens.
2. **A model you choose.** The model runs on hardware you control with llama.cpp, or at a hosted provider such as OpenAI.
3. **Tools for documents.** The MCP document server offers the document operations of TX Text Control as tools that a model requests and your application runs.
4. **Knowledge from approved documents.** Retrieved passages ground answers and cite their sources.
5. **Results you verify.** Your application checks tool results and lets people review generated content before it counts.

### Find the Right Page

| If you want to | Read |
|---|---|
| Understand the roles of model and document engine, the building blocks and the data protection questions | [Overview](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/overview/llms-full.txt) |
| Get to know the packages and samples of the TX Text Control AI preview and add its endpoints to ASP.NET Core | [Text Control AI](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/text-control-ai/llms-full.txt) |
| Run models on your own hardware, provide the llama.cpp runtime and choose hardware and model size | [Local / Private LLMs](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/local-llms/llms-full.txt) |
| Ask a model questions about a PDF or DOCX document and handle long documents | [Chat with Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/chat/llms-full.txt) |
| Classify documents, extract structured data, review contracts or describe images for PDF/UA | [Document Analysis](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/analysis/llms-full.txt) |
| Index approved documents and ground answers in them with citations | [RAG](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/rag/llms-full.txt) |
| Host TX Text Control document tools for AI clients and secure them | [MCP Document Server](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/mcp-server/llms-full.txt) |
| Let a model call functions and document tools, and plan and verify document changes | [Agent Workflows](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/agent-workflows/llms-full.txt) |
| Connect GitHub Copilot, Cursor or Claude Code to the Text Control MCP Server and install Agent Skills | [AI Coding Assistants](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/coding-assistants/llms-full.txt) |
| Find runnable samples and their repositories | [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/examples/llms-full.txt) |

### Where to Start

1. [Overview](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/overview/llms-full.txt): the concepts and the building blocks.
2. [Chat with Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/chat/llms-full.txt): a first console program that answers questions about a PDF with a local model.
3. [Text Control AI](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/text-control-ai/llms-full.txt): the complete web sample with Chat, Document Studio and the MCP document server.

---

## In This Section

- [Agent Workflows](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/agent-workflows/llms-full.txt): Let a language model call functions and TX Text Control document tools: the tool loop, planning actions, verified edits, the Document Editor and timeouts.
- [Document Analysis](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/analysis/llms-full.txt): Analyze documents with TX Text Control and language models: prepare structured input, classify documents, extract JSON, summarize and explain contract changes.
- [Chat With Documents](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/chat/llms-full.txt): Ask a language model about PDF and DOCX documents: extract text with ServerTextControl, keep the chat history, stream answers and handle long documents.
- [AI Coding Assistants](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/coding-assistants/llms-full.txt): Connect GitHub Copilot, Cursor, Claude Code and other assistants to the Text Control MCP Server, and install Agent Skills for TX Text Control tasks.
- [Examples](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/examples/llms-full.txt): Find runnable AI samples on GitHub: local LLM chat, streaming, structured output, tool calling, the web assistant, MCP document servers and OpenAI samples.
- [Local / Private LLMs](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/local-llms/llms-full.txt): Run language models on hardware you control with the TX Text Control AI preview: llama.cpp runtime, GGUF models, LocalModelOptions, hardware and AI services.
- [MCP Document Server](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/mcp-server/llms-full.txt): Host TX Text Control document tools for AI clients with TXTextControl.AI.McpServer: MCP basics, hosting, configuration, the tools, clients and security.
- [Overview](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/overview/llms-full.txt): Divide AI document work between a language model and ServerTextControl: the three layers, building blocks, example workflows, local or hosted models and review.
- [RAG](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/rag/llms-full.txt): Ground AI answers in approved documents: index DOCX, PDF and Markdown with TXTextControl.AI.Knowledge, search passages, cite sources and protect the store.
- [Text Control AI](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/text-control-ai/llms-full.txt): Set up the TX Text Control AI preview: its six NuGet packages and architecture, requirements, the sample applications and AddTextControlAI in ASP.NET Core.

---

## Nearby

- **Previous:** [Self-Signed Certificates](https://docs.textcontrol.com/tx-text-control-dotnet-server/digital-signatures/self-signed/llms-full.txt)
- **Next:** [Overview](https://docs.textcontrol.com/tx-text-control-dotnet-server/ai/overview/llms-full.txt)
