Spacerr
  • Features
  • Pricing
  • FAQ
  • Docs
Get Access
Spacerr
  • Introduction
  • Features
  • Tech Stack
  • Setup
  • Configuration
  • Agents
  • Database
  • Jobs
  • Admin
  • Settings
  • Billing
    • AI Workspace
    • Projects
    • Library
    • Context
    • Models and tools
    • Streams and realtime
  • Storage
  • Email
  • Support
  • Localization
  • SEO
  • Analytics
  • UI And Navigation
  • Deploying To Production
  • Testing And QA
  • Troubleshooting

Search documentation

Search documentation pages.

Documentation/AI Library

AI Library

The Library is the user's personal file surface for general AI chats. It collects files that come from non project chats, including uploaded attachments, long pasted text saved as files, and generated images.

Project source files stay inside their project workspace instead. This keeps project context separate from the user's general chat library.

What It Includes

  • Library dashboard page.
  • Grid and list oriented loading states.
  • Image preview dialog.
  • File downloads.
  • Single item delete.
  • Multi select actions.
  • Bulk download and bulk delete support.
  • Generated images from AI tools.
  • Uploaded chat attachments.
  • Private file access through app controlled routes.

Main Files

AreaFile
Dashboard pagesrc/app/(app)/dashboard/library/page.tsx
Main UIsrc/features/library/components/dashboard-library.tsx
Item renderingsrc/features/library/components/dashboard-library-items.tsx
Grid cardsrc/features/library/components/library-grid-card.tsx
Item menusrc/features/library/components/library-item-menu.tsx
Image previewsrc/features/library/components/library-image-preview-dialog.tsx
API clientsrc/features/library/api/library.api.ts
Repositorysrc/features/library/repositories/library.repository.ts
Typessrc/features/library/types/library.types.ts

Library UI state is owned by src/features/library/hooks/use-dashboard-library-state.ts.

Data Flow

The Library API client has two primary operations:

  • listLibraryItemsApi
  • deleteLibraryItemApi

The route constants live in ApiRoutes.library, and the feature client calls apiRequest so errors are handled consistently.

The repository reads user owned library items and deletes selected items. When a library item is deleted, related message source cleanup keeps old chat messages from pointing at files that no longer exist.

Library And Projects

The split between Library and Project Sources is intentional.

Use Library for files created in general chats. Use Project Sources for files that should stay scoped to one project and feed that project's AI context.

Generated images are added to the Library because they are user owned outputs from the assistant. Project source files are added from the project workspace because they are reusable context for that project.

Where To Customize

  • src/features/library/components for Library UI.
  • src/features/library/hooks/use-dashboard-library-state.ts for selection and view state.
  • src/features/library/api/library.api.ts for client API calls.
  • src/features/library/repositories/library.repository.ts for database behavior.
  • src/features/library/utils for formatting and download helpers.
  • src/components/ui/icons/library.icon.tsx for the local Library icon.

When adding new file actions, keep storage permissions, Library state, and chat source cleanup in sync.

AI Projects

Learn how project workspaces, project chats, and project source files support AI context.

AI Context

Learn how the assistant context is built and where to customize it.

On this page
What It IncludesMain FilesData FlowLibrary And ProjectsWhere To Customize