Commit Graph

40 Commits

Author SHA1 Message Date
Sarah Wooders
dd5a110be4
Removing dead code + legacy commands (#536) 2023-11-30 13:37:11 -08:00
Charles Packer
bc0c1e4a37
Remove openai package and migrate to requests (#534) 2023-11-30 13:00:13 -08:00
Sarah Wooders
da081667d6
Add warning if no data sources loaded on /attach command (#513)
* minor fix

* add warn instead of error for no data sources
2023-11-27 13:00:23 -08:00
Sarah Wooders
28514da5df
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
7a2fe850ed
WebSocket interface and basic server.py process (#399) 2023-11-13 17:30:24 -08:00
Charles Packer
b789549d02
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
e5c0e1276b
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
b6dfc5d833
disable pretty exceptions (#367) 2023-11-07 17:27:31 -08:00
Charles Packer
aa94ce9515
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
b1c5566168
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
c75224206e
Add memgpt version command and package version (#336) 2023-11-06 13:38:50 -08:00
Hans Raaf
26ba63cbf0
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
3296af711d
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
0046ad9606
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
2492db6b59
VectorDB support (pgvector) for archival memory (#226) 2023-11-03 16:19:15 -07:00
Charles Packer
4c80222e0c
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
270913218a
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
a269ffd425
fixed load loading from wrong directory (#237)
* fixed load loading from wrong directory

* typos
2023-11-01 01:28:32 -07:00
Charles Packer
543db5a8f8
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
317058874b Break out of loop if agent.step succeeds 2023-10-31 14:34:32 -07:00
Vivian Fang
4e6af2f3e3
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
0a075f448b
patch bug (#221) 2023-10-31 11:43:38 -07:00
Sarah Wooders
b7f9560bef
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
ba83873922 Fix persona selection for local LLM, bump version 2023-10-30 02:10:26 -07:00
Sarah Wooders
9a54d12778 reformat 2023-10-26 16:09:49 -07:00
Sarah Wooders
0f251af761 reformat 2023-10-26 16:08:25 -07:00
Sarah Wooders
700fd9fb4d
Merge branch 'main' into main 2023-10-26 15:05:51 -07:00
Vivian Fang
6468c4d6d0 patch azure support
Co-Authored-By: Rivaaj Jumna <50959956+rivms@users.noreply.github.com>
2023-10-26 14:48:07 -07:00
Sarah Wooders
5dbc11f835 initial llama index data loading implementation 2023-10-26 11:44:47 -07:00
Vivian Fang
9690527cd8 add multiline toggle, display available commands to user 2023-10-25 15:34:51 -07:00
Vivian Fang
f48c81d9a0 Revert "Revert "cleanup""
This reverts commit 6cd2a0049b.
2023-10-25 12:42:35 -07:00
Vivian Fang
6cd2a0049b Revert "cleanup"
This reverts commit 85d9fba811, reversing
changes made to a7e06d0acc.
2023-10-25 01:02:43 -07:00
Charles Packer
ccd9b5fa37
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
30ced8d5c8 fix memgpt_dir circular import 2023-10-24 13:28:17 -07:00
Charles Packer
cf52c52500 inner monologue airo parser 2023-10-24 01:39:56 -07:00
Vivian Fang
816947c976 include cli hotfix changes 2023-10-23 17:53:07 -07:00
Vivian Fang
7b177e53bf make flags use underscores (legacy) 2023-10-23 17:42:44 -07:00
Vivian Fang
abc5e9f400 support custom profile/persona folder in .memgpt 2023-10-23 17:39:05 -07:00
Sarah Wooders
08b0003ff9 ensure all temporary directories are created in .memgpt folder 2023-10-23 15:07:39 -07:00
Sarah Wooders
e132a291a0 working poetry package 2023-10-23 14:39:43 -07:00