A TypeScript-based backend template for Unbody integration, providing AI-powered content management capabilities.
.
├── backend/ # Backend services and configurations
│ ├── admin-client.ts # Unbody admin client configuration
│ ├── configs.ts # Project configurations and constants
│ ├── run.ts # Script runner for backend operations
│ ├── setup-project.ts # Project initialization and setup
│ ├── enhancers/ # Custom content enhancers
│ └── data-sources/ # Data source configurations
└── package.json # Project dependencies and scripts
- Node.js (v14 or higher)
- Yarn package manager
- Unbody account and credentials
Create a .env
file in the root directory with the following variables:
UNBODY_ADMIN_ID=your_admin_id
UNBODY_ADMIN_SECRET=your_admin_secret
- Clone the repository
- Install dependencies:
yarn install
These commands need to be run only once when setting up the project:
-
Initialize the Unbody project:
yarn unbody-backend:setup-project
This creates a new project in Unbody with configured AI services and settings.
-
Create data sources:
yarn unbody-backend:data-sources:push-datasource-create
This sets up the data sources that will be used to push content to Unbody.
These commands should be run whenever your local data changes:
- Update data sources with new content:
This pushes any new or updated content to Unbody.
yarn unbody-backend:data-sources:push-datasource-update
The backend is configured with the following AI services:
- Text Vectorizer: OpenAI Text Embedding 3 Large
- Generative Model: OpenAI GPT-4
- Reranker: Cohere English V3
- Auto Summary: OpenAI GPT-4 Mini
- Auto Vision: OpenAI GPT-4
The project is configured with:
- Project Name: the name of Unbody project
- Storage Path: where the files are stored
Supported file extensions:
- PDF, DOCX, DOC, TXT, MD, CSV, XLS, XLSX
-
For new projects, run the one-time setup routines in order:
yarn unbody-backend:setup-project yarn unbody-backend:data-sources:push-datasource-create
-
When your local data changes, run the update routine:
yarn unbody-backend:data-sources:push-datasource-update
This project is licensed under the MIT License.