Skip to main content

Quickstart

Set up your SVAHNAR environment and deploy your first agent in minutes.

This guide covers getting your credentials, installing the SDK, and running a simple Web Search agent.

💡 Core Concepts​

Before diving in, it helps to understand the two main components you will use:

  1. API Key: Your unique identity that authorizes your machine to talk to SVAHNAR's cloud.
  2. Agent YAML: The blueprint file where you define what the agent does (its brain, tools, and instructions).

🚀 Setup & Installation​

Follow these steps to get your environment ready.

Get an API Key​

  1. Log in to the SVAHNAR Platform.
  2. Navigate to API Keys in your account settings.
  3. Click Create New Key and copy it immediately.
Image
Generating a SVAHNAR API Key

Export the API Key​

Make the key accessible to the SDK by exporting it as an environment variable.

Terminal
export SVAHNAR_API_KEY="your_api_key_here"

Install the SDK​

Install the Python package using pip.

Terminal
pip install svahnar

Create Your First Agent​

We will create a simple Web Search Agent. This requires two files: a configuration file (agent.yaml) and a python script (test.py) to run it.

1. Define the Agent (agent.yaml) Create a file named agent.yaml and paste the following configuration:

agent.yaml
create_agent_network:
agent-1:
agent_name: "Web_search"
LLM_config:
params:
model: "gpt-5"
max_tokens: 1000
request_timeout: 600
tools:
tool_assigned:
- name: "Tavily"
config:
max_results: 5
agent_function:
- "Your function is to search the web or internet for information"
incoming_edge:
- "Start"
outgoing_edge: []

2. Run the Agent (test.py) Create a file named test.py to initialize the SDK and deploy the agent.

test.py
from svahnar import Svahnar
from pathlib import Path

# Initialize the client (automatically picks up env variable)
client = Svahnar()

# Create and deploy the agent
response = client.agents.create(
name="Web Search Agent",
description="This Agent searches the web for information.",
deploy_to="Organization",
yaml_content=Path("agent.yaml")
)

print(response)

3. Execute Run the script in your terminal to create your first Agent:

python test.py

🚑 Troubleshooting​

  • ModuleNotFoundError: No module named 'svahnar'

    • Ensure you ran pip install svahnar.
    • If you are using a virtual environment, make sure it is activated.
  • Authentication Error / 401

    • Check that you exported the SVAHNAR_API_KEY correctly.
    • Try printing os.environ.get('SVAHNAR_API_KEY') in Python to verify the script can see it.
  • FileNotFoundError: agent.yaml

    • Ensure agent.yaml is in the same directory as your test.py script, or provide the full absolute path in Path().