π Spaces
Spaces are Curiositiβs organizational system. They work like folders, letting you group files into logical hierarchies.
What Are Spaces?
Section titled βWhat Are Spaces?βSpaces provide hierarchical organization for your files:
- Support unlimited nesting depth via
parentSpaceId - Allow files to exist in multiple spaces (many-to-many via
filesInSpacetable) - Scoped to a workspace β each space belongs to one workspace
- Work naturally with semantic search
Space Hierarchy
Section titled βSpace HierarchyβCreate nested structures to organize your content:
Workspaceβββ Marketingβ βββ Campaignsβ β βββ Q1-2025β β βββ Q2-2025β βββ Brand Assetsβββ Engineeringβ βββ Documentationβ βββ Architectureβββ Finance βββ Reports βββ ContractsSpace Properties
Section titled βSpace PropertiesβEach space has the following fields (from the database schema):
| Property | Type | Description |
|---|---|---|
id | UUID | Unique identifier (auto-generated) |
name | text | Display name (required) |
description | text | Optional description |
icon | text | Optional icon (e.g., emoji) |
organizationId | text | Owning workspace (required) |
parentSpaceId | UUID / null | Parent space for nesting |
createdAt | timestamp | Creation time |
updatedAt | timestamp | Last update time |
Managing Spaces via tRPC
Section titled βManaging Spaces via tRPCβAll space operations use tRPC procedures. Here are the available operations:
List Spaces
Section titled βList Spacesβ// Get all spaces in the current workspaceconst allSpaces = trpc.space.get.useQuery();
// Get only root-level spaces (no parent)const rootSpaces = trpc.space.getRoot.useQuery();
// Get child spaces of a specific spaceconst children = trpc.space.getChildren.useQuery({ parentSpaceId: "parent-uuid",});Get a Space
Section titled βGet a Spaceβ// Get space by IDconst space = trpc.space.getById.useQuery({ spaceId: "space-uuid" });
// Get space with its full ancestry chain (breadcrumbs)const spaceWithPath = trpc.space.getWithAncestry.useQuery({ spaceId: "space-uuid",});Create a Space
Section titled βCreate a Spaceβconst createMutation = trpc.space.create.useMutation();
// Create a root-level spaceawait createMutation.mutateAsync({ name: "Marketing", description: "Marketing team files", icon: "π",});
// Create a nested spaceawait createMutation.mutateAsync({ name: "Campaigns", parentSpaceId: "marketing-space-uuid",});Update a Space
Section titled βUpdate a Spaceβconst updateMutation = trpc.space.update.useMutation();
await updateMutation.mutateAsync({ spaceId: "space-uuid", input: { name: "Marketing & Sales", description: "Updated description", icon: "π", },});Delete a Space
Section titled βDelete a Spaceβconst deleteMutation = trpc.space.delete.useMutation();
await deleteMutation.mutateAsync({ spaceId: "space-uuid" });// Child spaces are cascade-deletedGet Files in a Space
Section titled βGet Files in a Spaceβ// Get files linked to a spaceconst files = trpc.space.getFiles.useQuery({ spaceId: "space-uuid" });
// Alternative: get files via the filesInSpace junction tableconst filesInSpace = trpc.space.getFilesInSpace.useQuery({ spaceId: "space-uuid",});Files and Spaces
Section titled βFiles and SpacesβFiles are linked to spaces through the filesInSpace junction table. This means:
- A file can exist in multiple spaces without duplication
- Removing a file from a space doesnβt delete the file itself
- Deleting a space cascade-deletes the
filesInSpacelinks (but not the files)
Organization Tips
Section titled βOrganization TipsβKeep Depth Reasonable
Section titled βKeep Depth Reasonableβ3-4 levels of nesting is usually sufficient. AI search reduces the need for deep folder hierarchies.
Recommended Structures
Section titled βRecommended StructuresβBy Department:
Workspaceβββ Marketingβββ Engineeringβββ Salesβββ FinanceBy Project:
Workspaceβββ Active Projectsβ βββ Project Alphaβ βββ Project Betaβββ Archive βββ 2024 ProjectsBy Time Period:
Workspaceβββ 2025β βββ Q1β βββ Q2βββ 2024- Use consistent naming β Pick a convention and stick to it
- Donβt over-organize β Semantic search makes files findable regardless of location
- Use descriptions β Add descriptions to spaces so team members understand their purpose
- Leverage nesting β Use
parentSpaceIdfor natural hierarchies
Next Steps
Section titled βNext Stepsβ- Uploading Files β Add content to your spaces
- AI Search β Find content across spaces
- Core Concepts β Understand the data model