This is a web application for creating, managing, and querying MindsDB Knowledge Bases. It provides a user-friendly interface for stress-testing the new MindsDB Knowledge Base release.
- Create Knowledge Base: Create new knowledge bases directly from the web interface.
- Ingest Data: Upload text files to populate your knowledge bases.
- Metadata Support: Add metadata to your data during ingestion.
- Semantic Search: Perform semantic searches on your knowledge bases.
- Metadata Filtering: Filter your search results based on metadata.
- Automated Jobs: Create jobs to periodically update your knowledge bases from a given source.
- AI Table Integration: Create AI tables that leverage your knowledge bases to generate insights.
-
Clone the repository:
git clone https://github.com/gyash1512/knowledge-base-app.git cd knowledge-base-app -
Create a virtual environment and install Python dependencies:
python3 -m venv venv source venv/bin/activate pip install -r requirements.txt -
Install frontend dependencies:
cd frontend npm install -
Create a
.envfile in the root of the project and add your MindsDB credentials and other configurations:MINDSDB_USER=your-mindsdb-email MINDSDB_PASSWORD=your-mindsdb-password MINDSDB_TCP_PORT=47334 MINDSDB_HTTP_PORT=47335 FLASK_PORT=5000 MINDSDB_HOST=http://127.0.0.1You can create a free MindsDB account at https://mindsdb.com/.
-
Set up Google Application Credentials: If you are using a Google-based model like
gemini, you will need to provide Google Application Credentials.a. Install the Google Cloud CLI: Follow the instructions at https://cloud.google.com/sdk/docs/install to install the
gcloudCLI.b. Log in to your Google Cloud account:
gcloud auth login
c. Create application default credentials:
gcloud auth application-default login
This will create a JSON file in your home directory (e.g.,
~/.config/gcloud/application_default_credentials.json).d. Update the
docker-compose.ymlfile to mount this file into the MindsDB container. Replace~/.config/gcloud/application_default_credentials.jsonwith the actual path to your credentials file.
-
Start the application with Docker Compose:
docker-compose up --build
-
Access the application by navigating to
http://localhost:5000in your web browser.
-
Start the MindsDB Docker container:
docker-compose up -d
-
Build the React application:
cd frontend npm run build cd ..
-
Start the Flask server:
python app.py
-
Access the application by navigating to
http://127.0.0.1:5000in your web browser.
The application is divided into several sections, each corresponding to a specific feature.
The home page serves as a dashboard with links to all the available features.
This page displays a list of all your existing knowledge bases.
To create a new knowledge base, simply enter a name for it and click the "Create" button.
To ingest data into a knowledge base, you need to provide the name of the knowledge base, select a text file to upload, and optionally add metadata in JSON format.
To query a knowledge base, you can provide a search query, a metadata filter, or both.
- Search Query: This performs a semantic search on the
contentcolumn of your knowledge base. For example, you could search for"gaming laptop". - Metadata Filter: This allows you to filter the results based on the metadata you provided during ingestion. The filter should be in a SQL
WHEREclause format. For example, to find all documents with the product "Laptop", you would enterproduct = 'Laptop'. - Combined Query: You can combine a search query and a metadata filter to perform a more specific search. For example, to find all gaming laptops, you could use the search query
"gaming laptop"and the metadata filterproduct = 'Laptop'.
To create a job, you need to provide a name for the job, the name of the knowledge base to ingest data into, a source URL for the data, and a schedule for the job to run.
To create an AI table, you need to provide a name for the table, the name of the knowledge base to use as a source, and the name of the model to use.
To create a workflow, you need to provide a name for the workflow, the name of the knowledge base to use as a source, the column you want to predict, and a list of models to use in the workflow.
To query a workflow, you need to provide the name of the workflow and a query. The query can be provided as text, a file, or from another knowledge base.
.
├── app.py # Flask backend
├── docker-compose.yml # Docker Compose configuration
├── frontend/ # React frontend
│ ├── public/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # React pages
│ │ ├── App.js
│ │ ├── index.css
│ │ └── index.js
│ ├── package.json
│ └── tailwind.config.js
├── README.md # This file
└── requirements.txt # Python dependencies