Skip to main content

A library for managing agents in Gen AI applications.

Project description

AIP Agents

Description

A library for managing agents in Generative AI applications.

Installation

Prerequisites

1. Installation from Artifact Registry

Choose one of the following methods to install the package:

Using pip

pip install aip-agents-binary

Using Poetry

poetry add aip-agents-binary

2. Development Installation (Git)

For development purposes, you can install directly from the Git repository:

poetry add "git+ssh://git@github.com/GDP-ADMIN/gen-ai-internal.git#subdirectory=libs/aip-agents"

Managing Dependencies

  1. Go to root folder of aip-agents module, e.g. cd libs/aip-agents.
  2. Run poetry shell to create a virtual environment.
  3. Run poetry lock to create a lock file if you haven't done it yet.
  4. Run poetry install to install the aip-agents requirements for the first time.
  5. Run poetry update if you update any dependency module version at pyproject.toml.

Contributing

Please refer to this Python Style Guide to get information about code style, documentation standard, and SCA that you need to use when contributing to this project

  1. Activate pre-commit hooks using pre-commit install
  2. Run poetry shell to create a virtual environment.
  3. Run poetry lock to create a lock file if you haven't done it yet.
  4. Run poetry install to install the aip-agents requirements for the first time.
  5. Run which python to get the path to be referenced at Visual Studio Code interpreter path (Ctrl+Shift+P or Cmd+Shift+P)
  6. Try running the unit test to see if it's working:
poetry run pytest -s tests/unit_tests/

Hello World Examples

Prerequisites

  • Python 3.13+
  • Install the binary package:
pip install aip-agents-binary
  • For OpenAI: Set your API key in the environment:
export OPENAI_API_KEY=your-openai-key
  • For Google ADK: Set your API key in the environment:
export GOOGLE_API_KEY=your-google-api-key

Run the Hello World Examples

The example scripts are located in the aip_agents/examples directory within the library. You can run them individually or use the run_all_examples.py script.

1. Running Individual Examples:

Navigate to the library's root directory (e.g., libs/aip-agents if you cloned the repository).

LangGraph (OpenAI):

python aip_agents/examples/hello_world_langgraph.py

LangGraph with BOSA Connector (OpenAI):

python aip_agents/examples/hello_world_langgraph_bosa_twitter.py

LangGraph Streaming (OpenAI):

python aip_agents/examples/hello_world_langgraph_stream.py

LangGraph Multi-Agent Coordinator (OpenAI):

python aip_agents/examples/hello_world_multi_agent_coordinator.py

Google ADK:

python aip_agents/examples/hello_world_google_adk.py

Google ADK Streaming:

python aip_agents/examples/hello_world_google_adk_stream.py

LangChain (OpenAI):

python aip_agents/examples/hello_world_langchain.py

LangChain Streaming (OpenAI):

python aip_agents/examples/hello_world_langchain_stream.py

2. Running Individual MCP Examples:

  • Navigate to the library's root directory (e.g., libs/aip-agents if you cloned the repository).

  • Open a new terminal and navigate to the sample MCP servers directory libs/aip-agents/aip_agents/examples/mcp_servers

    Turn on the SSE MCP servers:

    python mcp_server_sse.py
    
  • Open a new terminal and navigate to the sample MCP servers directory libs/aip-agents/aip_agents/examples/mcp_servers

    Turn on the STDIO MCP servers:

    python mcp_server_stdio.py
    

LangGraph SSE Transport (OpenAI):

python aip_agents/examples/hello_world_langgraph_mcp_sse.py

LangGraph Streaming SSE Transport (OpenAI):

python aip_agents/examples/hello_world_langgraph_mcp_sse_stream.py

LangGraph STDIO Transport (OpenAI):

python aip_agents/examples/hello_world_langgraph_mcp_stdio.py

LangGraph Streaming STDIO Transport (OpenAI):

python aip_agents/examples/hello_world_langgraph_mcp_stdio_stream.py

Google ADK SSE Transport:

python aip_agents/examples/hello_world_google_adk_mcp_sse.py

Google ADK Streaming SSE Transport:

python aip_agents/examples/hello_world_google_adk_mcp_sse_stream.py

Google ADK STDIO Transport:

python aip_agents/examples/hello_world_google_adk_mcp_stdio.py

