Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.
working poetry package
Sarah Woodersfa27d7202952
diff --git a/memgpt/__main__.py b/memgpt/__main__.pynew file mode 100644index 000000000..2310408d9--- /dev/null+++ b/memgpt/__main__.py@@ -0,0 +1,2 @@+from .main import app+app()diff --git a/config.py b/memgpt/config.pysimilarity index 99%rename from config.pyrename to memgpt/config.pyindex 5ebebd248..6ab7ea5de 100644--- a/config.py+++ b/memgpt/config.py@@ -3,7 +3,6 @@ import jsonimport osimport textwrap-import interfaceimport questionary@@ -12,7 +11,7 @@ from colorama import Fore, Stylefrom typing import List, Typeimport memgpt.utils as utils-+import memgpt.interfacefrom memgpt.personas.personas import get_persona_textfrom memgpt.humans.humans import get_human_textdiff --git a/interface.py b/memgpt/interface.pysimilarity index 100%rename from interface.pyrename to memgpt/interface.pydiff --git a/main.py b/memgpt/main.pysimilarity index 93%rename from main.pyrename to memgpt/main.pyindex f1abb7909..c92f965e5 100644--- a/main.py+++ b/memgpt/main.py@@ -1,5 +1,4 @@import asyncio-from absl import app, flagsimport loggingimport globimport os@@ -13,7 +12,7 @@ from rich.console import Consoleconsole = Console()-import interface # for printing to terminal+import memgpt.interface # for printing to terminalimport memgpt.agent as agentimport memgpt.system as systemimport memgpt.utils as utils@@ -27,7 +26,7 @@ from memgpt.persistence_manager import (InMemoryStateManagerWithFaiss,)-from config import Config+from memgpt.config import Configimport asyncioapp = typer.Typer()@@ -121,7 +120,6 @@ def run(use_azure_openai: bool = typer.Option(False, "--use-azure-openai", help="Use Azure OpenAI (requires additional environment variables)") # TODO: just pass in?):- print("COMMAND RUN", persona)loop = asyncio.get_event_loop()loop.run_until_complete(main(@@ -154,7 +152,6 @@ async def main(archival_storage_sqldb,use_azure_openai,):- print("RUN MAIN")utils.DEBUG = debuglogging.getLogger().setLevel(logging.CRITICAL)if debug:@@ -171,7 +168,7 @@ async def main(archival_storage_sqldb,)):- interface.important_message("⚙️ Using legacy command line arguments.")+ memgpt.interface.important_message("⚙️ Using legacy command line arguments.")model = modelif model is None:model = constants.DEFAULT_MEMGPT_MODEL@@ -233,9 +230,9 @@ async def main(else:cfg = await Config.config_init()- interface.important_message("Running... [exit by typing '/exit']")+ memgpt.interface.important_message("Running... [exit by typing '/exit']")if cfg.model != constants.DEFAULT_MEMGPT_MODEL:- interface.warning_message(+ memgpt.interface.warning_message(f"⛔️ Warning - you are running MemGPT with {cfg.model}, which is not officially supported (yet). Expect bugs!")@@ -284,7 +281,7 @@ async def main(persistence_manager = InMemoryStateManager()if archival_storage_files_compute_embeddings:- interface.important_message(+ memgpt.interface.important_message(f"(legacy) To avoid computing embeddings next time, replace --archival_storage_files_compute_embeddings={archival_storage_files_compute_embeddings} with\n\t --archival_storage_faiss_path={cfg.archival_storage_index} (if your files haven't changed).")@@ -297,10 +294,10 @@ async def main(cfg.model,personas.get_persona_text(chosen_persona),humans.get_human_text(chosen_human),- interface,+ memgpt.interface,persistence_manager,)- print_messages = interface.print_messages+ print_messages = memgpt.interface.print_messagesawait print_messages(memgpt_agent.messages)counter = 0@@ -400,7 +397,7 @@ async def main(continueelif user_input.lower() == "/dumpraw":- await interface.print_messages_raw(memgpt_agent.messages)+ await memgpt.interface.print_messages_raw(memgpt_agent.messages)continueelif user_input.lower() == "/dump1":@@ -439,7 +436,7 @@ async def main(# No skip optionselif user_input.lower() == "/wipe":- memgpt_agent = agent.AgentAsync(interface)+ memgpt_agent = agent.AgentAsync(memgpt.interface)user_message = Noneelif user_input.lower() == "/heartbeat":@@ -487,13 +484,13 @@ async def main(print("Finished.")-if __name__ == "__main__":-- app()- #typer.run(run)-- #def run(argv):- # loop = asyncio.get_event_loop()- # loop.run_until_complete(main())-- #app.run(run)+#if __name__ == "__main__":+#+# app()+# #typer.run(run)+#+# #def run(argv):+# # loop = asyncio.get_event_loop()+# # loop.run_until_complete(main())+#+# #app.run(run)diff --git a/pyproject.toml b/pyproject.tomlindex 96d34888e..0ba7c22f5 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -1,11 +1,14 @@[tool.poetry]-name = "pymemgpt"+name = "memgpt"version = "0.1.0"description = "Teaching LLMs memory management for unbounded context"authors = ["Sarah Wooders <[email protected]>"]license = "Apache License"readme = "README.md"+[tool.poetry.scripts]+memgpt = "memgpt.main:app"+[tool.poetry.dependencies]python = "<3.13,>=3.9"absl-py = "^2.0.0"