What You’ll Build
A complete document management system with:- A user-friendly document upload interface
- Automatic AI-based document classification
- A searchable and filterable document repository
- Document management capabilities (view, categorize, delete)
This solution combines a classification agent built in Agent Creator with the Collection app for document storage, creating a powerful yet simple document management system.
Prerequisites
Before starting this tutorial, make sure you have:- An active Prisme.ai account
- The Agent Factory App installed in your workspace
- An Agent Factory API key generated in Agent Creator (open any agent → Settings → API Keys) and pasted into the Agent Factory App’s configuration field
apiKeyafter installing it. This is required when the form page is public — without it,Agents.sendMessagereturns401 UNAUTHORIZEDfor unauthenticated form submissions. - The Collection app installed in your workspace
- A classification agent created in Agent Creator with system instructions like: Classify the document within these categories: invoice, CV, quote, contract, others. Provide your categorization based on the content. Answer with the category only.
- Basic familiarity with Prisme.ai Builder
Step 1: Creating Your Document Management Workspace
Let’s start by setting up a dedicated workspace for our document management system:
Step 2: Building the Document Upload Interface
Now, let’s create the upload interface. In v27 Builder, the frontend of a workspace is a single editable page calledindex — a React + Vite + Tailwind + Radix SPA, not a block canvas.
If you came from the legacy Pages model, the block YAML (
slug: Form, slug: DataTable) is gone. Pages are React SPA source trees; the platform compiles and previews them inside Builder. The page talks to automations through HTTP webhooks and WebSocket events instead of onSubmit / updateOn block events.Open Pages
In your workspace sidebar, select Pages. The editable
index entry is your workspace’s React app.Switch to Code mode
Use the page toolbar to switch to Code. If the workspace has no source yet, initialize the React/Vite/Tailwind/Radix starter template — Builder will scaffold
src/App.tsx, src/main.tsx, src/styles/globals.css, index.html, package.json, and vite.config.ts.Edit src/App.tsx
Open A complete, working example:The example uses plain
src/App.tsx and replace its contents with the component below. It renders an upload form (file input + description textarea), lists uploaded documents in a table, and stays in sync with the backend through documents.updated events.The component receives this prop interface from the platform:<form>, <input>, <textarea>, <table> styled with Tailwind. Radix UI primitives are available in the template if you want richer controls (dialogs, dropdowns, toasts), but they aren’t required for this tutorial.Dependencies are minimal: react (provided by the template) and the injected sdk prop. No extra packages are needed.Preview the app
Switch to Preview. Builder compiles the source and renders your SPA inside the device viewport (Desktop / Tablet / Mobile). You should see the upload form and an empty documents table.

src/App.tsx, src/main.tsx, src/styles/globals.css, index.html, package.json, vite.config.ts) and edit the React source.
Step 3: Creating the Document Classification Automation
Next, let’s set up the automation that will classify documents when they’re uploaded:Create the Submit Document webhook
Create a new automation named “Submit Document” with the following configuration. It exposes an HTTP endpoint, classifies the document, stores it, and emits a The classification logic itself (the categories, the tone of the answer) lives on the agent in Agent Creator, not in this automation. To tune the categorization, edit the agent’s system instructions there.
documents.updated event so any open SPA refreshes.Create the List Documents webhook
Create another automation named “List Documents”. The SPA calls it on mount and after each
documents.updated event to refresh the table.Create the Delete Document webhook
Create a final automation named “Delete Document”. It accepts
{ id } in the request body, removes the row, and emits documents.updated so connected SPAs reload.Step 4: Testing and Using Your Document Classification System
Now it’s time to test your document management system:Access your document upload page
Either preview the page directly inside Builder (Pages >
index > Preview), or open the deployed URL at <workspace-slug>.pages.prisme.ai. The SPA owns its own routing, so there is no /lang/upload-docs path anymore.Upload a test document
- Pick a sample document (PDF) in the file input
- Add a description that gives context about the document’s content
- Submit the form
Verify classification
The SPA POSTs to
submit-document, which returns the inferred category. The documents.updated event then triggers a reload of list-documents, and the new row appears in the table with its AI-determined classification.
src/App.tsx is in place, you’ll see the upload form and documents table here.
Step 5: Version Control and Deployment
To finalize your document classification system:Push Your Workspace
Use Push in Builder to save the current state of your workspace to its repository. See Versioning for details on how pushes and versions work.
Configure Access Controls
Set up appropriate Role-Based Access Control to determine who can use your document management system. See RBAC.
Monitoring and Improving Your System
After deployment, regularly check the system’s performance:Review Classification Accuracy
Periodically check if documents are being classified correctly and refine your system as needed.
Extending Your Document Classification System
Your base system is powerful, but consider these enhancements:- Advanced Classification: Refine your agent’s system instructions in Agent Creator, or build a more specialized agent per document family
- Content Extraction: Extract key information from documents based on their category
- Automated Workflows: Trigger specific actions based on document type (e.g., route invoices to accounting)
- Search Functionality: Add search capabilities to find documents by content or metadata
- Integration: Connect with other systems like CRM or ERP platforms
Next Steps
Build a Webhook Handler
Learn how to create webhook integrations for your document management system
Explore AI Contact Routing
Discover how to route documents to the right department automatically
Create a RAG Agent
Build an agent that can answer questions about your document repository
Integrate with Websites
Connect your document system to web content for enhanced capabilities