Google ADK Streaming STDIO Transport:

python aip_agents/examples/hello_world_google_adk_mcp_stdio_stream.py

LangChain SSE Transport (OpenAI):

python aip_agents/examples/hello_world_langchain_mcp_sse.py

LangChain Streaming SSE Transport (OpenAI):

python aip_agents/examples/hello_world_langchain_mcp_sse_stream.py

LangChain STDIO Transport (OpenAI):

python aip_agents/examples/hello_world_langchain_mcp_stdio.py

LangChain Streaming STDIO Transport (OpenAI):

python aip_agents/examples/hello_world_langchain_mcp_stdio_stream.py

3. Running Individual A2A Examples:

  • Navigate to the library's root directory (e.g., libs/aip-agents if you cloned the repository).
  • Open a new terminal and navigate to the aip_agents/examples directory to run the A2A server.

LangChain Server:

python hello_world_a2a_langchain_server.py
  • Open a new terminal and navigate to the aip_agents/examples directory to run the A2A client.

LangChain Client:

python hello_world_a2a_langchain_client.py

LangChain Client Integrated with Agent Workflow:

python hello_world_a2a_langchain_client_agent.py

LangChain Client Streaming:

python hello_world_a2a_langchain_client_stream.py

Architectural Notes

Agent Interface (AgentInterface)

The aip_agents.agent.interface.AgentInterface class defines a standardized contract for all agent implementations within the AIP Agents ecosystem. It ensures that different agent types (e.g., LangGraph-based, Google ADK-based) expose a consistent set of methods for core operations.

Key methods defined by AgentInterface typically include:

  • arun(): For asynchronous execution of the agent that returns a final consolidated response.
  • arun_stream(): For asynchronous execution that streams back partial responses or events from the agent.

By adhering to this interface, users can interact with various agents in a uniform way, making it easier to switch between or combine different agent technologies.

Inversion of Control (IoC) / Dependency Injection (DI)

