Commit Graph

37 Commits

Author SHA1 Message Date
Sarah Wooders
ec2bda4966 Refactor config + determine LLM via config.model_endpoint_type (#422)
* mark depricated API section

* CLI bug fixes for azure

* check azure before running

* Update README.md

* Update README.md

* bug fix with persona loading

* remove print

* make errors for cli flags more clear

* format

* fix imports

* fix imports

* add prints

* update lock

* update config fields

* cleanup config loading

* commit

* remove asserts

* refactor configure

* put into different functions

* add embedding default

* pass in config

* fixes

* allow overriding openai embedding endpoint

* black

* trying to patch tests (some circular import errors)

* update flags and docs

* patched support for local llms using endpoint and endpoint type passed via configs, not env vars

* missing files

* fix naming

* fix import

* fix two runtime errors

* patch ollama typo, move ollama model question pre-wrapper, modify question phrasing to include link to readthedocs, also have a default ollama model that has a tag included

* disable debug messages

* made error message for failed load more informative

* don't print dynamic linking function warning unless --debug

* updated tests to work with new cli workflow (disabled openai config test for now)

* added skips for tests when vars are missing

* update bad arg

* revise test to soft pass on empty string too

* don't run configure twice

* extend timeout (try to pass against nltk download)

* update defaults

* typo with endpoint type default

* patch runtime errors for when model is None

* catching another case of 'x in model' when model is None (preemptively)

* allow overrides to local llm related config params

* made model wrapper selection from a list vs raw input

* update test for select instead of input

* Fixed bug in endpoint when using local->openai selection, also added validation loop to manual endpoint entry

* updated error messages to be more informative with links to readthedocs

* add back gpt3.5-turbo

---------

Co-authored-by: cpacker <packercharles@gmail.com>
2023-11-14 15:58:19 -08:00
Charles Packer
2d8c9f15a2 WebSocket interface and basic server.py process (#399) 2023-11-13 17:30:24 -08:00
Charles Packer
e5add4e430 Configurable presets to support easy extension of MemGPT's function set (#420)
* partial

* working schema builder, tested that it matches the hand-written schemas

* correct another schema diff

* refactor

* basic working test

* refactored preset creation to use yaml files

* added docstring-parser

* add code for dynamic function linking in agent loading

* pretty schema diff printer

* support pulling from ~/.memgpt/functions/*.py

* clean

* allow looking for system prompts in ~/.memgpt/system_prompts

* create ~/.memgpt/system_prompts if it doesn't exist

* pull presets from ~/.memgpt/presets in addition to examples folder

* add support for loading agent configs that have additional keys

---------

Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
2023-11-13 10:43:28 -08:00
Vivian Fang
11326ec24e Remove AsyncAgent and async from cli (#400)
* Remove AsyncAgent and async from cli

Refactor agent.py memory.py

Refactor interface.py

Refactor main.py

Refactor openai_tools.py

Refactor cli/cli.py

stray asyncs

save

make legacy embeddings not use async

Refactor presets

Remove deleted function from import

* remove stray prints

* typo

* another stray print

* patch test

---------

Co-authored-by: cpacker <packercharles@gmail.com>
2023-11-09 14:51:12 -08:00
Charles Packer
267697e98e disable pretty exceptions (#367) 2023-11-07 17:27:31 -08:00
Charles Packer
a4e9240316 add gpt-4-turbo (#349)
* add gpt-4-turbo

* add in another place

* change to 3.5 16k
2023-11-06 21:53:49 -08:00
Sarah Wooders
fb29290dd4 Dependency management (#337)
* Divides dependencies into `pip install pymemgpt[legacy,local,postgres,dev]`. 
* Update docs
2023-11-06 19:45:44 -08:00
Sarah Wooders
cb12f7043b Add memgpt version command and package version (#336) 2023-11-06 13:38:50 -08:00
Hans Raaf
71d696dc9e I added a "/retry" command to retry for getting another answer. (#188)
* I added a "/retry" command to retry for getting another answer.

- Implemented to pop messages until hitting the last user message. Then
  extracting the users last message and sending it again. This will also
  work with state files and after manually popping messages.
- Updated the README to include /retry
- Update the README for "pop" with parameter and changed default to 3 as
  this will pop "function/assistant/user" which is the usual turn
  around.

* disclaimer

---------

Co-authored-by: Charles Packer <packercharles@gmail.com>
2023-11-03 21:04:37 -07:00
Hans Raaf
dcdfa04fc0 I added commands to shape the conversation: (#218)
* I added commands to shape the conversation:

`/rethink <text>` will change the internal dialog of the last assistant message.
`/rewrite <text>` will change the last answer of the assistant.

Both commands can be used to change how the conversation continues in
some pretty drastic and powerfull ways.

* remove magic numbers

* add disclaimer

---------

Co-authored-by: cpacker <packercharles@gmail.com>
2023-11-03 20:57:43 -07:00
Hans Raaf
9189a7bf26 I made dump showing more messages and added a count (the last x) (#204)
* I made dump showing more message and added a count (the last x)

There seem to be some changes about the implementation so that the
current dump message helper functions do not show a lot of useful info.

I changed it so that you can `dump 5` (last 5 messages) and that it will
print user readable output. This lets you get some more understanding about
what is going on.

As some messages are still not shown I also show the index (reverse) of the
printed message, so one can see what to "pop" to reach a special point
without geting into the drumpraw.

* black

* patch

---------

Co-authored-by: Charles Packer <packercharles@gmail.com>
2023-11-03 20:47:23 -07:00
Sarah Wooders
b9ce763fda VectorDB support (pgvector) for archival memory (#226) 2023-11-03 16:19:15 -07:00
Charles Packer
25dd225d04 strip '/' and use osp.join (Windows support) (#283)
* strip '/' and use osp.join

* grepped for MEMGPT_DIR, found more places to replace '/'

* typo

* grep pass over filesep

---------

Co-authored-by: Vivian Fang <hi@vivi.sh>
2023-11-03 13:54:29 -07:00
Charles Packer
77fd987f2a Add basic tests that are run on PR/main (#228)
* make tests dummy to make sure github workflow is fine

* black test

* strip circular import

* further dummy-fy the test

* use pexpect

* need y

* Update tests.yml

* Update tests.yml

* added prints

* sleep before decode print

* updated test to match legacy flow

* revising test where it fails

* comment out enter your message check for now, pexpect seems to be stuck on only setting the bootup message

* weird now it's not showing Bootup sequence complete?

* added debug

* handle none

* allow more time

* loosen string check

* add enter after commands

* modify saved compontent snippet

* add try again check

* more sendlines

* more excepts

* test passing locally

* Update tests.yml

* dont clearline

* add EOF catch that seems to only happen on github actiosn (ubuntu) but not macos

* more eof

* try flushing

* add strip_ui flag

* fix archival_memory_search and memory print output

* Don't use questionary for input if strip_ui

* Run black

* Always strip UI if TEST is set

* Add another flush

* expect Enter your message

* more debug prints

* one more shot at printing debug info

* stray fore color in stripped ui

* tests pass locally

* cleanup

---------

Co-authored-by: Vivian Fang <hi@vivi.sh>
2023-11-01 17:01:45 -07:00
Charles Packer
8e35c44881 fixed load loading from wrong directory (#237)
* fixed load loading from wrong directory

* typos
2023-11-01 01:28:32 -07:00
Charles Packer
f889f24643 Allow MemGPT to read/write text files + make HTTP requests (#174)
* added file read/write

* added HTTP requests

* black on utils.py
2023-11-01 01:08:44 -07:00
Vivian Fang
bcb9f7f3c7 Break out of loop if agent.step succeeds 2023-10-31 14:34:32 -07:00
Vivian Fang
d6c3f0ea0f Gracefully catch errors when running agent.step() (#216)
* Gracefully catch errors when running agent.step()

* Modify retry message
2023-10-31 12:12:07 -07:00
Charles Packer
4e440404ff patch bug (#221) 2023-10-31 11:43:38 -07:00
Sarah Wooders
23f3d42fae Refactoring CLI to use config file, connect to Llama Index data sources, and allow for multiple agents (#154)
* Migrate to `memgpt run` and `memgpt configure` 
* Add Llama index data sources via `memgpt load` 
* Save config files for defaults and agents
2023-10-30 16:47:54 -07:00
Vivian Fang
8b86fc8f8e Fix persona selection for local LLM, bump version 2023-10-30 02:10:26 -07:00
Sarah Wooders
e6683085ff reformat 2023-10-26 16:09:49 -07:00
Sarah Wooders
0ab3d098d2 reformat 2023-10-26 16:08:25 -07:00
Sarah Wooders
dcd29b8713 Merge branch 'main' into main 2023-10-26 15:05:51 -07:00
Vivian Fang
1848d716f0 patch azure support
Co-Authored-By: Rivaaj Jumna <50959956+rivms@users.noreply.github.com>
2023-10-26 14:48:07 -07:00
Sarah Wooders
942666d3b5 initial llama index data loading implementation 2023-10-26 11:44:47 -07:00
Vivian Fang
1c40d4ce36 add multiline toggle, display available commands to user 2023-10-25 15:34:51 -07:00
Vivian Fang
bc81cdcef4 Revert "Revert "cleanup""
This reverts commit 6cd2a0049b02643ef800f7c2ddb45a1f4bd5babf.
2023-10-25 12:42:35 -07:00
Vivian Fang
8c3409cf02 Revert "cleanup"
This reverts commit 85d9fba811f237fc0c625e920d4ee5995a9308f6, reversing
changes made to a7e06d0acc1b69b311fb16e386c4867337fe76f8.
2023-10-25 01:02:43 -07:00
Charles Packer
0a202e87b8 Merge pull request #116 from cpacker/dolphin-mistral
add wrapper for dolphin mistral + inner monologue wrapper
2023-10-25 00:55:43 -07:00
Vivian Fang
1cb89c4f47 fix memgpt_dir circular import 2023-10-24 13:28:17 -07:00
Charles Packer
e6a0a746bb inner monologue airo parser 2023-10-24 01:39:56 -07:00
Vivian Fang
aba4057fae include cli hotfix changes 2023-10-23 17:53:07 -07:00
Vivian Fang
6e4bcb96ba make flags use underscores (legacy) 2023-10-23 17:42:44 -07:00
Vivian Fang
82d8fa5179 support custom profile/persona folder in .memgpt 2023-10-23 17:39:05 -07:00
Sarah Wooders
62cb3eda60 ensure all temporary directories are created in .memgpt folder 2023-10-23 15:07:39 -07:00
Sarah Wooders
fa27d72029 working poetry package 2023-10-23 14:39:43 -07:00