- Notifications
You must be signed in to change notification settings - Fork1
Example PostgresML application using Express JS
License
postgresml/example-expressjs
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
The purpose of this repository is to demonstrates how to quickly get up and running with machine learning in an Express application.
This application is a simple note taking application. It analyzes all the notes taken in a day and performs summarization and sentiment analysis on them.
All our ML occurs in the database where the notes are stored. This means just by connecting to the database we are able to train and deploy ML/AI models and have a production ready pipeline.
This example application requires a PostgreSQL database with the pgml and pgvector extension installed. The easiest way to do this is with a free database atpostgresml.org.
Clone this repository. Once you have your PostgresML database, or local PostgreSQL with the extensions installed, create a .env file and addDATABASE_URL=<your_db_url>
replacing your_db_url.
Next install all required node packages withnode install
.
Start the express server by running the following
npm run devStart
This will launch the application atlocalhost:3000
In a browser, navigate to localhost:3000. Recored a note in the text area on the left and click submit. Do this a couple times. On the right click Analyze Day, this will produce a sentiment analysis score and a summarization of your day.

We can augment this code to perform all types of ML. Checkout thepostgresML docs for a full list.
If you are unhappy with the quality of the results, rest assured, higher quality models are available.
In this example we directly interacted with the extension using PostgreSQL. If you would prefer JS, see ourJS SDK
About
Example PostgresML application using Express JS
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.