AI Agent Contract Template with OpenAI
A minimal template for building an OpenAI-powered AI agent that compiles to a contract and deploys to Phala Network's decentralized, TEE-secured serverless cloud rather than a conventional FaaS provider.
This template scaffolds an AI agent that uses the OpenAI API and packages it for deployment as an Agent Contract on Phala Network. Compiled agent code is published to IPFS and run inside Phala's Trusted Execution Environment workers, which the project positions as more private for API keys and user data than a conventional cloud function host, since execution is hardware-guarded and the deployment itself does not depend on a centralized provider staying up.
The workflow installs dependencies with npm, builds the agent, runs a local test against expected output, and publishes the compiled code to IPFS through a storage-provider-backed step; each publish records the resulting IPFS identifier and access URL in a local log file for later reference when configuring secrets.
It is intended as a starting point for developers building on Phala's decentralized hosting rather than a complete application.