Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Replace all occurrences of old docs links #121

Closed
danielchalef opened this issue Jul 4, 2023 · 1 comment
Closed

Sweep: Replace all occurrences of old docs links #121

danielchalef opened this issue Jul 4, 2023 · 1 comment
Labels
sweep Assigns Sweep to an issue or pull request.

Comments

@danielchalef
Copy link
Member

Replace all occurrences of the old docs link with the new one

Replace: https://getzep.github.io/
With: https://docs.getzep.com/

@sweep-ai sweep-ai bot added the sweep Assigns Sweep to an issue or pull request. label Jul 4, 2023
@sweep-ai
Copy link
Contributor

sweep-ai bot commented Jul 4, 2023

Hey @danielchalef,

I've started working on this issue. The plan is to search for all occurrences of the old docs link "https://getzep.github.io/" in the entire codebase and replace them with the new link "https://docs.getzep.com/".

I'll be making changes in the following files:

  • README.md
  • docs/docs.go
  • docs/swagger.json

Give me a minute!

Best,
Sweep bot

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description.

zep/docs/docs.go

Lines 1 to 362 in fc056eb

// Code generated by swaggo/swag. DO NOT EDIT.
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/api/v1/sessions/{sessionId}/memory": {
"get": {
"description": "get memory by session id",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Returns a memory (latest summary and list of messages) for a given session",
"parameters": [
{
"type": "string",
"description": "Session ID",
"name": "session_id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Last N messages. Overrides memory_window configuration",
"name": "lastn",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Memory"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.APIError"
}
}
}
},
"post": {
"description": "add memory messages by session id",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Add memory messages to a given session",
"parameters": [
{
"type": "string",
"description": "Session ID",
"name": "session_id",
"in": "path",
"required": true
},
{
"description": "Memory messages",
"name": "memoryMessages",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.Memory"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.APIError"
}
}
}
},
"delete": {
"description": "delete memory messages by session id",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Delete memory messages for a given session",
"parameters": [
{
"type": "string",
"description": "Session ID",
"name": "session_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.APIError"
}
}
}
}
},
"/api/v1/sessions/{sessionId}/search": {
"post": {
"description": "search memory messages by session id and query",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"search"
],
"summary": "Search memory messages for a given session",
"parameters": [
{
"type": "string",
"description": "Session ID",
"name": "session_id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Limit the number of results returned",
"name": "limit",
"in": "query"
},
{
"description": "Search query",
"name": "searchPayload",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.MemorySearchPayload"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.MemorySearchResult"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.APIError"
}
}
}
}
}
},
"definitions": {
"models.Memory": {
"type": "object",
"properties": {
"messages": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Message"
}
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"summary": {
"$ref": "#/definitions/models.Summary"
}
}
},
"models.MemorySearchPayload": {
"type": "object",
"properties": {
"metadata": {
"type": "object",
"additionalProperties": true
},
"text": {
"type": "string"
}
}
},
"models.MemorySearchResult": {
"type": "object",
"properties": {
"dist": {
"type": "number"
},
"message": {
"$ref": "#/definitions/models.Message"
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"summary": {
"description": "reserved for future use",
"allOf": [
{
"$ref": "#/definitions/models.Summary"
}
]
}
}
},
"models.Message": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"role": {
"type": "string"
},
"token_count": {
"type": "integer"
},
"uuid": {
"type": "string"
}
}
},
"models.Summary": {
"type": "object",
"properties": {
"content": {
"type": "string"
},
"created_at": {
"type": "string"
},
"metadata": {
"type": "object",
"additionalProperties": true
},
"recent_message_uuid": {
"description": "The most recent message UUID that was used to generate this summary",
"type": "string"
},
"token_count": {
"type": "integer"
},
"uuid": {
"type": "string"
}
}
},
"server.APIError": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "",
Host: "",
BasePath: "/api/v1",
Schemes: []string{"http", "https"},
Title: "Zep REST API",
Description: "",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}

zep/README.md

Lines 1 to 74 in fc056eb

