A TypeScript library for the Open Floor Protocol (OFP), enabling interoperable, multi-agent conversational AI.
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:
npm install @openfloor/protocol
You can find more examples and full tutorials on openfloor.dev.
import { createTextUtterance } from '@openfloor/protocol';
const utterance = createTextUtterance({
speakerUri: 'tag:example.com,2025:user1',
text: 'Hello world',
to: { speakerUri: 'tag:example.com,2025:bot1' }
});
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']
});
import { createSimpleEnvelope } from '@openfloor/protocol';
const envelope = createSimpleEnvelope({
conversationId: 'conv:123',
senderUri: 'tag:example.com,2025:bot1',
events: [utterance]
});
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);
}
Specifications:
Schemas:
npm test
npm run build
npm run docs