# Javascript / Node.js

## Getting Started

To install llongterm, use npm or yarn:

```bash
npm install llongterm
```

or

```bash
yarn add llongterm
```

After installation, ensure you setup your `.env` file to house your credentials privately.

```sh
OPENAI_API_KEY=abcdefg...
LLONGTERM_KEY=hijklmnop
```

Then we can initialise Llongterm.

```ts
import { Llongterm } from 'llongterm' 
```

```javascript
// after importing Llongterm

const llongterm = new Llongterm({
  keys: { llongterm: process.env.LLONGTERM_KEY, openai: process.env.OPENAI_API_KEY },
});
```

To get all you can out of Llongterm, you'll need to create a mind that can store memory. That's next!


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.llongterm.com/docs/javascript.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
