Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

gptscript-ai/knowledge

Repository files navigation

GPTScript Knowledge Tool

**Archival Notice: ** The knowledge tool is continuing as a part of otto8 over here: otto8-ai/tools

Standalone Knowledge Tool to be used with GPTScript and GPTStudio

gptscript-ai.github.io/knowledge

Build

Requires Go 1.22+

make build

Run

The knowledge tool can run in two modes: server and client, where client can be standalone or referring to a remote server.

You can find a full gptscript-generated documentation in the CLI documentation.

Client - Standalone

knowledge create-dataset foobar
knowledge ingest -d foobar README.md
knowledge retrieve -d foobar "Which filetypes are supported?"
knowledge delete-dataset foobar

Server & Client - Server Mode

WARNING The server mode is not fully implemented and currently lacking some features. You're well advised to use the standalone client mode.

Server
knowledge server
export KNOW_SERVER_URL=http://localhost:8000/v1
knowledge create-dataset foobar
knowledge ingest -d foobar README.md
knowledge retrieve -d foobar "Which filetypes are supported?"
knowledge delete-dataset foobar

Supported File Types

  • .pdf
  • .html
  • .md
  • .txt
  • .docx
  • .odt
  • .rtf
  • .csv
  • .ipynb
  • .json

OpenAPI / Swagger

The API is documented using OpenAPI 2.0 (Swagger), automatically generated using swaggo/swag (make openapi).

GPTScript Examples

Note: The examples in the examples/ directory expect the knowledge binary to be in your $PATH.

Run

gptscript examples/client.gpt

Choosing an Embedding Model

! Important !

The same embedding model must be used for both ingestion and retrieval.

Checkout the MTEB Leaderboard: https://huggingface.co/spaces/mteb/leaderboard