> For the complete documentation index, see [llms.txt](https://docs.llongterm.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.llongterm.com/docs/javascript/llongterm.create.md).

# llongterm.create

Creating a new mind can be tricky - just ask Frankenstein! However, we've tried to make the process as painless as possible. First lets create a mind for our user who's specialism is 'Financial Advisor'.

```javascript

const specialistMind = await llongterm.create({ 
  username: "Dom",
  specialism: "Financial Advisor", 
  specialismDepth: 2,
})
```

This returns an autogenerated memory structure that is empty, alongside the metadata of the mind.

```
memory: {
  summary: Empty mind
  unstructured: {}
  structured: {
    Investment Strategies: {
      summary: Investment strategies section
      unstructured: {}
      structured: {
        Equity Investment : ...
        Fixed Income Investment Strategies ...
        ...
      }
    },
    Retirement Planning: {
    ....
    }
  }
}
```

As information is fed in, the relevant subsections are found and filled in based on the users input.

It's also possible to enforce custom structured keys into the memory structure:

```javascript
const customisedMind = await llongterm.create({ 
  username: "Dom",
  customStructuredKeys: ["Coding Languages", "Best Practices", "Testing"],
});
```

```
"memory": {
  "summary": "Empty mind",
  "unstructured": {},
  "structured": {
    "Coding Languages": {
      "summary": "Empty section",
      "unstructured": {},
      "structured": {}
    },
    "Best Practices": {
      "summary": "Empty section",
      "unstructured": {},
      "structured": {}
    },
    "Testing": {
      "summary": "Empty section",
      "unstructured": {},
      "structured": {}
    }
  }
}
```

### Arguments

| Argument             | Type      | Required | Description                                                                                                                                                                    |
| -------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| username             | string    | Yes      | The user associated with the mind. This should align with the username used in the thread conversation                                                                         |
| specialism           | string    | No\*     | Defines the mind's area of expertise (e.g., "Financial Advisor", "Software Engineer"). Cannot be used with `customStructuredKeys`.                                             |
| specialismDepth      | number    | No       | Controls the granularity of the specialist mind's memory structure. Higher numbers create more detailed categorization. Default is 1. Only applicable when using `specialism`. |
| customStructuredKeys | string\[] | No\*     | Array of custom memory categories for organizing the mind's knowledge (e.g., \["Coding Languages", "Best Practices"]). Cannot be used with `specialism`.                       |

\* Either `specialism` OR `customStructuredKeys` must be provided, but not both.

#### Response

| Property | Type    | Description           |
| -------- | ------- | --------------------- |
| mind     | \<Mind> | Llongterm Mind object |


---

# 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 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/llongterm.create.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.
