ALANI

ALANI is your intelligence engine. It is the engine that you query to get answers based on your budles of data. The requests made to these endpoints are stateless, meaning that you will need to pass the entire conversation on every request to get a new response. In this page, we will see how to make requests to ALANI through the API and how to select different sets of data.

The ALANI conversation model

The ALANI conversation model is a simple array of interactions between any given user, and ALANI. It's an array of objects that contain each interaction, specifying who is it coming from, and the content of the interaction. This model is used to keep track of the conversation and to provide context to ALANI on the next response.

Properties

  • Name
    data
    Type
    array
    Description

    Array corresponding to the current conversation.

  • Name
    content
    Type
    string
    Description

    Arbitrary content of the interaction.

  • Name
    role
    Type
    enum ("user" | "assistant")
    Description

    This is the main content of the note. It should be a string, but it can be stringified HTML content if you want to include rich text.

  • Name
    sources
    Type
    array
    Description

    This is the unique identifier for the bundle that this note is contained in.

  • Name
    externalUrl
    Type
    string
    Description

    The URL for the source that the assistant is referencing. This will point to a hosted page in ALANI, or directly into an external source if it exists.

  • Name
    index
    Type
    number
    Description

    This is the index of the source that is being referenced in the response.

  • Name
    name
    Type
    string
    Description

    This is the title of the note that is being referenced in the response.

  • Name
    noteId
    Type
    string
    Description

    This is the unique identifier for the note that is being referenced in the response.


POST/v1/language/alani

Get ALANI insight

This endpoint allows you to retrieve a response from ALANI based on the bundles that you specify.

Optional attributes

  • Name
    question
    Type
    string
    Description

    The question to ask ALANI.

  • Name
    bundleId
    Type
    string
    Description

    The bundle identifier to generated the sources.

Request

POST
/v1/language/alani
curl -G https://api.bundleiq.com/v1/language/alani \
  -H "X-Api-Key: {token}" \
  -d '{
        "chat": [
          {
            "content": "What is bundleIQ?"
            "raw": false,
            "role: "user
          }
        ],
        "model": "gpt-4-turbo-preview",
        "bundles": ["66c8960d316d444f91917afa"]
      }'

Response

{
  "data": [
      [
          {
            role: "user",
            content: "What is bundleIQ?",
          },
          {
            role: "assistant",
            content: "# Knowledge Management PLatform\n\nBundleIQ is a platform that leverages the power of AI to make sense of unstructure information at scale...",
            sources: [
              {
                name: "What makes bundleIQ different?",
                index: 1,
                noteId: "654ce3e8e3288a6411a27aa2",
                searchMethod: "semantic",
                externalUrl: "https://storage.googleapis.com/staging-bnotes-media/647e380592f685fdd9852519/ae3a36fc517e3a694438.pdf#page=13",
              },
              ...
            ],
          },
        ]
      ...
  ]
}