Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Concept of self-hosted agent #10624

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ankitbko
Copy link
Member

@ankitbko ankitbko commented Feb 20, 2025

Motivation and Context

In the agentic world, different agents are created and maintained by different teams in an organization. Each team has their own way of creating agents and hosting them which are independent of each other. To utilize these agents when creating a multi-agent application, semantic kernel will need to integrate with agents which lies outside the semantic kernel application. For semantic kernel, these agents are black box services that have their own implementation of "intelligence" but could still use the plugins registered in kernel as needed. AgentGroupChat should be able to orchestrate between these agents as usual.

Description

Although there could be multiple ways to implement such concept, this PR takes the approach of deriving from ChatCompletionClientBase and taking inspiration from OpenAIChatCompletionBase to implement SelfHostedChatCompletion which makes a REST request to externally hosted agents. Instances of SelfHostedChatCompletion are registered as service in kernel

kernel.add_service(
    SelfHostedChatCompletion(
        url=os.getenv("REVIEWER_AGENT_URL") or "", ai_model_id=REVIEWER_NAME, service_id=REVIEWER_NAME
    )
)

ChatCompletionAgent is used to create agents and the appropriate service is referenced using service_id.

agent_reviewer = ChatCompletionAgent(
    service_id="artdirector",
    kernel=kernel,
    name=REVIEWER_NAME,
    arguments=KernelArguments(settings=PromptExecutionSettings(service_id=REVIEWER_NAME)),
)

The agents themselves are implemented in a fastapi server under agents folder. AgentGroupChat is used to orchestrate between the agents.

Contribution Checklist

@ankitbko ankitbko requested a review from a team as a code owner February 20, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants