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.0b2-py3-none-any.whl (105.0 kB view details)

Uploaded Python 3

aip_agents_binary-0.0.0b2-cp313-cp313-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.13Windows x86-64

aip_agents_binary-0.0.0b2-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.0b2-cp313-cp313-macosx_13_0_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.13macOS 13.0+ x86-64

aip_agents_binary-0.0.0b2-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.0b2-cp312-cp312-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12Windows x86-64

aip_agents_binary-0.0.0b2-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.0b2-cp312-cp312-macosx_13_0_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.12macOS 13.0+ x86-64

aip_agents_binary-0.0.0b2-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.0b2-cp311-cp311-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.11Windows x86-64

aip_agents_binary-0.0.0b2-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.0b2-cp311-cp311-macosx_13_0_x86_64.whl (2.3 MB view details)

Uploaded CPython 3.11macOS 13.0+ x86-64

aip_agents_binary-0.0.0b2-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.0b2-py3-none-any.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-py3-none-any.whl
Algorithm Hash digest
SHA256 19c299a5e842127888fa07b77709e7399a68b30ab376f52243748879b0b6c1c3
MD5 2732f01477f9ba1023704f1337ec44a5
BLAKE2b-256 b971d88d4a13101c3e8c19b6c1c7729315ed94549a7ae59112c9c2eeb9946c36

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-py3-none-any.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.0b2-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 390148825ad45f667ce0776c610044a238c01701bf1e396d696d5b95873c0a9d
MD5 cd82a0caa47889aeee10ce503c994b0c
BLAKE2b-256 d6711b84f500191bb886630e9f692dfed73fc5124bad225110cf96ad642e36e2

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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.0b2-cp313-cp313-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp313-cp313-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 8477fb595f0f6f6d2e04df16824cf45f26efa630b1529bb63ce35e4915926c7f
MD5 c15af6ab321e2c9def2fc99dcc6d3b4d
BLAKE2b-256 ff6abb7b193a428837230f4f5819a3957e19954f6223351074f19a8d6c1e8afd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp313-cp313-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 660c73379a224ddcf3cf4efce31ecfa4e05f396b8453b4564b93d409cf597a8e
MD5 32b0668325cd7c8406363d2c8c9477c4
BLAKE2b-256 883e77ddcd303ccabe110faf565866f7df1261a8a2947dbfc49519ec20b40e14

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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.0b2-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp313-cp313-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 8b871c937ff41c6ce183e257addeadbe5191611d23f06f91fef82da2a3b9f761
MD5 1b6f84e7800541516f76ca6d149e4800
BLAKE2b-256 2a296e5cd0fe9a8da9b2ed9fddadc4d3ae58a93490c8452c3dd3c6eff44da446

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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.0b2-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 198a120dd124f65032180ce333e5a05be91b077e0fb78d4629f130ca6506c441
MD5 58a446f10b76db721df5ad8c0022b050
BLAKE2b-256 fa85e52b5ece33de0fa33aaa64cd4abe07327ace1d096ac3537dbb7a97f1da1a

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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.0b2-cp312-cp312-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp312-cp312-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 368cffd519cda9fe44558cb6c893334b6650158d8b6bae364d4c2b841fe22404
MD5 9e03080ac715b2b83df93b9130f5538e
BLAKE2b-256 de7c67b2135fdd3b100a5aa20ac40f383ea039e177af0dc831a9e3b37ac159f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp312-cp312-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 f41c6e70542c3b2ec0c8d8d1641fddcd9f11d7b6fff65d9ff2b15226ca407a28
MD5 421975e7fa5109bfbdbbe78fac216097
BLAKE2b-256 cb31a7c6841df90232f9c847823ed5b7d5137d96fe98fc10cde05282a39977ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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.0b2-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp312-cp312-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 f1f5bca962b19526480dcbd0101a5fcfeb38861e84c0c0487cc0f4fed3d66fdd
MD5 6581a1d999003323899559e572045d5b
BLAKE2b-256 e1768d8d70e92acee78d4776e9d76468a73ae9ea4778c2a9767bda1bb3099744

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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.0b2-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 60186703b6ae7c588a7464f4cf76df827b57bb8ac4416a4300fc9f2a2925ff8d
MD5 54b1255c2af09536cb33dbf7d73d4429
BLAKE2b-256 81c859ba17506a0f6a8966545ce633a8bdd4d6b94c38e8176a92cc362f88ad7c

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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.0b2-cp311-cp311-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp311-cp311-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 8901b0b735d2d5d6c647522973f37d4e2be99c1c19731d3d9e3e786adfc5c400
MD5 4397be0e2ce1bb211872363760849d97
BLAKE2b-256 6cb6a7360d5c8a982202a9b9552e9f5674f81c048c5e33ff60171bff696fbdbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp311-cp311-macosx_13_0_x86_64.whl
Algorithm Hash digest
SHA256 6e4467fe3a04c5260b03942ef39ade64eda60a7e3722e6a7c2f030bb816212bd
MD5 2139a633935ccce2a2159436e3c13dd6
BLAKE2b-256 438e072ab53c1f74038df3b39304859cb25eb475591f0df8083938ec173fb196

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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.0b2-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for aip_agents_binary-0.0.0b2-cp311-cp311-macosx_13_0_arm64.macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 84f8d94992884ed6c0388ad51e02f39646ff891fc0baf94e90ea0e56392b13e4
MD5 e73a5a3bf1b026868d8031595cf62510
BLAKE2b-256 f9fcd32d34cd085d59ac67ed304911809eefb12e4aa00079bbed99691eb6bfe8

See more details on using hashes here.

Provenance

The following attestation bundles were made for aip_agents_binary-0.0.0b2-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