Upload Your Data

You've signed up to Noematic, and learned to use the API - now it's time to upload your data. While we show how to perform the following actions through the API, you can achieve the same effect using the Noematic dashboard. Use whichever method is preferable.

Creating a database

Noematic holds your domain-specific data in databases, which are stored at the team level. Let's create one.

POST
https://api.noematic.ai
Header
Content-Type
application/json
Header
Authorization
Bearer [noematic_api_key]
Body
{
"version": "1.0",
"view": "team",
"action": "create_database",
"data": {
"name": "Store Products",
"model": "cosmopolitan-v10",
"language": "en"
}
}

Note that the create_database action expects associated data.

  • stringname
    is the display name for your database.
  • stringmodel
    is the AI model used for this database.
    • Use Noematic's cosmopolitan-v10 model for any content.
    • Other first- and third-party models to come.
  • stringlanguage
    is the ISO 639-1 code of the primary natural language of the content in your database. This property is only a hint and can be set to null or not included.
Response
Body
{
"data": {
"id": "MtjraphUEnYS8esgGgTS12Q7zs4uyBrHw"
}
}

The response data indicates a globally unique

stringid
for your database.

Creating records

Databases are stores of records. You can think of records as the equivalent of rows in relational databases, or documents in document databases. In Noematic, records take the form of arbitrary JSON.

For this example, suppore you want to add records representing products to our database. We might have data like the following.

Database Record
{
"sku": "GK-2X9-9R8",
"name": "KitchenAid Pasta Roller And Cutter",
"description": "One Pasta Roller / Two Pasta Cutters / Cleaning Brush / Chrome Finish",
"price": 49.99,
"reviews": [
{
"author": "Emilio Grimes",
"comment": "This pasta roller and cutter makes short work of past-making!",
"stars": 5
},
{
"author": "Jacklyn Delgado",
"comment": "This product is a great way to make fresh pasta from scratch!",
"stars": 4
},
{
"author": "Jalen Washington",
"comment": "This tool is too expensive for what you get.",
"stars": 2
}
]
}

To add this record to a database, you can use the create_database_record action.

POST
https://api.noematic.ai
Header
Content-Type
application/json
Header
Authorization
Bearer [noematic_api_key]
Body
{
"version": "1.0",
"view": "team",
"action": "create_database_record",
"data": {
"database": {
"id": "MtjraphUEnYS8esgGgTS12Q7zs4uyBrHw"
},
"content": {
"sku": "GK-2X9-9R8",
"name": "KitchenAid Pasta Roller And Cutter",
"description": "One Pasta Roller / Two Pasta Cutters / Cleaning Brush / Chrome Finish",
"price": 49.99,
"reviews": [
{
"author": "Emilio Grimes",
"comment": "This pasta roller and cutter makes short work of past-making!",
"stars": 5
},
{
"author": "Jacklyn Delgado",
"comment": "This product is a great way to make fresh pasta from scratch!",
"stars": 4
},
{
"author": "Jalen Washington",
"comment": "This tool is too expensive for what you get.",
"stars": 2
}
]
}
}
}

As before, create_database_record expects some information about the new record.

  • objectdatabase
    is the database to hold this record.
    • stringid
      is the globally unique identifier of the selected database.
  • objectcontent
    is the content of the record, in the form of arbitrary JSON.
Response
Body
{
"data": {
"id": "CVbhVTRS45vk2dVLiSfHDatSZnoeQLmDe"
}
}

The response data indicates a globally unique

stringid
for your newly created record.

Creating indexes

You've successfully created a database and uploaded your records, but in this state, your records aren't yet searchable. For that, you must create at least one index. Indexes are used to inform Noematic of the searchable or filterable fields in your records, using dot notation. There are various kinds of indexes. You can analyze natural language text with text indexes, ISO 8601-formatted timestamps with datetime indexes, other text (e.g. IDs, codes, etc) with keyword indexes, numbers with integer and float indexes, and boolean values with boolean indexes.

In the product database example, these are some reasonable choices for indexes:

  • The fields name, description and reviews.comment contain natural language text and could therefore benefit from a text index. Note how in the last instance, we have specified a nested object path, regardless of reviews being an array.
  • The field sku contains a text-based product identifier and could therefore benefit from a keyword index to allow filtering by sku.
  • The field reviews.stars indicates an integer star rating for a given review and could therefore benefit from an integer index to allow filtering products based on their review scores.
  • The field price is a (possibly) non-integer number, and could therefore benefit from a float index to allow filtering products by price.

You can use the create_database_index action to create an index for review comments.

POST
https://api.noematic.ai
Header
Content-Type
application/json
Header
Authorization
Bearer [noematic_api_key]
Body
{
"version": "1.0",
"view": "team",
"action": "create_database_index",
"data": {
"database": {
"id": "MtjraphUEnYS8esgGgTS12Q7zs4uyBrHw"
},
"type": "text",
"name": "Review Comments",
"field": "reviews.comment"
}
}

This action takes the following parameters.

  • objectdatabase
    is the database to hold this index.
    • stringid
      is the globally unique identifier of the selected database.
  • stringtype
    is the type of the index, this can be one of the following options:
    • Use text for natural language text.
    • Use datetime for ISO 8601-formatted timestamps.
    • Use keyword for other text that must be matched or filtered exactly, including IDs and codes.
    • Use integer for numbers without decimals.
    • Use float for numbers with decimals.
    • Use boolean for true/false values.
  • stringname
    is a human-readable name for the index.
  • stringfield
    is a path to searchable text within record contents, using dot notation.

Next steps

You've created a database, uploaded your domain-specific records, and created indexes to make them searchable. Now find out how to search your data.

GRAVITAS

© 2021-2025 Noematic.ai