Skip to main content

Package defining the PyAgentSpec library for Agents and LLM fixed-flows abstractions.

Project description

🔗 Open Agent Specification (PyAgentSpec)

AgentSpec downloads AgentSpec docs AgentSpec Reference Sheet License

Agent Spec is a portable, platform-agnostic configuration language that allows Agents and Agentic Systems to be described with sufficient fidelity. It defines the conceptual objects and called components that compose Agents in typical Agent systems, including the properties that determine the components' configuration, and their respective semantics. Agent Spec is based on two main runnable standalone components:

  • Agents (e.g., ReAct), that are conversational agents or agent components;
  • Flows (e.g., business process) that are structured, workflow-based processes.

Runtimes implement the Agent Spec components for execution with Agentic frameworks or libraries. Agent Spec would be supported by SDKs in various languages (e.g. Python) to be able to serialize/deserialize Agents to JSON/YAML, or create them from object representations with the assurance of conformance to the specification.

For more information, including the motivation and specification, see the dedicated section in the Agent Spec documentation.


⚡ Quick Install

pip install pyagentspec

(Optional, faster installation using uv)

pip install uv
uv pip install pyagentspec

🧠 Quick Start

1) Configure an LLM

Initialize a Large Language Model (LLM) of your choice using PyAgentSpec configs:

OCI Gen AI Open AI Ollama
from pyagentspec.llms import OciGenAiConfig
from pyagentspec.llms.ociclientconfig import OciClientConfigWithApiKey

OCIGENAI_ENDPOINT = "https://inference.generativeai..oci.oraclecloud.com"
COMPARTMENT_ID = "ocid1.compartment.oc1..<compartment_id>"
llm = OciGenAiConfig(
name="OCI model",
model_id="model_id",
compartment_id=COMPARTMENT_ID,
client_config=OciClientConfigWithApiKey(
name="client_config",
service_endpoint=OCIGENAI_ENDPOINT,
auth_file_location="~/.oci/config",
auth_profile="DEFAULT",
),
)
from pyagentspec.llms import OpenAiConfig

llm = OpenAiConfig(
name="OpenAI model",
model_id="model_id",
)
from pyagentspec.llms import OllamaConfig

llm = OllamaConfig(
name="Ollama model",
url="ollama_url",
model_id="model_id",
)

See the list of supported LLMs in the PyAgentSpec documentation: https://oracle.github.io/agent-spec/development/howtoguides/howto_llm_from_different_providers.html

2) Create an Agent

from pyagentspec.agent import Agent
from pyagentspec.property import Property

expertise_property = Property(json_schema={"title": "domain_of_expertise", "type": "string"})
system_prompt = """
You are an expert in {{domain_of_expertise}}.
Please help the users with their requests.
"""

agent = Agent(
    name="Adaptive expert agent",
    system_prompt=system_prompt,
    llm_config=llm_config,  # from step 1
    inputs=[expertise_property],
)

For more examples on building flexible Agents, structured Flows, and multi-agent patterns, read the Guides: https://oracle.github.io/agent-spec/development/howtoguides/index.html


🚀 Execute Agent Spec configurations

Agent Spec configurations can be executed using Agent Spec–compatible runtimes or adapters that translate the spec into the target framework representation.

Refer to the installation guide for adapter-specific extras: https://oracle.github.io/agent-spec/development/installation.html


💁 Get Support


🤝 Contributing

Contributions are welcome! Please refer to the contributor guide located at the root of the repository.


🔐 Security

For responsibly reporting security issues, please refer to the project's security guidelines.


📄 License

Copyright (c) 2025 Oracle and/or its affiliates.

This software is dual-licensed under the Apache License 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) and the Universal Permissive License (UPL) 1.0 (LICENSE-UPL or https://oss.oracle.com/licenses/upl).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyagentspec-26.1.0-py3-none-any.whl (404.9 kB view details)

Uploaded Python 3

File details

Details for the file pyagentspec-26.1.0-py3-none-any.whl.

File metadata

  • Download URL: pyagentspec-26.1.0-py3-none-any.whl
  • Upload date:
  • Size: 404.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pyagentspec-26.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ac425ca2628891d735159763bb7c4bcaa672b04b995191f9f85b22e168e1bd04
MD5 791c11e20c6f439a4aa214106deaba76
BLAKE2b-256 2c8667e9571359e291cd7c284054a4e3d7997232a2375626f475416b12b5bb6a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page