Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

pheonix-coder/kb-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

2 Commits

Repository files navigation

🧠 MindsDB KB Manager

A simple and extensible project to manage MindsDB Knowledge Bases β€” create, ingest, query, summarize, and interact via agents. Includes a CLI and optional terminal-style UI demo.


πŸ“Œ Overview

This project streamlines core operations on MindsDB Knowledge Bases:

  • πŸ“ Create KBs with embedding and metadata configurations
  • πŸ“Š Ingest CSV/text data into KBs
  • πŸ” Query KBs using natural language, with or without metadata filters
  • 🧠 Summarize KB content via GPT-3.5
  • πŸ€– Create AI agents connected to specific KBs
  • πŸ’¬ Chat with agents using natural questions

MindsDB acts as the orchestration engine for vector indexing, OpenAI integration, and agent execution.



βš™οΈ Setup

0. Clone the Repository

git clone github.com/pheonix-coder/kb-manager.git
cd mindsdb-kb-manager

1. MindsDB and Ollama Setup

Setup MindsDB and Ollama with Docker (docker-compose.yml is provided):

docker-compose up -d

Install nomic-embed-text or any other embedding model in Ollama container:

docker exec ollama ollama pull nomic-embed-text

2. MindsDB SQL Prerequisites

Run these in the MindsDB SQL editor:

-- OpenAI Engine
CREATE ML_ENGINE openai_engine 
FROM openai
USING
 openai_api_key = "your_openai_api_key";
-- Summarizer model
CREATE MODEL kb_summarizer
PREDICT summary
USING
 engine = 'openai_engine',
 model_name = 'gpt-3.5-turbo',
 prompt_template = 'Provide a concise summary of the following knowledge base content and highlight the main insights:\n\n{{kb_content}}\n\nSummary:';
-- Vector backend
CREATE DATABASE pvec
WITH
 ENGINE = 'pgvector',
 PARAMETERS = {
 "host": "pgvector",
 "port": 5432,
 "database": "ai",
 "user": "ai",
 "password": "ai",
 "distance": "cosine"
 };

2. Python Setup

# Create virtual environment
uv venv
source .venv/bin/activate
# Install dependencies
uv pip install -r requirements.txt

πŸ§ͺ Usage

CLI

python main.py --help

Example:

# Create a new KB
python main.py init-kb --name quotes_kb --model-name nomic-embed-text ...
# Ingest data
python main.py ingest-kb --kb-name quotes_kb --file-path "data/quotes.csv"
# Query KB
python main.py query-kb --kb-name quotes_kb --query "inspiration" --relevance 0.3
# Summarize KB
python main.py summarize-kb --kb-name quotes_kb --query "life insights"
# Create & chat with agent
python main.py create-agent --agent-name quote_bot --knowledge-bases quotes_kb ...
python main.py chat-agent --agent-name quote_bot --question "What did Einstein say about logic?"

πŸ’‘ Use Cases

  • βœ… Quickly prototype KBs and agents without building full UI
  • βœ… Run automated ingestion and querying pipelines for AI use cases
  • βœ… Summarize large KBs into digestible formats
  • βœ… Validate MindsDB functionality in real-world agent workflows

🧠 Powered By

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /