# Services

Umbraco.AI provides core services for AI operations. All services are registered with dependency injection and can be injected into controllers, composers, or other services.

## Available Services

| Service                                                                            | Purpose                                        |
| ---------------------------------------------------------------------------------- | ---------------------------------------------- |
| [IAIChatService](/ai-in-umbraco/reference/services/ai-chat-service.md)             | Chat completions (streaming and non-streaming) |
| [IAIEmbeddingService](/ai-in-umbraco/reference/services/ai-embedding-service.md)   | Text embedding generation                      |
| [IAIProfileService](/ai-in-umbraco/reference/services/ai-profile-service.md)       | Profile CRUD operations                        |
| [IAIConnectionService](/ai-in-umbraco/reference/services/ai-connection-service.md) | Connection management                          |

## Usage Pattern

All services follow standard dependency injection patterns:

{% code title="Using Services" %}

```csharp
using Umbraco.AI.Core.Chat;
using Umbraco.AI.Core.Profiles;

public class MyController : Controller
{
    private readonly IAIChatService _chatService;
    private readonly IAIProfileService _profileService;

    public MyController(IAIChatService chatService, IAIProfileService profileService)
    {
        _chatService = chatService;
        _profileService = profileService;
    }

    public async Task<IActionResult> Chat()
    {
        var messages = new[] { new ChatMessage(ChatRole.User, "Hello") };
        var response = await _chatService.GetChatResponseAsync(
            chat => chat.WithAlias("content-chat"),
            messages);
        return Ok(response.Message.Text);
    }
}
```

{% endcode %}

## In This Section

{% content-ref url="/pages/tLjE0hvUTTtMnx5BpXle" %}
[IAIChatService](/ai-in-umbraco/reference/services/ai-chat-service.md)
{% endcontent-ref %}

{% content-ref url="/pages/hgS8Or0FfJ1BP7qgWuZa" %}
[IAIEmbeddingService](/ai-in-umbraco/reference/services/ai-embedding-service.md)
{% endcontent-ref %}

{% content-ref url="/pages/tRKtnfV0dWsxC45zJ6wR" %}
[IAIProfileService](/ai-in-umbraco/reference/services/ai-profile-service.md)
{% endcontent-ref %}

{% content-ref url="/pages/ikfms6yXYXbInkBe9Cxj" %}
[IAIConnectionService](/ai-in-umbraco/reference/services/ai-connection-service.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.umbraco.com/ai-in-umbraco/reference/services.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
