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

WebUI #186

Merged
merged 41 commits into from
Sep 17, 2023
Merged

WebUI #186

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
c54e494
with vite
danielchalef Sep 6, 2023
8b61f02
snapshot
danielchalef Sep 7, 2023
093f2d7
checkpoint
danielchalef Sep 9, 2023
5974026
htmx sidebar nav
danielchalef Sep 9, 2023
31ab4e4
checkpoint sessions
danielchalef Sep 11, 2023
78230d0
checkpoint
danielchalef Sep 11, 2023
95d7a3a
more test data
danielchalef Sep 12, 2023
7f99886
checkpoint
danielchalef Sep 12, 2023
46c9df9
checkpoint
danielchalef Sep 12, 2023
da3487b
checkpoint
danielchalef Sep 13, 2023
ad05b93
sessiond etails
danielchalef Sep 13, 2023
9742a18
chat history + metadata rendering
danielchalef Sep 13, 2023
fd64fe9
message view + pager
danielchalef Sep 13, 2023
5c89092
checkpoint
danielchalef Sep 14, 2023
b6c0d93
checkpoint
danielchalef Sep 14, 2023
a0721c4
checkpoint
danielchalef Sep 14, 2023
55dcef6
add summaries
danielchalef Sep 14, 2023
27e65c7
user countAll
danielchalef Sep 14, 2023
a6b768f
session counts
danielchalef Sep 14, 2023
15bcd80
add settings
danielchalef Sep 14, 2023
30f4c33
new middlewares, 404 page
danielchalef Sep 15, 2023
b194a2d
index
danielchalef Sep 15, 2023
b8f7310
session.CountAll + polish
danielchalef Sep 15, 2023
2e453fc
nav menu
danielchalef Sep 15, 2023
a4295c6
more nav work; no data cards
danielchalef Sep 15, 2023
5107107
dashboard
danielchalef Sep 15, 2023
8cb940e
config control over webui
danielchalef Sep 15, 2023
8dcc759
tests passing; update deps
danielchalef Sep 16, 2023
d47ddd8
table sorting
danielchalef Sep 17, 2023
676b8c9
user session filtering
danielchalef Sep 17, 2023
afb5e3c
user table
danielchalef Sep 17, 2023
d11e774
message table
danielchalef Sep 17, 2023
ce0c23f
lint
danielchalef Sep 17, 2023
a5847f4
file cleanup
danielchalef Sep 17, 2023
562b562
development mode in contributing
danielchalef Sep 17, 2023
c1b1447
render disable webui
danielchalef Sep 17, 2023
7cdae4c
log webui status
danielchalef Sep 17, 2023
6624b08
lint issue
danielchalef Sep 17, 2023
e1689db
clean nlp server CI envs
danielchalef Sep 17, 2023
e7ec94a
fix embedder test
danielchalef Sep 17, 2023
8f5313b
fix TestMemorySearch
danielchalef Sep 17, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ jobs:
--health-retries 5
nlp:
image: ghcr.io/getzep/zep-nlp-server:latest
env:
ENABLE_EMBEDDINGS: true
options: >-
--health-cmd "timeout 10s bash -c ':> /dev/tcp/127.0.0.1/5557' || exit 1"
--health-interval 10s
Expand Down
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ Thank you for your interest in contributing to Zep! We appreciate your efforts a
git checkout -b feature/your-feature-name
```

### Setting "Development" Mode
"Development" mode forces Zep's log level to "debug" and disables caching of the web UI. This is useful when developing Zep locally.

To enable "development" mode, set the `ZEP_DEVELOPMENT` environment variable to `true`:

```
export ZEP_DEVELOPMENT=true
```

or modify your `.env` file accordingly.


### Building Zep

Follow these steps to build Zep locally:
Expand Down
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ swagger:
lint:
golangci-lint run --deadline=90s --sort-results -c golangci.yaml

## Go Watch for web development
## https://github.com/mitranim/gow
gow:
gow -e=go,mod,html,css -i=node_modules run .

# Build web assets
web:
cd pkg/web && npx tailwindcss -i static/input.css -o static/output.css

## Docker:
docker-build: ## Use the dockerfile to build the container
DOCKER_BUILDKIT=1 docker build --rm --tag $(BINARY_NAME) .
Expand Down
2 changes: 1 addition & 1 deletion cmd/zep/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func run() {

handleCLIOptions(cfg)

log.Infof("Starting zep server version %s", config.VersionString)
log.Infof("Starting Zep server version %s", config.VersionString)

config.SetLogLevel(cfg)
appState := NewAppState(cfg)
Expand Down
6 changes: 6 additions & 0 deletions config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ store:
postgres:
dsn: "postgres://postgres:postgres@localhost:5432/?sslmode=disable"
server:
# Specify the host to listen on. Defaults to 0.0.0.0
host: 0.0.0.0
port: 8000
# Is the Web UI enabled?
# Warning: The Web UI is not secured by authentication and should not be enabled if
# Zep is exposed to the public internet.
web_enabled: true
auth:
# Set to true to enable authentication
required: false
Expand Down
6 changes: 6 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var EnvVars = map[string]string{
"llm.anthropic_api_key": "ZEP_ANTHROPIC_API_KEY",
"llm.openai_api_key": "ZEP_OPENAI_API_KEY",
"auth.secret": "ZEP_AUTH_SECRET",
"development": "ZEP_DEVELOPMENT",
}

// LoadConfig loads the config file and ENV variables into a Config struct
Expand Down Expand Up @@ -81,6 +82,11 @@ func bindEnv(key string, envVar string) {

// SetLogLevel sets the log level based on the config file. Defaults to INFO if not set or invalid
func SetLogLevel(cfg *Config) {
if cfg.Development {
internal.SetLogLevel(logrus.DebugLevel)
log.Info("Development mode. Setting log level to: ", logrus.DebugLevel)
return
}
level, err := logrus.ParseLevel(cfg.Log.Level)
if err != nil {
level = logrus.InfoLevel
Expand Down
23 changes: 13 additions & 10 deletions config/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ package config
// Config holds the configuration of the application
// Use cmd.NewConfig to create a new instance
type Config struct {
LLM LLM `mapstructure:"llm"`
NLP NLP `mapstructure:"nlp"`
Memory MemoryConfig `mapstructure:"memory"`
Extractors ExtractorsConfig `mapstructure:"extractors"`
Store StoreConfig `mapstructure:"store"`
Server ServerConfig `mapstructure:"server"`
Log LogConfig `mapstructure:"log"`
Auth AuthConfig `mapstructure:"auth"`
DataConfig DataConfig `mapstructure:"data"`
LLM LLM `mapstructure:"llm"`
NLP NLP `mapstructure:"nlp"`
Memory MemoryConfig `mapstructure:"memory"`
Extractors ExtractorsConfig `mapstructure:"extractors"`
Store StoreConfig `mapstructure:"store"`
Server ServerConfig `mapstructure:"server"`
Log LogConfig `mapstructure:"log"`
Auth AuthConfig `mapstructure:"auth"`
DataConfig DataConfig `mapstructure:"data"`
Development bool `mapstructure:"development"`
}

type StoreConfig struct {
Expand Down Expand Up @@ -48,7 +49,9 @@ type PostgresConfig struct {
}

type ServerConfig struct {
Port int `mapstructure:"port"`
Host string `mapstructure:"host"`
Port int `mapstructure:"port"`
WebEnabled bool `mapstructure:"web_enabled"`
}

type LogConfig struct {
Expand Down
128 changes: 0 additions & 128 deletions docs.http

This file was deleted.

29 changes: 0 additions & 29 deletions fly.toml

This file was deleted.

31 changes: 20 additions & 11 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,39 @@ require (
github.com/chi-middleware/logrus-logger v0.2.0
github.com/go-chi/chi/v5 v5.0.10
github.com/go-chi/jwtauth/v5 v5.1.1
github.com/go-playground/validator/v10 v10.15.1
github.com/go-playground/validator/v10 v10.15.4
github.com/golang-jwt/jwt/v5 v5.0.0
github.com/google/uuid v1.3.1
github.com/jinzhu/copier v0.4.0
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.5
github.com/pkoukk/tiktoken-go v0.1.6
github.com/sirupsen/logrus v1.9.3
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.16.0
github.com/stretchr/testify v1.8.4
github.com/swaggo/swag/v2 v2.0.0-rc3
github.com/uptrace/bun v1.1.14
github.com/uptrace/bun/dialect/pgdialect v1.1.14
github.com/uptrace/bun/driver/pgdriver v1.1.14
github.com/uptrace/bun v1.1.15
github.com/uptrace/bun/dialect/pgdialect v1.1.15
github.com/uptrace/bun/driver/pgdriver v1.1.15
gonum.org/v1/gonum v0.14.0
)

require (
github.com/Masterminds/sprig/v3 v3.2.3
github.com/alecthomas/chroma v0.10.0
github.com/hashicorp/go-retryablehttp v0.7.4
github.com/tmc/langchaingo v0.0.0-20230827001633-72b07a1c060f
github.com/uptrace/bun/dbfixture v1.1.14
github.com/uptrace/bun/extra/bundebug v1.1.14
github.com/tmc/langchaingo v0.0.0-20230910230029-9c8845b2b019
github.com/uptrace/bun/dbfixture v1.1.15
github.com/uptrace/bun/extra/bundebug v1.1.15
gopkg.in/yaml.v3 v3.0.1
)

require (
github.com/KyleBanks/depth v1.2.1 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.2.0 // 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.10.0 // indirect
Expand All @@ -54,6 +58,8 @@ require (
github.com/goccy/go-json v0.10.2 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.3 // indirect
github.com/imdario/mergo v0.3.11 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jackc/pgx/v5 v5.4.2 // indirect
github.com/jinzhu/inflection v1.0.0 // indirect
Expand All @@ -69,11 +75,14 @@ require (
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/shopspring/decimal v1.2.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
Expand All @@ -83,10 +92,10 @@ require (
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.10.0 // indirect
golang.org/x/crypto v0.13.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/sys v0.9.0 // indirect
golang.org/x/text v0.10.0 // indirect
golang.org/x/sys v0.12.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/tools v0.8.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
Loading