[![](https://dcbadge.vercel.app/api/server/W8Kw6bsgXQ?style=flat)](https://discord.gg/W8Kw6bsgXQ)
![GitHub release (latest by date)](https://img.shields.io/github/v/release/getzep/zep)
[![Build/Test](https://github.com/getzep/zep/actions/workflows/build-test.yml/badge.svg)](https://github.com/getzep/zep/actions/workflows/build-test.yml) [![Docker](https://github.com/getzep/zep/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/getzep/zep/actions/workflows/docker-publish.yml) [![golangci-lint](https://github.com/getzep/zep/actions/workflows/golangci-lint.yml/badge.svg)](https://github.com/getzep/zep/actions/workflows/golangci-lint.yml)
[![License: Apache](https://img.shields.io/badge/License-Apache-blue.svg)](https://img.shields.io/github/license/getzep/zep)
# Zep: A long-term memory store for LLM applications
Zep stores, summarizes, embeds, indexes, and enriches LLM app / chatbot histories, and exposes them via simple, low-latency APIs. Zep allows developers to focus on developing their AI apps, rather than on building memory persistence, search, and enrichment infrastructure.
Zep's Extractor model is easily extensible, with a simple, clean interface available to build new enrichment functionality, such as summarizers, entity extractors, embedders, and more.
**Key Features:**
- **Fast!** Zep's async extractors operate independently of the your chat loop, ensuring a snappy user experience.
- **Memory operations** like addMemory(), getMemory(), searchMemory(), deleteMemory() with soft & hard deletes
- **Long-term memory persistence**, with access to historical messages irrespective of your summarization strategy.
- **Auto-summarization** of memory messages based on a configurable message window. A series of summaries are stored, providing flexibility for future summarization strategies.
- Hybrid **Vector search** over memories and metadata, with messages automatically embedded on creation.
- **Entity Extractor** that extracts named entities and intents from messages and stores them in the message metadata.
- **Auto-token counting** of memories and summaries, allowing finer-grained control over prompt assembly.
- **OpenAI & Azure OpenAI Service** models for your applications
- **Python** and **JavaScript** SDKs.
- **Langchain** `memory` and `retriever` support.
## Quick Start
[![Deploy to Render](https://render.com/images/deploy-to-render-button.svg)](https://render.com/deploy?repo=https://github.com/getzep/zep)
Read the docs: [https://getzep.github.io](https://getzep.github.io/)
1. Clone this repo
```bash
git clone https://github.com/getzep/zep.git
```
2. Add your OpenAI API key to a `.env` file in the root of the repo:
```bash
ZEP_OPENAI_API_KEY=<your key here>
```
3. Start the Zep server:
```bash
docker-compose up
```
This will start a Zep server on port 8000, and a Postgres database on port 5432.
4. Access Zep via the Python or Javascript SDKs:
**Python**
```python
async with ZepClient(base_url) as client:
role = "user"
content = "who was the first man to go to space?"
message = Message(role=role, content=content)
memory = Memory()
memory.messages = [message]
# Add a memory
result = await client.aadd_memory(session_id, memory)
```
See [zep-python](https://github.com/getzep/zep-python) for installation and use docs.
**Javascript**
```Javascript
// Add memory
const role = "user";
const content = "I'm looking to plan a trip to Iceland. Can you help me?"
const message = new Message({ role, content });
const memory = new Memory();
memory.messages = [message];
const result = await client.addMemoryAsync(session_id, memory);
...
```
## Zep Documentation
Server installation and SDK usage documentation is available here: [https://getzep.github.io](https://getzep.github.io/)
## Acknowledgements
h/t to the [Motorhead](https://github.com/getmetal/motorhead) and [Langchain](https://github.com/hwchase17/langchain) projects for inspiration.

zep/go.mod

Lines 1 to 70 in fc056eb

module github.com/getzep/zep
go 1.20
require (
github.com/avast/retry-go/v4 v4.3.4
github.com/chi-middleware/logrus-logger v0.2.0
github.com/go-chi/chi/v5 v5.0.8
github.com/go-chi/jwtauth/v5 v5.1.0
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/google/uuid v1.3.0
github.com/jinzhu/copier v0.3.5
github.com/joho/godotenv v1.5.1
github.com/oiime/logrusbun v0.1.1
github.com/pgvector/pgvector-go v0.1.1
github.com/pkoukk/tiktoken-go v0.1.1
github.com/sashabaranov/go-openai v1.11.3
github.com/sirupsen/logrus v1.9.0
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.15.0
github.com/stretchr/testify v1.8.4
github.com/swaggo/swag v1.16.1
github.com/uptrace/bun v1.1.12
github.com/uptrace/bun/dialect/pgdialect v1.1.12
github.com/uptrace/bun/driver/pgdriver v1.1.12
)
require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/dlclark/regexp2 v1.9.0 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/spec v0.20.9 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/lestrrat-go/blackmagic v1.0.1 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.4 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.11 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.0 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
github.com/tmthrgd/go-hex v0.0.0-20190904060850-447a3041c3bc // indirect
github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect
github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/tools v0.8.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
mellium.im/sasl v0.3.1 // indirect
)

zep/Makefile

Lines 1 to 83 in fc056eb

GOCMD=go
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=zep
VERSION?=0.0.0
SERVICE_PORT?=
DOCKER_REGISTRY?=
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true
BUILD_VAR=
PACKAGE := github.com/getzep/zep/cmd
VERSION := $(shell git describe --tags --always --abbrev=0 --match='v[0-9]*.[0-9]*.[0-9]*' 2> /dev/null | sed 's/^.//')
COMMIT_HASH := $(shell git rev-parse --short HEAD)
BUILD_TIMESTAMP := $(shell date '+%Y-%m-%dT%H:%M:%S%z')
LDFLAGS = -X '${PACKAGE}/zep.Version=${VERSION}' \
-X '${PACKAGE}/zep.CommitHash=${COMMIT_HASH}' \
-X '${PACKAGE}/zep.BuildTime=${BUILD_TIMESTAMP}'
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
CYAN := $(shell tput -Txterm setaf 6)
RESET := $(shell tput -Txterm sgr0)
.PHONY: all test build
all: test build
## Build:
build: ## Build your project
mkdir -p ./out/bin
$(BUILD_VAR) $(GOCMD) build -ldflags="${LDFLAGS}" -o ./out/bin/$(BINARY_NAME)
clean: ## Remove build related file
rm -f $(BINARY_NAME)
rm -f ./junit-report.xml checkstyle-report.xml ./coverage.xml ./profile.cov yamllint-checkstyle.xml
## Test:
## don't parallelize testing as there are sideefects to some DB tests
test: ## Run project tests
$(GOTEST) -tags=testutils -race -p 1 ./...
coverage: ## Run the tests of the project and export the coverage
$(GOTEST) -cover -covermode=count -coverprofile=profile.cov ./...
$(GOCMD) tool cover -func profile.cov
ifeq ($(EXPORT_RESULT), true)
GO111MODULE=off go get -u github.com/AlekSi/gocov-xml
GO111MODULE=off go get -u github.com/axw/gocov/gocov
gocov convert profile.cov | gocov-xml > coverage.xml
endif
## Generate swagger docs:
swagger:
swag i -g pkg/server/routes.go -o docs
swag fmt
## Lint:
lint:
golangci-lint run --deadline=90s --sort-results -c golangci.yaml
## Docker:
docker-build: ## Use the dockerfile to build the container
DOCKER_BUILDKIT=1 docker build --rm --tag $(BINARY_NAME) .
docker-release: ## Release the container with tag latest and version
docker tag $(BINARY_NAME) $(DOCKER_REGISTRY)$(BINARY_NAME):latest
docker tag $(BINARY_NAME) $(DOCKER_REGISTRY)$(BINARY_NAME):$(VERSION)
# Push the docker images
docker push $(DOCKER_REGISTRY)$(BINARY_NAME):latest
docker push $(DOCKER_REGISTRY)$(BINARY_NAME):$(VERSION)
## Help:
help: ## Show this help.
@echo ''
@echo 'Usage:'
@echo ' ${YELLOW}make${RESET} ${GREEN}<target>${RESET}'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} { \
if (/^[a-zA-Z_-]+:.*?##.*$$/) {printf " ${YELLOW}%-20s${GREEN}%s${RESET}\n", $$1, $$2} \
else if (/^## .*$$/) {printf " ${CYAN}%s${RESET}\n", substr($$1,4)} \

zep/docs/swagger.json

Lines 1 to 65 in fc056eb

{
"schemes": [
"http",
"https"
],
"swagger": "2.0",
"info": {
"title": "Zep REST API",
"contact": {},
"license": {
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
}
},
"basePath": "/api/v1",
"paths": {
"/api/v1/sessions/{sessionId}/memory": {
"get": {
"description": "get memory by session id",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"memory"
],
"summary": "Returns a memory (latest summary and list of messages) for a given session",
"parameters": [
{
"type": "string",
"description": "Session ID",
"name": "session_id",
"in": "path",
"required": true
},
{
"type": "integer",
"description": "Last N messages. Overrides memory_window configuration",
"name": "lastn",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Memory"
}
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/server.APIError"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/server.APIError"
}


I'm a bot that handles simple bugs and feature requests but I might make mistakes. Please be kind!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant