Skip to content

A strict, standards-compliant TypeScript library for the Open Floor Protocol (OFP), enabling interoperable, multi-agent conversational AI.

License

Notifications You must be signed in to change notification settings

open-voice-interoperability/openfloor-js

Repository files navigation

Open Floor Protocol Logo

Open Floor Protocol (OFP)

npm version TypeScript License Docs


A TypeScript library for the Open Floor Protocol (OFP), enabling interoperable, multi-agent conversational AI.


Table of Contents


Overview

The Open Floor Protocol (OFP) is an open standard for multi-agent, multi-party conversational AI interoperability. This library provides a complete, rigorously tested TypeScript implementation of the OFP specifications, including:

  • Conversation Envelope (message container)
  • Dialog Event (utterances, context, etc.)
  • Assistant Manifest (agent capabilities/identity)
  • Agent behaviors (bot, floor manager, convener)

Installation

npm install @openfloor/protocol

Usage

You can find more examples and full tutorials on openfloor.dev.

Create a Text Utterance Event

import { createTextUtterance } from '@openfloor/protocol';

const utterance = createTextUtterance({
  speakerUri: 'tag:example.com,2025:user1',
  text: 'Hello world',
  to: { speakerUri: 'tag:example.com,2025:bot1' }
});

Create a Basic Agent Manifest

import { createBasicManifest } from '@openfloor/protocol';

const manifest = createBasicManifest({
  speakerUri: 'tag:example.com,2025:bot1',
  serviceUrl: 'https://example.com/bot',
  name: 'Assistant',
  organization: 'Example Corp',
  description: 'A helpful assistant',
  capabilities: ['chat', 'help']
});

Create a Conversation Envelope

import { createSimpleEnvelope } from '@openfloor/protocol';

const envelope = createSimpleEnvelope({
  conversationId: 'conv:123',
  senderUri: 'tag:example.com,2025:bot1',
  events: [utterance]
});

Validate and Parse a Payload

import { validateAndParsePayload } from '@openfloor/protocol';

const jsonString = JSON.stringify({ openFloor: envelope });
const result = validateAndParsePayload(jsonString);
if (result.valid) {
  console.log('Payload is valid:', result.payload);
} else {
  console.error('Validation errors:', result.errors);
}

Protocol Overview

  • OFP enables seamless, cross-platform communication between human users and autonomous agents.
  • Conversation Envelope: Universal JSON structure for agent-to-agent and agent-to-user messages.
  • Dialog Event: Standardized structure for utterances, context, and features.
  • Assistant Manifest: Machine-readable agent identity and capabilities.

Specifications:

Schemas:


Testing & Development

  • Run tests:
    npm test
  • Build:
    npm run build
  • Generate docs:
    npm run docs

About

A strict, standards-compliant TypeScript library for the Open Floor Protocol (OFP), enabling interoperable, multi-agent conversational AI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •