Skip to main content

Context Spaces

Context Spaces let you organize memories into isolated namespaces. Each space acts as a container — agents can only access memories within spaces they're allowed into. Spaces support cross-tenant sharing for multi-team collaboration.

Base URL: https://novyx-ram-api.fly.dev

Tier: All (sharing features require Pro+)


Create Space

POST /v1/context-spaces

Create a new context space. You become the owner.

Request body

ParameterTypeRequiredDefaultDescription
namestringYesSpace name (1–100 characters)
descriptionstringNoSpace description (max 500 characters)
allowed_agent_idsstring[]No[]Agent IDs that can access this space (max 10)
allowed_tenant_idsstring[]No[]Other tenant IDs with access
tagsstring[]No[]Space tags

Response fields

FieldTypeDescription
space_idstringUnique space identifier
namestringSpace name
descriptionstring | nullSpace description
owner_tenant_idstringOwner's tenant ID
allowed_agent_idsstring[]Authorized agent IDs
allowed_tenant_idsstring[]Authorized tenant IDs
tagsstring[]Space tags
created_atstringISO 8601 timestamp
memory_countnumberNumber of memories in the space

Examples

from novyx import Novyx

nx = Novyx(api_key="nram_your_key")

space = nx.create_space(
name="customer-support",
description="Shared context for support agents",
allowed_agent_ids=["agent-1", "agent-2"],
tags=["support", "production"],
)
print(space["space_id"])

Response

{
"space_id": "urn:uuid:s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "customer-support",
"description": "Shared context for support agents",
"owner_tenant_id": "tenant_abc123",
"allowed_agent_ids": ["agent-1", "agent-2"],
"allowed_tenant_ids": [],
"tags": ["support", "production"],
"created_at": "2026-03-09T12:00:00Z",
"memory_count": 0
}

Errors

StatusCodeCause
400VALIDATION_ERRORName too long or too many agent IDs
401UNAUTHORIZEDInvalid or missing API key

List Spaces

GET /v1/context-spaces

List all spaces you own or have been granted access to.

Response fields

FieldTypeDescription
spacesarrayArray of space objects
total_countnumberTotal spaces accessible

Examples

result = nx.list_spaces()
for space in result["spaces"]:
print(f"{space['name']}: {space['memory_count']} memories")

Response

{
"spaces": [
{
"space_id": "urn:uuid:s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"name": "customer-support",
"description": "Shared context for support agents",
"owner_tenant_id": "tenant_abc123",
"allowed_agent_ids": ["agent-1", "agent-2"],
"allowed_tenant_ids": [],
"tags": ["support", "production"],
"created_at": "2026-03-09T12:00:00Z",
"memory_count": 42
}
],
"total_count": 1
}

Get Space

GET /v1/context-spaces/{space_id}

Retrieve a single space by ID. Cross-tenant access is audit-logged.

Path parameters

ParameterTypeDescription
space_idstringSpace identifier

Examples

space = nx.get_space("urn:uuid:s1a2b3c4-d5e6-7890-abcd-ef1234567890")
print(space["name"])
print(space["memory_count"])

Errors

StatusCodeCause
403FORBIDDENYou don't have access to this space
404NOT_FOUNDSpace does not exist

Update Space

PUT /v1/context-spaces/{space_id}

Update a space. Owner only. Send only the fields you want to change.

Path parameters

ParameterTypeDescription
space_idstringSpace identifier

Request body

ParameterTypeRequiredDescription
namestringNoUpdated name (1–100 characters)
descriptionstringNoUpdated description (max 500 characters)
allowed_agent_idsstring[]NoUpdated agent access list
allowed_tenant_idsstring[]NoUpdated tenant access list
tagsstring[]NoUpdated tags

Examples

updated = nx.update_space(
"urn:uuid:s1a2b3c4-d5e6-7890-abcd-ef1234567890",
name="customer-support-v2",
allowed_agent_ids=["agent-1", "agent-2", "agent-3"],
)

Errors

StatusCodeCause
400VALIDATION_ERRORInvalid field value
403OWNER_ONLYOnly the space owner can update
404NOT_FOUNDSpace does not exist

Delete Space

DELETE /v1/context-spaces/{space_id}

Soft-delete a space. Owner only. Memories in the space are not deleted.

Path parameters

ParameterTypeDescription
space_idstringSpace identifier

Examples

nx.delete_space("urn:uuid:s1a2b3c4-d5e6-7890-abcd-ef1234567890")

Response

Returns 204 No Content on success.

Errors

StatusCodeCause
403OWNER_ONLYOnly the space owner can delete
404NOT_FOUNDSpace does not exist

List Space Memories

GET /v1/context-spaces/{space_id}/memories

List memories scoped to a specific space, with optional search and filters. Cross-tenant access is audit-logged.

Path parameters

ParameterTypeDescription
space_idstringSpace identifier

Query parameters

ParameterTypeRequiredDefaultDescription
qstringNoSearch query (semantic/text)
tagsstringNoComma-separated tag filter
agent_idstringNoFilter by agent ID
limitnumberNo100Max results (1–1000)
offsetnumberNo0Pagination offset

Response fields

FieldTypeDescription
memoriesarrayArray of memory objects
total_countnumberTotal matching memories
filtersobjectEcho of applied filters (includes space_id)

Examples

# List all memories in a space
result = nx.space_memories("urn:uuid:s1a2b3c4-d5e6-7890-abcd-ef1234567890")

# Search within a space
result = nx.space_memories(
"urn:uuid:s1a2b3c4-d5e6-7890-abcd-ef1234567890",
q="dark mode",
tags="preferences",
limit=10,
)

Response

{
"memories": [
{
"uuid": "urn:uuid:a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"observation": "User prefers dark mode and compact layouts",
"tags": ["preferences", "ui"],
"importance": 8,
"confidence": 1.0,
"recall_count": 3,
"created_at": "2026-03-09T12:00:00Z"
}
],
"total_count": 42,
"filters": {
"space_id": "urn:uuid:s1a2b3c4-d5e6-7890-abcd-ef1234567890",
"q": null,
"tags": null,
"agent_id": null
}
}

Errors

StatusCodeCause
403FORBIDDENYou don't have access to this space
404NOT_FOUNDSpace does not exist