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.
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.
YouTube Demo : https://www.youtube.com/watch?v=K-cufogVz0Q
git clone github.com/pheonix-coder/kb-manager.git
cd mindsdb-kb-managerSetup 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-textRun 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" };
# Create virtual environment uv venv source .venv/bin/activate # Install dependencies uv pip install -r requirements.txt
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?"
- β 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