The agent implementations (e.g., LangGraphAgent, GoogleADKAgent) utilize Dependency Injection. For instance, LangGraphAgent accepts an agent_executor (like one created by LangGraph's create_react_agent) in its constructor. Similarly, GoogleADKAgent accepts a native adk_native_agent. This allows the core execution logic to be provided externally, promoting flexibility and decoupling the agent wrapper from the specific instantiation details of its underlying engine.

Project details


Release history Release notifications | RSS feed

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 Distributions

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

aip_agents_binary-0.0.0b1-cp313-cp313-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.13Windows x86-64

aip_agents_binary-0.0.0b1-cp313-cp313-manylinux_2_31_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.31+ x86-64

aip_agents_binary-0.0.0b1-cp313-cp313-macosx_13_0_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

aip_agents_binary-0.0.0b1-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl (2.0 MB view details)

Uploaded CPython 3.13macOS 13.0+ ARM64macOS 15.0+ ARM64

aip_agents_binary-0.0.0b1-cp312-cp312-win_amd64.whl (1.9 MB view details)

Uploaded CPython 3.12Windows x86-64

aip_agents_binary-0.0.0b1-cp312-cp312-manylinux_2_31_x86_64.whl (2.6 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.31+ x86-64

aip_agents_binary-0.0.0b1-cp312-cp312-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

aip_agents_binary-0.0.0b1-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.12macOS 13.0+ ARM64macOS 15.0+ ARM64

aip_agents_binary-0.0.0b1-cp311-cp311-win_amd64.whl (2.0 MB view details)

Uploaded CPython 3.11Windows x86-64

aip_agents_binary-0.0.0b1-cp311-cp311-manylinux_2_31_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.31+ x86-64

aip_agents_binary-0.0.0b1-cp311-cp311-macosx_13_0_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

aip_agents_binary-0.0.0b1-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl (1.9 MB view details)

Uploaded CPython 3.11macOS 13.0+ ARM64macOS 15.0+ ARM64

File details

Details for the file aip_agents_binary-0.0.0b1-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3a95597bbbe7c748541066394cf78daeb4a8dedf76f3d0ec0502c096e7064b2b
MD5 856120af4fc623505872ea6df49e3392
BLAKE2b-256 4a53d457e3d61752b5f3427f20a7f18728b21f33fe0a09ab67b98a108bc55be9

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp313-cp313-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aip_agents_binary-0.0.0b1-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 94d549f7d7c1137d4b00dfd455a02d667040f9a8e48c00c7db8d46cb4564ad4c
MD5 d7090a3adbfd08b38e9300daab18b3b6
BLAKE2b-256 faefaf10bdc394653ff0a1d93902260fec333806041779a54813685bb4f03b42

See more details on using hashes here.

File details

Details for the file aip_agents_binary-0.0.0b1-cp313-cp313-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 19842105cc861b261cf1f108d8fc21c57049a764637c475605a40c219c7751d2
MD5 abde605c22997870a3681c9e83941875
BLAKE2b-256 7fea8bffe69812f42902cf012c13eec632686d13775ce500ec3cdbca7120decd

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp313-cp313-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aip_agents_binary-0.0.0b1-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8eedb349a0fb5c7583d1e5c367a8cafbca16c040e94e20ad5d9b2252e2006e28
MD5 9c739b43c98011adabd3960a7ffd2abb
BLAKE2b-256 42d7b15cb6454656b56e659905dd63db2894bd68b99143171afc902643e04375

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aip_agents_binary-0.0.0b1-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f958029546695a66823fb87e3dffd366039a5712043ea5489f6202ba2d4bd20c
MD5 fd225777c688ba7ad9a62ad2c8167f2d
BLAKE2b-256 41a69cb24b361eeb9cefd10561bacf2043d8485c0a567f603aad61202c804737

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp312-cp312-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aip_agents_binary-0.0.0b1-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 dd9117839cc7a3d1b0cdf47316fb49f75ee29add6e860ab9daa4273d737a256f
MD5 480720f7304478e57ef623cc43a586d7
BLAKE2b-256 b45d61679fca655cd90efa82630e6c484c004bb88a3f4a642bdc9a002bb46a7b

See more details on using hashes here.

File details

Details for the file aip_agents_binary-0.0.0b1-cp312-cp312-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 0228afa67fb976d74888772943b739f5681d586d0628cc15ef0c1911f0c4ffad
MD5 0dbb8560bb45f194acf235c4ed54e7c6
BLAKE2b-256 0ca681489c0d4bee3bc6795a0419c39300964411abe70f91afbd10ae273af8de

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp312-cp312-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aip_agents_binary-0.0.0b1-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 664f5faad4396696b613d4ab8a19922ac3c8a21b04fbae7d9630ed51c318d20e
MD5 21a58a6bd121dd0145aa9757eaa28866
BLAKE2b-256 017163488c1366892383e9db4eb614ad7e2e38d991474c19353c893e785ccba7

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aip_agents_binary-0.0.0b1-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 52592bc153d260979380466fc1d88be2b2dfc50c9690ff95c39a3c848151840e
MD5 c3ae6ded6ff97b802e04c52db31f6176
BLAKE2b-256 c7f7015a267e90c933a1d4edbe8a35cd9b0cde959c7f5ccc7bfa1bd32d207bb6

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp311-cp311-win_amd64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aip_agents_binary-0.0.0b1-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 15b784449d21663a392ddd5286c59b95af4e9ca925ea6313a6470803d00d6163
MD5 7d5b1b2e5db242bdaa53209261f3b58a
BLAKE2b-256 9a63f4906a60c3a5ef453ea44d00636e89865b94b4caf67e76dd6ec07a4037b9

See more details on using hashes here.

File details

Details for the file aip_agents_binary-0.0.0b1-cp311-cp311-macosx_13_0_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 74fa61e89150babe6a8cb2d3d66ec3bea3c5f0c33df9c61d1238085f66f98488
MD5 223fdfe37f0d25226f787e4bd0304858
BLAKE2b-256 e3ef7221db8f6426e72b187ff50b5517ad7bab4117cd60c8166569d65251688c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp311-cp311-macosx_13_0_x86_64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file aip_agents_binary-0.0.0b1-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b1-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 6b21b38a51f414f49010a0ee45e9912a3f5da0e7cbf057e11d66de48466d1fb4
MD5 4d32644f2a62ed20d78ca6fc7ff4f4ab
BLAKE2b-256 f080bc6305103d232768c6588aa21e63f810f6abe12f248b53d50da5bbcd04f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b1-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl:

Publisher: build-binary.yml on GDP-ADMIN/glaip-sdk

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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