@xfloor-memory-sdk
  1. SDK
@xfloor-memory-sdk
  • Get Started
    • Overview
    • Quick Start
    • Authentication and Identification
    • Core Concepts (5-Minute Read)
    • What to Use First (API Map)
  • SDK
    • Overview
    • SDK Installation & Setup
    • Python SDK
    • JavaScript SDK
    • Typescript SDK
    • Java SDK
    • FAQ & Troubleshooting
    • Copy-Paste Debug Checklists
  • Core FloorMemory
    • Query (Primary API)
      POST
    • Create Event (Post Content)
      POST
    • Recent Events
      GET
    • Basic information of a floor
      GET
  • Floor Management
    • Edit floor
      POST
    • Make floor Private
      POST
    • Make floor public
      POST
    • Rename floor
      POST
  • Registration
    • Sign Up
      POST
    • Sign In with email ID
      POST
    • Sign In with Mobile number
      POST
    • Validation
      POST
    • Change Password
      POST
    • Reset Password
      POST
    • Change email ID
      POST
    • Change Mobile number
      POST
    • Send Validation code
      POST
    • External User Registration
      POST
  • SDKs
  • Schemas
    • PostAdd
    • QueryResponse
    • Media
    • UserDetails
    • SignUpResponse
    • BlockDetails
    • FloorInfo
    • Threads
    • EventResponse
    • 400ErrorCode
    • Remaining
  1. SDK

JavaScript SDK

FloorMemory JavaScript SDK (Node.js + Browser Example)#

The FloorMemory JavaScript SDK allows you to integrate FloorMemory (xfloor’s conversational memory platform) into Node.js services and browser applications.
You can use it to:
Run context-aware, multi-turn conversational queries
Store posts, notes, documents, and structured knowledge into Floors
Retrieve recent activity feeds
Fetch floor metadata for UI rendering and permissions
Call authentication and identity APIs when required
The SDK exposes capability-based API classes such as:
QueryApi
EventApi
GetRecentEventsApi
GetFloorInformationApi
EditFloorApi
Authentication APIs
⚠️ Important
Use named imports only. There is no default export.
Each capability must be accessed via its dedicated API class.

Source Code#

Official SDK Repository#

πŸ‘‰ https://github.com/xFloorllm/floor-memory-sdk-client/tree/main/js

Production Examples (Recommended)#

πŸ‘‰ https://github.com/xFloorllm/floor-memory-sdk-examples/tree/main/js
The examples repository contains:
Clean Node.js backend integrations
Browser-safe usage patterns
Multi-turn conversational examples
Structured event ingestion templates
Production-safe configuration patterns
If you're building a real application, start there.

Installation#


Importing the SDK#


Authentication & Setup (Required)#

All FloorMemory APIs use Bearer Token authentication.
Authentication is configured once on a shared ApiClient instance and reused across all API classes.

1️⃣ Configure Bearer Token (Once at Startup)#

Key Points#

Sent as:
Authorization: Bearer <XFLOOR_API_KEY>
Shared across all API classes
Do not configure per request
Do not embed tokens in payloads

2️⃣ app_id Is NOT Global (Critical Detail)#

app_id must be passed explicitly per API call.
It is never globally configured.

Common Parameter Glossary#

ParameterMeaning
user_idUnique xfloor user identifier. Enables personalization and conversation continuity.
app_idCalling application identifier.
floor_id / floor_idsIdentifies which Floor(s) to read from or write to.
block_idBlock container inside a floor.
block_typeContent category (e.g., post, forum).
Flags ("0" / "1")Some booleans are string-encoded (summary_needed: "1").

Conversational Query (Primary API)#

API class: QueryApi
Endpoint: POST /agent/memory/query
Designed for multi-turn conversational retrieval across Floors.

Example (Node.js Backend)#


What Makes This β€œMemory-Aware”?#

Same user_id β†’ conversation continuity
Supports follow-up questions
Can return summarized responses
Can include metadata sources

Add Content to a Floor (Create Event)#

API class: EventApi
Endpoint: POST /api/memory/events
Content-Type: multipart/form-data
Ingestion model: Asynchronous
200 OK means accepted and queued, not immediately searchable.

Request Structure (inputInfo)#

inputInfo must be a stringified JSON object.
FieldTypeRequiredDescription
floor_idstringβœ…Target floor
block_idstringβœ…Block container
block_typestringβœ…Category (post, forum)
user_idstringβœ…Author
titlestringOptionalTitle
descriptionstringβœ…Main content

Example (Text-Only Event)#


Retrieve Recent Activity (Feed)#

Use this to confirm ingestion if your application requires deterministic behavior.

Get Floor Metadata#

Returns metadata only (no embeddings, no content body retrieval).

Edit Floor (Owner Only)#


Complete Client-Side Example (Browser Application)#

Below is a safe browser pattern using Promises.

Error Handling Pattern#


Performance & Production Best Practices#

Configure authentication once at startup
Reuse API instances
Do not recreate ApiClient per request
Poll feed if ingestion visibility is required
Keep user_id stable for conversation continuity
Never embed app_id inside inputInfo

Using the Official Examples Repository#

If you are building:
A Node.js backend (Express / Fastify)
A browser-based dashboard
An AI agent with conversational memory
A production ingestion pipeline
Start with:
πŸ‘‰ https://github.com/xFloorllm/floor-memory-sdk-examples/tree/main/js
The examples repository reflects:
Real-world usage patterns
Correct parameter placement
Clean separation of auth and payload
Deterministic event ingestion flows
Multi-floor conversational design

Where to Go Next#

πŸ‘‰ TypeScript SDK
πŸ‘‰ Java SDK
πŸ‘‰ Python SDK
πŸ‘‰ Core FloorMemory APIs
Modified atΒ 2026-02-19 05:01:26
Previous
Python SDK
Next
Typescript SDK
Built with