@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

Python SDK

FloorMemory Python SDK#

This page describes how to use the FloorMemory Python SDK in real backend applications, services, automation pipelines, and AI agents.
Use this SDK to:
Query memory-aware, multi-turn conversations
Add content and knowledge to Floors
Retrieve recent activity and conversations
Fetch floor metadata and structure
Manage floor settings (owner-only actions)
The SDK is designed for server-side usage and mirrors the FloorMemory APIs closely.
āš ļø Important
Functionality is accessed through capability-specific API classes such as QueryApi, EventApi, GetRecentEventsApi, etc.

Source Code#

Official Python SDK Repository
šŸ‘‰ https://github.com/xFloorllm/floor-memory-sdk-client/tree/main/python
Production-ready usage examples
šŸ‘‰ https://github.com/xFloorllm/floor-memory-sdk-examples/tree/main/python
The examples repository contains:
Clean backend integration samples
Multi-turn conversation patterns
Structured ingestion flows
Production-safe usage templates
If you're building a real backend service, start there.

Installation#


Authentication & Setup (Required)#

All authenticated APIs use Bearer Token authentication.
You must also provide an app_id when invoking APIs that require application context.

Environment Variables (Recommended)#


Client Configuration#

Key Points#

Authentication header:
Authorization: Bearer <BEARER_TOKEN>
Create one ApiClient per service
Reuse API instances (do not recreate per request)
app_id is passed per API call
app_id is never embedded inside payload JSON

Adding Content to a Floor (Create Event)#

Use this API to store knowledge that future conversations can reference.
API class: EventApi
Endpoint: POST /api/memory/events
Ingestion model: Asynchronous
200 OK means accepted and queued, not immediately searchable

Method Parameters#

FieldTypeRequiredDescription
app_idstrāœ…Calling application context

input_info (JSON string)#

FieldTypeRequiredDescription
floor_idstrāœ…Floor where content is stored
block_idstrOptionalBlock container inside the floor
block_typestrOptionalContent category (post, forum)
user_idstrāœ…Author / owner of the content
titlestrOptionalOptional title
descriptionstrāœ…Main textual content

Correct Example#


Important Notes#

app_id is NOT part of input_info
200 OK means queued
Indexing is asynchronous
Poll Recent Events API if you need ingestion confirmation
Do not assume immediate search visibility

Querying Memory (Multi-Turn Conversations)#

Use this API to retrieve memory-aware answers across one or more Floors.
API class: QueryApi
Designed for conversational continuity
Supports summarization and metadata control

Example#


Key Query Controls#

ParameterPurpose
summary_needed="1"Returns summarized answer
include_metadata="1"Includes source metadata
floor_ids=[]Restrict search to specific floors
user_idEnables conversation continuity

Production-Safe Agent Pattern#

This pattern ensures:
One shared client
Clean API separation
Deterministic parameter handling
Safe integration with FastAPI / Celery / workers

Why This Structure Matters (Subtle but Critical)#

Keeps SDK aligned with OpenAPI contract
Avoids silent validation failures
Prevents future SDK updates from breaking payloads
Makes distributed workers deterministic
Ensures multi-turn memory continuity works correctly

When to Use the Examples Repository#

If you are:
Building a real backend service
Integrating with FastAPI
Running Celery workers
Designing an AI agent
Creating automation pipelines
Use the official examples:
šŸ‘‰ https://github.com/xFloorllm/floor-memory-sdk-examples/tree/main/python
That repository reflects best-practice integration patterns, not just raw SDK calls.
Modified atĀ 2026-02-19 04:58:28
Previous
SDK Installation & Setup
Next
JavaScript SDK
Built with