Installation Guide for Sagentic AF ​
Just like kicking off a new React or Vue project, getting started with Sagentic is refreshingly simple — no surprises. Here's how you can set up your development environment and begin building your own autonomous agents.
Prerequisites ​
Before you install Sagentic AF, make sure you have the following:
- Node.js version 20 or higher
npm
(which includesnpx
)
If you don't have Node.js and npm
installed on your machine, head over to the Node.js website to download and install them.
Optionally, in order to deploy your agents to the Sagentic platform, you'll need Sagentic API key. You can create one at any time in your sagentic.ai Dashboard.
Additionally, you'll need an OpenAI API key to interact with the OpenAI services. If you haven't already, you can obtain one from the OpenAI API portal.
Quick Start ​
To create a new Sagentic project, simply run the following command in your terminal:
npx @sagentic-ai/sagentic-af init myproject
This will scaffold a new Sagentic project in the myproject
directory. The project comes pre-configured with everything you need to get started.
If you're already in an empty directory where you'd like to initialize your project, you can run:
npx @sagentic-ai/sagentic-af init
Install Dependencies ​
Navigate to your project directory and install the necessary dependencies:
cd myproject
npm install
cd myproject
yarn
Setting Up Your API Key ​
After creating your project, you'll need to set up your OpenAI API key. Locate the .env.example
file in the root of your project directory and fill it out with your API keys like so:
OPENAI_API_KEY=sk-...your_openai_api_key_here...
SAGENTIC_API_KEY=...your_sagentic_api_key_here...
Then, rename the file to .env
:
mv .env.example .env
This OpenAI API key is essential for the local Sagentic development server to provide an OpenAI API client to your agents.
The Sagentic API key is used to authenticate to Sagentic's cloud services. You can get one in your sagentic.ai Dashboard.
Global Installation ​
For those who prefer not to use npx
every time, you can install the sagentic
CLI globally on your system using either npm or Yarn. Here's how:
npm install -g @sagentic-ai/sagentic-af
yarn global add @sagentic-ai/sagentic-af
Once installed globally, you can run sagentic
commands directly without prefixing them with npx
.
That's it! You're now ready to start building with Sagentic. Happy coding!