Commit Graph

58 Commits

Author SHA1 Message Date
Charles Packer
1af40860fd feat: Properly handle old config migration/recreation on memgpt run (#804) 2024-01-11 20:23:20 -08:00
Max Blackmer
10865a4cb8 Merge branch 'main' into feature/global-logging
# Conflicts:
#	memgpt/config.py
2024-01-11 11:12:03 -05:00
Max Blackmer
abf4fb03bd [cpacker#319] fixed error with config with improper include in config.py
added test_log.py. for testing global logging in log.py
2024-01-11 10:44:20 -05:00
Sarah Wooders
841d47c462 Remove usage of agent_config from agent.py 2024-01-09 11:22:39 -08:00
Sarah Wooders
54fa07da7a refactor!: Migrate users + agent information into storage connectors (#785)
Co-authored-by: cpacker <packercharles@gmail.com>
2024-01-08 15:59:49 -08:00
Max Blackmer
72d184a5e3 Merge branch 'feature/global-logging' of github.com:agiletechnologist/MemGPT into feature/global-logging
Removed Logging from configurations and migrated to constants.py
Modified log.py to configure using constants to configure logging

 Conflicts:
      memgpt/config.py resolved
2024-01-05 18:11:17 -05:00
Charles Packer
b487366f21 Merge branch 'main' into cherry-pick-storage-refactor 2023-12-30 21:38:58 -08:00
BabellDev
b2e9a24671 feat: Add MemGPT "Python Client" (#713)
* First commit of memgpt client and some messy test code

* rolled back unnecessary changes to abstract interface; switched client to always use Queueing Interface

* Added missing interface clear() in run_command;  added convenience method for checking if an agent exists, used that in create_agent

* Formatting fixes

* Fixed incorrect naming of get_agent_memory in rest server

* Removed erroneous clear from client save method;  Replaced print statements with appropriate logger calls in server

* Updated readme with client usage instructions

* added tests for Client

* make printing to terminal togglable on queininginterface (should probably refactor this to a logger)

* turn off printing to stdout via interface by default

* allow importing the python client in a similar fashion to openai-python (see https://github.com/openai/openai-python)

* Allowed quickstart on init of client;  updated readme and test_client accordingly

* oops, fixed name of openai_api_key config key

* Fixed small typo

* Fixed broken test by adding memgpt hosted model details to agent config

* silence llamaindex 'LLM is explicitly disabled. Using MockLLM.' on server

* default to openai if user's memgpt directory is empty (first time)

* correct type hint

* updated section on client in readme

* added comment about how MemGPT config != Agent config

* patch unrelated test

* update wording on readme

* patch another unrelated test

* added python client to readme docs

* Changed 'user' to 'human' in example;  Defaulted AgentConfig.model to 'None';  Fixed issue in create_agent (accounting for dict config);  matched test code to example

* Fixed advanced example

* patch test

* patch

---------

Co-authored-by: cpacker <packercharles@gmail.com>
2023-12-30 12:43:46 -08:00
Sarah Wooders
ba550fbb07 Update memgpt configure to reflect current storage connector options 2023-12-26 19:28:13 +04:00
Max Blackmer
c43acc3ece [cpacker#319] fixed moved function call. 2023-12-26 09:03:35 -05:00
Max Blackmer
5733f0418d [cpacker#319] Refactor memgptlog.py to log.py and move a function to log.py 2023-12-26 08:52:24 -05:00
Sarah Wooders
b64f3aca4b Support metadata table via storage connectors for data sources 2023-12-26 17:06:58 +04:00
Sarah Wooders
deb7f3c1e1 Enable loading local agents with refactored recall memory + update MemGPTConfig to default to sqlite + chroma 2023-12-26 17:06:56 +04:00
Sarah Wooders
5002b8e1dd Add SQLite integration for recall memory 2023-12-26 17:06:56 +04:00
Sarah Wooders
0e935d3ebd Add more compehensive tests, make row ids be strings (not integers) 2023-12-26 17:05:58 +04:00
Sarah Wooders
8a3681297a Cleanup agent function linking 2023-12-26 17:05:26 +04:00
Sarah Wooders
223e196da8 Support recall and archival memory for postgres
working test
2023-12-26 17:05:24 +04:00
Max Blackmer, CSM
ebbd176e71 Merge branch 'main' into feature/global-logging 2023-12-25 14:53:19 -05:00
Charles Packer
3ec8bb1465 fix: misc fixes (#700)
* add folder generation

* disable default temp until more testing is done

* apply embedding payload patch to search, add input checking for better runtime error messages

* streamlined memory pressure warning now that heartbeats get forced
2023-12-25 01:29:13 -08:00
Charles Packer
3482a196d6 feat: improve CLI appearance (#687)
* prettified standard cli output

* also suppress stdout for agent loading

* better spacing

* added emoji to existing agent load
2023-12-23 11:39:51 -08:00
Max Blackmer
f7df7d6d78 [cpacker#319] run Black Reformat on files. 2023-12-19 15:09:08 -05:00
Max Blackmer
6cafa9ae97 [#319] Global Logging Configuration with directory fixes at config load. 2023-12-18 16:51:23 -05:00
Charles Packer
f2a2942c66 sort agents by directory-last-modified time (#574)
* sort agents by directory-last-modified time

* only save agent config when agent is saved

---------

Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
2023-12-04 14:16:03 -08:00
Sarah Wooders
2d23370930 Removing dead code + legacy commands (#536) 2023-11-30 13:37:11 -08:00
Sarah Wooders
ed356dd82c Add support for HuggingFace Text Embedding Inference endpoint for embeddings (#524) 2023-11-27 16:28:49 -08:00
Sarah Wooders
a23ba80ac8 Update config to include memgpt_version and re-run configuration for old versions on memgpt run (#450)
* mark depricated API section

* add readme

* add readme

* add readme

* add readme

* add readme

* add readme

* add readme

* add readme

* add readme

* 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

* remove asserts

* store config versions and force update in some cases
2023-11-14 22:50:24 -08:00
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
b86d3e8f96 patch getargspec error (#440) 2023-11-13 17:49:01 -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
Charles Packer
d6335f81cc patch (#435) 2023-11-12 22:59:41 -08:00
Sarah Wooders
5647f8b63b fix agent load (#412) 2023-11-10 10:34:37 -08:00
Charles Packer
dab47001a9 Fix max tokens constant (#374)
* stripped LLM_MAX_TOKENS constant, instead it's a dictionary, and context_window is set via the config (defaults to 8k)

* pass context window in the calls to local llm APIs

* safety check

* remove dead imports

* context_length -> context_window

* add default for agent.load

* in configure, ask for the model context window if not specified via dictionary

* fix default, also make message about OPENAI_API_BASE missing more informative

* make openai default embedding if openai is default llm

* make openai on top of list

* typo

* also make local the default for embeddings if you're using localllm instead of the locallm endpoint

* provide --context_window flag to memgpt run

* fix runtime error

* stray comments

* stray comment
2023-11-09 17:59:03 -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
Sarah Wooders
f47247d4b4 Allow overriding config location with MEMGPT_CONFIG_PATH (#383) 2023-11-08 21:35:35 -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
3f61969cc2 Avoid throwing error for older ~/.memgpt/config files due to missing section archival_storage (#344)
* avoid error if has old config type
2023-11-06 18:49:49 -08: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
Sarah Wooders
c9225d329e Cli bug fixes (loading human/persona text, azure setup, local setup) (#222)
* mark depricated API section

* add readme

* add readme

* add readme

* add readme

* add readme

* add readme

* add readme

* add readme

* add readme

* CLI bug fixes for azure

* check azure before running

* Update README.md

* Update README.md

* bug fix with persona loading

* revert readme

* remove print
2023-10-31 13:51:20 -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
Charles Packer
06871cc298 black patch on outstanding files that were causing workflow fails on PRs (#193) 2023-10-29 20:53:46 -07:00
Vivian Fang
07b5d32316 hotfix 2023-10-27 13:22:36 -07:00
Vivian Fang
2b48b259c9 Default to no when prompting user for preloading into archival memory 2023-10-27 13:20:09 -07:00
Sarah Wooders
5c44790ad0 add black to poetry and reformat 2023-10-26 15:33:50 -07:00
Vivian Fang
e8409ddb55 add proper init params to Config class 2023-10-25 16:51:08 -07:00
Vivian Fang
c47f7b426c add config file validation 2023-10-25 14:43:06 -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
Vivian Fang
2a18ce86e9 config hotfix for pymemgpt, bump version 2023-10-24 15:48:30 -07:00