Skip to content
On this page

Mindwave: AI Chatbots, Agents & Document Q&A in Laravel Simplified.

What is Mindwave?

Mindwave is a Laravel package that lets you easily build AI-powered chatbots, agents, and document question and answering (Q&A) functionality into your application.

Example

Code Example

php
<?php

use Illuminate\Support\Facades\File;
use Mindwave\Mindwave\Facades\DocumentLoader;
use Mindwave\Mindwave\Facades\Mindwave;
use Mindwave\Mindwave\Memory\ConversationBufferMemory;

$agent = Mindwave::agent(
    memory: ConversationBufferMemory::fromMessages([])
);

Mindwave::brain()
    ->consume(
        DocumentLoader::fromPdf(
            data: File::get("uploads/important-document.pdf"),
            meta: ["name" => "Important document"],
        )
    )
    ->consume(
        DocumentLoader::fromUrl(
            data: "https://mindwave.no/",
            meta: ["name" => "Mindwave Documentation"],
        )
    )
    ->consume(
        DocumentLoader::make("My name is Helge Sverre")
    );


$agent->ask("List the top 3 most important things in 'important document'");
$agent->ask("What is mindwave?");
$agent->ask("What is my name?");

Use Cases

  • 💬 Chatbots: Building AI-powered chatbots to provide support to customers.
  • 🤖 Agents: Developing intelligent agents to automate tasks within an application.
  • Document Q&A: Creating document question and answering (Q&A) systems to extract insights from text.

Technical

  • Mindwave makes it easy to generate embeddings for many types of documents (text, pdf, html, csv, json, etc), store those embeddings in a Vector database.
  • Using pre-made prompts you can instruct an Agent to run custom "tools" that can perform an action in your codebase, lookup specific information from an external source, search your vector database for semantically similar information and use the result of that action to generate an answer.

Support

Mindwave is "driver" oriented, this means you can swap out the parts to suite your needs and use-cases.

Vector databases

NameSupported?
PineconeYes
WeaviateNo (planned)
QdrantNo (planned)
MilvusNo (planned)
pgvectorNo (planned)

LLMs

NameSupported?
OpenAI Chat modelsYes (Recommended)
OpenAI CompletionYes
Cohere AINo (planned)
Anthropic ClaudeNo (planned)

Embeddings

NameSupported?
OpenAI text-ada-002Yes (Recommended)

Known Limitations

While Mindwave offers powerful AI capabilities, there are some limitations to keep in mind:

LimitationDescription
HallucinationLarge language models (LLMs) like OpenAI's GPT models can occasionally produce nonsensical responses or "hallucinate".
English-CentricWhile you can configure Mindwave to respond in different languages, it may not always be accurate or natural-sounding.
Context LengthOpenAI's GPT models have a hard limit on the length of the input context they can process, which varies depending on the model.

Here are the current context length limits for some of the OpenAI models supported by Mindwave:

Model IDMax Tokens
text-davinci-0034,097
gpt-3.5-turbo4,096
gpt-44,096

It's important to keep these limitations in mind when building applications with Mindwave, and to test and evaluate the results carefully to ensure the desired outcomes are being achieved.

Credits