Skip to content

jonnyquan/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

Releases

No releases published

Packages

No packages published

Languages

  • Go 40.6%
  • CSS 27.8%
  • Rich Text Format 14.3%
  • Python 7.8%
  • HTML 7.1%
  • JavaScript 1.7%
  • Other 0.7%