Skip to main content

Knowledge loader for wish

Project description

wish-knowledge-loader

A CLI tool for loading knowledge bases into wish.

Overview

wish-knowledge-loader is a command-line tool that clones GitHub repositories, extracts content from specified files, and stores them in a vector database for use with wish.

Installation

# Install from the repository
cd wish-knowledge-loader
uv sync --dev

cp .env.example .env
vim .env  # Set the OpenAI API key

Usage

# Basic usage
wish-knowledge-loader --repo-url https://github.com/username/repo --glob "**/*.md" --title "Knowledge Base Title"

Options

  • --repo-url: GitHub repository URL to clone
  • --glob: Glob pattern for files to include (e.g., "**/*.md" for all Markdown files)
  • --title: Title for the knowledge base

Environment Variables

The following environment variables can be set in a .env file:

  • OPENAI_API_KEY: Your OpenAI API key (required)
  • OPENAI_MODEL: OpenAI embedding model to use (default: "text-embedding-3-small")
  • WISH_HOME: Path to the wish home directory (default: "~/.wish")

Development

# Run tests
uv run pytest

# Run linting
uv run ruff check .

Verifying Search Functionality

After creating a knowledge base, you can verify the search functionality using the provided script:

# Set the OpenAI API key
export OPENAI_API_KEY="your-api-key"

# Run the search script
python scripts/search_knowledge.py "Knowledge Base Title" "your search query"

The script will:

  1. Load the vector store for the specified knowledge base
  2. Search for documents similar to your query
  3. Display the top 4 results with their content and metadata

You can adjust the number of results by modifying the k parameter in the script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wish_knowledge_loader-0.3.2.tar.gz (35.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wish_knowledge_loader-0.3.2-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file wish_knowledge_loader-0.3.2.tar.gz.

File metadata

  • Download URL: wish_knowledge_loader-0.3.2.tar.gz
  • Upload date:
  • Size: 35.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.2

File hashes

Hashes for wish_knowledge_loader-0.3.2.tar.gz
Algorithm Hash digest
SHA256 6c87f1f6096e8afe8aa6ddacb1d4ed315d71922f8fdb18405d767d2894f3f7de
MD5 d47543c28d9a74cdf557667e0880a9e1
BLAKE2b-256 15ed13710b6cdfddfeaecd29e84dde972f27d38580b08f5ea70041c59551baca

See more details on using hashes here.

File details

Details for the file wish_knowledge_loader-0.3.2-py3-none-any.whl.

File metadata

File hashes

Hashes for wish_knowledge_loader-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2fe38972176e87871f09525d1a7f6831dae6afceb1c9653a0f984cecd4b979a3
MD5 4e0bdd3d15b3dcfde7de46866d0984fa
BLAKE2b-256 98281ea809e418046ced6abc453dda032e3ef8dbafa9852974b6100315cb7f1f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page