A custom GenAI agent framework
Project description
Phoenix Agents
A framework for building AI agents with modular connectors and LLM integration.
Installation
pip install phoenix-agents
Features
- Modular connector system for agent interactions
- Built-in support for Azure AI and OpenAI
- Chat history management
- Extensible agent architecture
- Session management for multi-user scenarios
Quick Start
Here's a simple example using Phoenix to create a simple AI agent:
from dotenv import load_dotenv
import asyncio
import os
from phoenix.agent import Agent
from phoenix.user_session import UserSession
from phoenix.models.azure_ai_inference import AzureAIInferece
import phoenix.models.openai_history as openai_history
load_dotenv()
async def main():
# Initialize chat history
chat_history = openai_history.ChatHistory()
# Setup LLM with Azure AI
llm = AzureAIInferece(
token=os.getenv("GITHUB_TOKEN"),
history=chat_history
)
# Create agent
agent = Agent(
brain=llm,
history=chat_history,
)
# Create user session and interact
session = UserSession()
response = await agent.call("Hello, how are you?", session)
print(response)
if __name__ == "__main__":
asyncio.run(main())
Here's a simple example using Phoenix to create a moody AI agent with MCP connectors (The full example can be found in Moody AI Repository):
from dotenv import load_dotenv
import asyncio
import os
from phoenix.agent import Agent
from phoenix.user_session import UserSession
from phoenix.models.azure_ai_inference import AzureAIInferece
import phoenix.models.openai_history as openai_history
from phoenix.connectors.mcp import MCPClient, MCPServer
load_dotenv()
async def main():
# Initialize chat history
chat_history = openai_history.ChatHistory()
# Setup LLM with Azure AI
llm = AzureAIInferece(
token=os.getenv("GITHUB_TOKEN"),
history=chat_history
)
# Setup MCP connector with servers
mcp = MCPClient([
MCPServer(path="path/to/mood.py")
])
try:
await mcp.connect()
# Create agent
agent = Agent(
brain=llm,
history=chat_history,
connector=mcp,
system="You are a moody AI, you need to know your current mood to know how to respond.",
)
# Create user session and interact
session = UserSession()
response = await agent.call("Hello, how are you?", session)
print(response)
finally:
await mcp.cleanup()
if __name__ == "__main__":
asyncio.run(main())
Configuration
The framework uses environment variables for configuration. Create a .env file with:
GITHUB_TOKEN=your_token_here
Contributing
Contributions are welcome!
License
MIT
Documentation
TODO
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 Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file phoenix_agents-0.1.8.tar.gz.
File metadata
- Download URL: phoenix_agents-0.1.8.tar.gz
- Upload date:
- Size: 17.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d4913168c537007a6675217c60f28ff38badd9f394e04346a39ae3fea603ca2f
|
|
| MD5 |
4226bf301fd121058482d4bd70c06155
|
|
| BLAKE2b-256 |
0f155b1d28ff8a80e75d948f3d51e1743941b8c5e7c349de627a1a4d2bb9007f
|
Provenance
The following attestation bundles were made for phoenix_agents-0.1.8.tar.gz:
Publisher:
publish.yml on Nie-Mand/phoenix-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phoenix_agents-0.1.8.tar.gz -
Subject digest:
d4913168c537007a6675217c60f28ff38badd9f394e04346a39ae3fea603ca2f - Sigstore transparency entry: 171358768
- Sigstore integration time:
-
Permalink:
Nie-Mand/phoenix-agents@79bb52fc69ac6eff40cbcb6f4b5875af20c067a6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Nie-Mand
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@79bb52fc69ac6eff40cbcb6f4b5875af20c067a6 -
Trigger Event:
push
-
Statement type:
File details
Details for the file phoenix_agents-0.1.8-py3-none-any.whl.
File metadata
- Download URL: phoenix_agents-0.1.8-py3-none-any.whl
- Upload date:
- Size: 8.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f949f28cb8d6d53b2b7a27c967493fb016a658bcd8db2e1cc36079ba7c52f3be
|
|
| MD5 |
f0b17972c1f2bca0b07dd79e865c7919
|
|
| BLAKE2b-256 |
10219c489d75d64300564c7d7299a9984880f04fea78232a0d8584f4fe1793d9
|
Provenance
The following attestation bundles were made for phoenix_agents-0.1.8-py3-none-any.whl:
Publisher:
publish.yml on Nie-Mand/phoenix-agents
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
phoenix_agents-0.1.8-py3-none-any.whl -
Subject digest:
f949f28cb8d6d53b2b7a27c967493fb016a658bcd8db2e1cc36079ba7c52f3be - Sigstore transparency entry: 171358770
- Sigstore integration time:
-
Permalink:
Nie-Mand/phoenix-agents@79bb52fc69ac6eff40cbcb6f4b5875af20c067a6 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Nie-Mand
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@79bb52fc69ac6eff40cbcb6f4b5875af20c067a6 -
Trigger Event:
push
-
Statement type: