Skip to content

Core Python quickstart

This quickstart installs the Core Python distribution and completes one request without provider credentials, a network connection, or a local model.

Install from a source checkout

From the repository root:

python -m pip install -e "core/python"

Install development and test dependencies with:

python -m pip install -e "core/python[dev]"

Send a deterministic request

The package includes an OpenAI-shaped echo provider used for offline examples and verification.

from agent_core import AgentCore
from plugins.echo_openai_like_provider import EchoOpenAILikeProvider

core = AgentCore()
core.register_provider(EchoOpenAILikeProvider)

session = core.create_session("quickstart")
session = core.add_message(
    session,
    "user",
    "Hello from the echo provider!",
)

session, replies = core.send_request(
    session,
    {
        "provider": "echo_openai_like",
        "model": "echo-test-1",
    },
)

print(replies[-1]["content"])

The result is:

SYS= | USER=Hello from the echo provider!

send_request returns a new Session and the final core-message dictionaries produced for the request. The input session is not mutated; the returned session contains both the user message and the assistant reply.

Continue