Skip to main content

Set up an account

Create an account here.

Create a project

Start by creating AgentView project:
npm create agentview@latest my-agentview-project
This will install example project in my-agentview-project/ dir. Go to the project:
cd my-agentview-project
It’s a simple Vite app with AgentView Studio and demo Chat Endpoint in agent.ts.

Set up environment variables

Before you start, you need to set up environment variables. Go to your org Dashboard to the API Keys tab and generate a development API key. Here’s what your .env file should look like:
  1. VITE_AGENTVIEW_ORGANIZATION_ID - your organization id, you can find it in Organization Details tab.
  2. AGENTVIEW_API_KEY - paste your development API key.
  3. OPENAI_API_KEY - your OpenAI API key (it’s needed since demo is using Responses API)

Run Chat Endpoint

Let’s run the chat endpoint:
npm run dev:agent
It should be running at localhost:3000. It’s a simple Hono HTTP server computing AI responses using OpenAI Responses API and AgentView SDK.

Test

Let’s test the chat endpoint:
curl -X POST --json '{ "input": { "type": "message", "role": "user", "content": "Hey, my name is Bob." } }' http://localhost:3000/simple_chat
You should get a response in a following JSON format:
{
  "id": "SESSION_ID",
  "output": [ /* output items */],
  "token": "USER_TOKEN"
}
Let’s continue the thread by sending new message (insert SESSION_ID and USER_TOKEN from the previous response):
curl -X POST --json '{
    "id": "SESSION_ID",
    "input": {"type": "message", "role": "user", "content": "Hello, what was my name again?"},
    "token": "USER_TOKEN"
  }' http://localhost:3000/simple_chat
You should get a response which shows that the agent remembers your name. AgentView correctly stores the conversation history and remembers the context of the conversation. Let’s send an incorrect input:
curl -i -X POST --json '{ "input": { "type": "message", "role": "user", "content": 100 } }' http://localhost:3000/simple_chat
This triggers 422 error, as the input is not a string. AgentView handles the validation and provides a correct HTTP status code.

Run Studio

Let’s run the studio:
npm install
npm run dev:studio
Studio should be running at localhost:1989. After you log in you you can:
  1. browse sessions, you should see the sessions we just created via curl
  2. create new playground sessions
  3. invite teammates
  4. comment on sessions, mention others, leave like/dislike default scores.