Commit Graph

69 Commits

Author SHA1 Message Date
Sarah Wooders
f47e800982 feat: Add paginated memory queries (#825)
Co-authored-by: cpacker <packercharles@gmail.com>
2024-01-15 21:21:58 -08:00
cpacker
78534f4852 fix: patched another test that used dummy user_id's to instead use the default user_id 2024-01-15 14:07:57 -08:00
cpacker
5799d4ab36 fix: patched another test that used dummy user_id's to instead use the default user_id 2024-01-15 14:03:39 -08:00
cpacker
41f9640364 fix: fixed the type hints in server to use uuid, patched tests that used strings as dummy users 2024-01-15 14:01:06 -08:00
ifsheldon
dd2f4fc873 fix: Turn off all ensure_ascii of json.dumps (#800) 2024-01-11 23:54:35 -08:00
Charles Packer
f118e01ad1 feat: Migration command for importing old agents into new DB backend (#802)
Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
2024-01-11 14:57:21 -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
Charles Packer
f045c3515c feat: add_function and remove_function commands (#784) 2024-01-10 23:19:14 -08:00
Charles Packer
771eeb6a02 fix: deprecate AgentConfig in favor of AgentState. (#803) 2024-01-10 20:23:47 -08:00
Tom Bedor
0c0f269453 feat: add_function and remove_function commands
Allows for dynamic editing of user defined functions.

Disallows removing functions that are defined by MemGPT itself.
2024-01-11 00:38:40 +00:00
Sarah Wooders
d118774bb7 fix: tests should only use "openai" quickstart if `OPENAI_API_KEY is set (#801) 2024-01-09 19:13:16 -08:00
Sarah Wooders
d331c71ec3 remove AgentConfig imports 2024-01-09 11:38:46 -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
cpacker
e175c204b2 try another patch to recreate declarative base 2024-01-04 11:33:44 -08:00
cpacker
5b4875834f Add extra code for wiping sqlalchemy globals 2024-01-04 11:26:35 -08:00
Sarah Wooders
ed101934da Avoid usage of Vector type for when not using postgres 2024-01-04 09:23:04 -08:00
Sarah Wooders
8b5fe4f383 Avoid usage of Vector type for when not using postgres 2024-01-04 09:11:23 -08:00
Sarah Wooders
45e6d5793d Modify tests to use openai quickstart 2024-01-03 19:01:27 -08:00
cpacker
d0ef339a4a use --all-extras in poetry install for tests 2024-01-02 22:18:17 -08:00
cpacker
1f6af59e9d added a new test that makes sure the base functions are working 2024-01-02 18:20:54 -08:00
Sarah Wooders
9bd524d70a Move test_cli.py to use quickstart client 2024-01-02 17:13:25 -08:00
Sarah Wooders
e93dae02e7 Update CLI tests to use OpenAI pre-configured config 2024-01-02 16:14:22 -08: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
Charles Packer
0b9fdcf46c fix: added new json test case + added fix for it (also refactored clean json func) (#739) 2023-12-28 23:01:45 -08:00
Sarah Wooders
5f554d305b Increase workflow test timeout time + add test prints 2023-12-27 15:42:11 +04:00
Sarah Wooders
515d9d0f62 Fix bug with chroma vector query 2023-12-27 14:40:11 +04:00
Sarah Wooders
3f8b9063a1 Run black formatter 2023-12-26 17:53:57 +04:00
Sarah Wooders
0c2bf05406 Bugfixes for get_all function and code cleanup to match main 2023-12-26 17:50:49 +04:00
Sarah Wooders
11096b20a4 Set get_all limit to None by default and add postgres to archival memory tests 2023-12-26 17:07:54 +04:00
Sarah Wooders
d4ddf549e3 Support attaching data sources to agents for storage refactor 2023-12-26 17:07:28 +04:00
Sarah Wooders
b64f3aca4b Support metadata table via storage connectors for data sources 2023-12-26 17:06:58 +04:00
Sarah Wooders
5002b8e1dd Add SQLite integration for recall memory 2023-12-26 17:06:56 +04:00
Sarah Wooders
e2b29d8995 Bugfixes and test updates for passing tests for both postgres and chroma 2023-12-26 17:06:18 +04:00
Sarah Wooders
b4b05bd75d Update storage tests and chroma for passing tests 2023-12-26 17:06:00 +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
223e196da8 Support recall and archival memory for postgres
working test
2023-12-26 17:05:24 +04:00
Sarah Wooders
408df89c9c Add in memory storage connector implementation for refactored storage 2023-12-26 17:05:24 +04:00
Charles Packer
20f5231aff feat: added basic heartbeat override heuristics (#621)
* added basic heartbeat override

* tested and working on lmstudio (patched typo + patched new bug emerging in latest lmstudio build

* added lmstudio patch to chatml wrapper

* update the system messages to be informative about the source

* updated string constants after some tuning
2023-12-24 23:46:00 -08:00
Charles Packer
2048ba179b added memgpt server command (#611)
* added memgpt server command

* added the option to specify a port (rest default 8283, ws default 8282)

* fixed import in test

* added agent saving on shutdown

* added basic locking mechanism (assumes only one server.py is running at the same time)

* remove 'STOP' from buffer when converting to list for the non-streaming POST resposne

* removed duplicate on_event (redundant to lifespan)

* added GET agents/memory route

* added GET agent config

* added GET server config

* added PUT route for modifying agent core memory

* refactored to put server loop in separate function called via main
2023-12-13 00:41:40 -08:00
Charles Packer
b7427e2de7 API server refactor + REST API (#593)
* init server refactor

* refactored websockets server/client code to use internal server API

* added intentional fail on test

* update workflow to try and get test to pass remotely

* refactor to put websocket code in a separate subdirectory

* added fastapi rest server

* add error handling

* modified interface return style

* disabled certain tests on remote

* added SSE response option for user_message

* fix ws interface test

* fallback for oai key

* add soft fail for test when localhost is borked

* add step_yield for all server related interfaces

* extra catch

* update toml + lock with server add-ons (add uvicorn+fastapi, move websockets to server extra)

* regen lock file

* added pytest-asyncio as an extra in dev

* add pydantic to deps

* renamed CreateConfig to CreateAgentConfig

* fixed POST request for creating agent + tested it
2023-12-11 15:08:42 -08:00
Sarah Wooders
dcceb8671f Remove broken tests from chroma merge (#584) 2023-12-05 22:09:44 -08:00
Sarah Wooders
6a155dfc90 Chroma storage integration (#285) 2023-12-05 17:49:00 -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
Charles Packer
2121130a88 add new manual json parser meant to catch send_message calls with trailing bad extra chars (#509)
* add new manual json parser meant to catch send_message calls with stray trailing chars, patch json error passing

* typo
2023-11-25 16:30:12 -08:00
Prashant Dixit
11e11bfac4 Lancedb storage integration (#455) 2023-11-17 11:36:30 -08:00
Charles Packer
f63419c78b Update documentation [local LLMs, presets] (#453)
* updated local llm documentation

* updated cli flags to be consistent with documentation

* added preset documentation

* update test to use new arg

* update test to use new arg
2023-11-15 01:02:57 -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