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

gptscript-ai/knowledge

This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Folders and files

NameName
Last commit message
Last commit date
Aug 6, 2024
Jul 30, 2024
Aug 29, 2024
Sep 19, 2024
Oct 9, 2024
Aug 12, 2024
Jun 13, 2024
May 13, 2024
Jul 30, 2024
Apr 15, 2024
May 3, 2024
Apr 10, 2024
Aug 20, 2024
Aug 27, 2024
Sep 11, 2024
Oct 8, 2024
Oct 8, 2024
Sep 11, 2024
Jun 12, 2024
Jul 17, 2024
Sep 4, 2024
Oct 8, 2024

Repository files navigation

GPTScript Knowledge Tool

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