> For the complete documentation index, see [llms.txt](https://docs.jamaibase.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.jamaibase.com/developer-reference/framework-integration/nlux-+-express.js.md).

# NLUX + Express.js

## 1. Create Chat Agent

* Create **Project**

<figure><img src="https://949944545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRNnvWSkFcg9eUeFklENf%2Fuploads%2Fcb6CxaTjAbzhEQWqvs1Y%2Fimage.png?alt=media&amp;token=53d96b1e-f942-4c6b-8614-9b5708b0f238" alt=""><figcaption></figcaption></figure>

* Create a **Chat Agent** at **Project >  Chat Table > New Agent**
* Configure your agent. You can define the following parameters.

| Parameter     | Description                                          |   |
| ------------- | ---------------------------------------------------- | - |
| Agent ID      | Name of Agent                                        |   |
| Model         | LLM model                                            |   |
| Temperature   |                                                      |   |
| Max tokens    |                                                      |   |
| Top-p         |                                                      |   |
| System Prompt | Define the persona of the model                      |   |
| User message  | Define the conversational opener between User and AI |   |
| AI response   | Define the conversational opener between User and AI |   |

<figure><img src="https://949944545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRNnvWSkFcg9eUeFklENf%2Fuploads%2FK2mZz1WPgnd15hO1IIRh%2Fimage.png?alt=media&amp;token=0cfb965f-9667-4679-bd57-ff0dc5fe9e90" alt=""><figcaption></figcaption></figure>

## 2. Get the following information to start using JamAIBase

* Get the **Agent ID.**
* Get the **Project ID**.

<figure><img src="https://949944545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRNnvWSkFcg9eUeFklENf%2Fuploads%2FYUP5b640Ay6rWcQakEOt%2Fimage.png?alt=media&amp;token=0e40cd24-0756-4734-b0fd-27f498aa9d2c" alt=""><figcaption></figcaption></figure>

* Create **JamAI API Key** at **Organization > Secrets > Create API Key.**

<figure><img src="https://949944545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRNnvWSkFcg9eUeFklENf%2Fuploads%2FiKEvdvKwhs9LsLPImRxc%2FWhatsApp%20Image%202024-05-30%20at%2020.54.27.jpeg?alt=media&amp;token=aa43f907-abda-425a-81b8-93aa18c2004d" alt=""><figcaption></figcaption></figure>

## 3. Clone the Chatbot Example

```bash
git clone https://github.com/EmbeddedLLM/jamaibase-cookbook

# example is at https://github.com/EmbeddedLLM/jamaibase-cookbook/tree/main/quickstart/nlux/0002-chat-with-jamai-agent-express
```

## 4. Create .env file

Create an`.env` file at \`0002-chat-with-jamai-agent-express/server\` with the following content.

````typescript
// 0002-chat-with-jamai-agent-express/server.env
```properties
BASEURL="https://api.jamaibase.com"
JAMAI_APIKEY="<jamaibase-api-key>"
PROJECT_ID="<jamaibase-project-id>"
AGENT_ID="<your-agent-id"

````

## 5. Start app

```bash
cd jamaibase-cookbook/quickstart/nlux/0002-chat-with-jamai-agent-expressjs
npm install

# on first terminal
npm run server

# on second terminal
npm run app
```

* Open up your app at <http://localhost:5173> .&#x20;

## 6. Manage and View Conversation Histories in Chat Table

<figure><img src="https://949944545-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRNnvWSkFcg9eUeFklENf%2Fuploads%2Fj9eHaMq1N4FEIWgV76M8%2Fimage.png?alt=media&amp;token=b538ed8f-0d28-45c2-997a-41164999d489" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.jamaibase.com/developer-reference/framework-integration/nlux-+-express.js.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
