AI Profile for

🔒 You must be logged in as an Administrator or Editor to listen to this audio.

In the CrestApps AI ecosystem for Orchard Core, an AI Profile is the central blueprint or "brain" configuration that defines exactly how a specific AI assistant should behave, what it knows, and what it is capable of doing.

Because AI requires many moving parts to work effectively—models, prompts, tools, and data—the AI Profile acts as the unifying wrapper that integrates all these functions into a single, reusable entity.

Here is a breakdown of what it is for, its relationships, and how you consume it based on the CrestApps architecture:

1. What is an AI Profile for?

An AI Profile's primary purpose is to configure a specific AI persona or agent. Instead of hardcoding AI settings every time you want to use AI, you create a Profile. It dictates:

  • Identity & Behavior: Through System Prompts, Initial Messages, and generation parameters (Temperature, Top P).
  • Type of Execution: Defining if it is a standard Chat, a background Utility, an Agent, or a Prompt Template.
  • Capabilities: Determining what the AI is allowed to do.

2. What are its relationships with other components?

The 4 big tabs you mentioned map perfectly to how the AI Profile acts as a central hub:

  • Deployments (The Engine): An AI Profile is bound to a specific Deployment (e.g., GPT-4o via Azure, Llama 3 via Ollama). The Profile doesn't care how the model is hosted; it just tells the system, "Use this deployment to generate text."
  • The Orchestrator (The Manager): The AI Profile selects an Orchestrator. When a user sends a message, the Orchestrator takes over. It looks at the Profile's tools and documents, decides if the AI needs to use a tool, runs the tool, and loops the results back to the model.
  • Data Sources & Documents (The Memory): You can bind Data Sources (like an Azure AI Search index or Elasticsearch) and specific Documents (PDFs, Word docs) to a Profile. When the Orchestrator runs, it uses these to perform Retrieval-Augmented Generation (RAG), giving the AI context it wasn't originally trained on.
  • Tools & Capabilities (The Hands): A Profile can be granted access to internal Orchard Core tools (e.g., "List Content Items"), external MCP (Model Context Protocol) tools, or even Agent-to-Agent (A2A) connections to delegate tasks to other AI Profiles.

3. How do you consume or use an AI Profile?

Once you have configured an AI Profile in the Admin dashboard, there are several ways to actually use it in Orchard Core:

A. Using AIProfilePart on Content Items (As seen in your code snippet):

public sealed class AIProfilePart : ContentPart
{
    public string ProfileId { get; set; }
    public int? TotalHistory { get; set; }
}

By attaching the AIProfilePart to any Orchard Core Content Type (e.g., a "Product" or "Landing Page"), you can link that specific piece of content to an AI Profile using the ProfileId. This allows you to easily drop an AI chat widget onto that page, automatically scoped to that Profile's rules and data.

B. Through Chat Interactions: In CrestApps, a Chat Interaction is the user-facing session. You create a Chat Interaction and map it to an AI Profile. The Interaction handles the UI, the chat history, and the user access permissions, while the AI Profile handles the actual AI logic in the background.

C. Programmatically via Services: As a developer, you can consume a profile in your own code using the CrestApps services. You can resolve the IAIProfileManager to fetch a profile by its name, and pass it to the IAICompletionService or IOrchestrator to generate text, summarize data, or extract JSON behind the scenes without any user interface.

D. Workflows and Rules: You can use AI Profiles within Orchard Core Workflows (e.g., "When a blog post is published, use the 'SEO Summarizer Profile' to generate a meta description").