letta-nightly 0.6.1.dev20241206104246__tar.gz → 0.6.1.dev20241207104149__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of letta-nightly might be problematic. Click here for more details.
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/PKG-INFO +1 -1
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/agent.py +54 -37
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/agent_store/db.py +1 -77
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/agent_store/storage.py +0 -5
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/cli/cli.py +0 -1
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/client/client.py +3 -7
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/constants.py +1 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/functions/function_sets/base.py +33 -5
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/main.py +2 -2
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/memory.py +4 -82
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/metadata.py +0 -35
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/o1_agent.py +7 -2
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/offline_memory_agent.py +6 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/__init__.py +2 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/file.py +1 -1
- letta_nightly-0.6.1.dev20241207104149/letta/orm/message.py +66 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/mixins.py +16 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/organization.py +1 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/sqlalchemy_base.py +118 -26
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/letta_base.py +7 -6
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/message.py +1 -7
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/agents.py +2 -2
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/blocks.py +2 -2
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/server.py +52 -50
- letta_nightly-0.6.1.dev20241207104149/letta/server/static_files/assets/index-43ab4d62.css +1 -0
- letta_nightly-0.6.1.dev20241207104149/letta/server/static_files/assets/index-4848e3d7.js +40 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/static_files/index.html +2 -2
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/block_manager.py +1 -1
- letta_nightly-0.6.1.dev20241207104149/letta/services/message_manager.py +182 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/organization_manager.py +6 -9
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/source_manager.py +1 -1
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/tool_manager.py +1 -1
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/user_manager.py +1 -1
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/pyproject.toml +1 -1
- letta_nightly-0.6.1.dev20241206104246/letta/agent_store/lancedb.py +0 -177
- letta_nightly-0.6.1.dev20241206104246/letta/persistence_manager.py +0 -149
- letta_nightly-0.6.1.dev20241206104246/letta/server/static_files/assets/index-1b5d1a41.js +0 -271
- letta_nightly-0.6.1.dev20241206104246/letta/server/static_files/assets/index-56a3f8c6.css +0 -1
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/LICENSE +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/README.md +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/__main__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/agent_store/chroma.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/agent_store/milvus.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/agent_store/qdrant.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/chat_only_agent.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/client/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/client/streaming.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/client/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/config.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/credentials.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/data_sources/connectors.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/data_sources/connectors_helper.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/embeddings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/errors.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/functions/functions.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/functions/helpers.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/functions/schema_generator.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/helpers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/helpers/tool_rule_solver.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/anthropic.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/azure_openai_constants.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/helpers.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/llm_api_tools.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/mistral.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/llm_api/openai.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/function_parser.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/log.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/__all__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/agents_tags.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/base.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/block.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/blocks_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/enums.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/errors.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/job.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/sandbox_config.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/source.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/tool.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/tools_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/orm/user.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/o1_persona.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/offline_memory_persona.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_convo_only.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_offline_memory.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/prompts/system/memgpt_offline_memory_chat.txt +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/providers.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/pytest.ini +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/agent.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/agents_tags.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/api_key.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/block.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/blocks_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/embedding_config.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/file.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/health.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/job.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/llm_config.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/passage.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/sandbox_config.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/source.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/tool.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/tool_rule.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/tools_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/schemas/user.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/generate_openapi_schema.sh +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/app.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/openai/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/health.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/tools.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/rest_api/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/startup.sh +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/server/ws_api/server.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/agents_tags_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/blocks_agents_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/job_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/per_agent_lock_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/sandbox_config_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/tool_execution_sandbox.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/tool_sandbox_env/.gitkeep +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/services/tools_agents_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/streaming_utils.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/system.py +0 -0
- {letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/utils.py +0 -0
{letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/agent.py
RENAMED
|
@@ -19,6 +19,7 @@ from letta.constants import (
|
|
|
19
19
|
MESSAGE_SUMMARY_TRUNC_KEEP_N_LAST,
|
|
20
20
|
MESSAGE_SUMMARY_TRUNC_TOKEN_FRAC,
|
|
21
21
|
MESSAGE_SUMMARY_WARNING_FRAC,
|
|
22
|
+
O1_BASE_TOOLS,
|
|
22
23
|
REQ_HEARTBEAT_MESSAGE,
|
|
23
24
|
)
|
|
24
25
|
from letta.errors import LLMError
|
|
@@ -27,10 +28,9 @@ from letta.interface import AgentInterface
|
|
|
27
28
|
from letta.llm_api.helpers import is_context_overflow_error
|
|
28
29
|
from letta.llm_api.llm_api_tools import create
|
|
29
30
|
from letta.local_llm.utils import num_tokens_from_functions, num_tokens_from_messages
|
|
30
|
-
from letta.memory import ArchivalMemory,
|
|
31
|
+
from letta.memory import ArchivalMemory, EmbeddingArchivalMemory, summarize_messages
|
|
31
32
|
from letta.metadata import MetadataStore
|
|
32
33
|
from letta.orm import User
|
|
33
|
-
from letta.persistence_manager import LocalStateManager
|
|
34
34
|
from letta.schemas.agent import AgentState, AgentStepResponse
|
|
35
35
|
from letta.schemas.block import BlockUpdate
|
|
36
36
|
from letta.schemas.embedding_config import EmbeddingConfig
|
|
@@ -49,7 +49,9 @@ from letta.schemas.passage import Passage
|
|
|
49
49
|
from letta.schemas.tool import Tool
|
|
50
50
|
from letta.schemas.tool_rule import TerminalToolRule
|
|
51
51
|
from letta.schemas.usage import LettaUsageStatistics
|
|
52
|
+
from letta.schemas.user import User as PydanticUser
|
|
52
53
|
from letta.services.block_manager import BlockManager
|
|
54
|
+
from letta.services.message_manager import MessageManager
|
|
53
55
|
from letta.services.source_manager import SourceManager
|
|
54
56
|
from letta.services.tool_execution_sandbox import ToolExecutionSandbox
|
|
55
57
|
from letta.services.user_manager import UserManager
|
|
@@ -80,9 +82,11 @@ from letta.utils import (
|
|
|
80
82
|
|
|
81
83
|
|
|
82
84
|
def compile_memory_metadata_block(
|
|
85
|
+
actor: PydanticUser,
|
|
86
|
+
agent_id: str,
|
|
83
87
|
memory_edit_timestamp: datetime.datetime,
|
|
84
88
|
archival_memory: Optional[ArchivalMemory] = None,
|
|
85
|
-
|
|
89
|
+
message_manager: Optional[MessageManager] = None,
|
|
86
90
|
) -> str:
|
|
87
91
|
# Put the timestamp in the local timezone (mimicking get_local_time())
|
|
88
92
|
timestamp_str = memory_edit_timestamp.astimezone().strftime("%Y-%m-%d %I:%M:%S %p %Z%z").strip()
|
|
@@ -91,7 +95,7 @@ def compile_memory_metadata_block(
|
|
|
91
95
|
memory_metadata_block = "\n".join(
|
|
92
96
|
[
|
|
93
97
|
f"### Memory [last modified: {timestamp_str}]",
|
|
94
|
-
f"{
|
|
98
|
+
f"{message_manager.size(actor=actor, agent_id=agent_id) if message_manager else 0} previous messages between you and the user are stored in recall memory (use functions to access them)",
|
|
95
99
|
f"{archival_memory.count() if archival_memory else 0} total memories you created are stored in archival memory (use functions to access them)",
|
|
96
100
|
"\nCore memory shown below (limited in size, additional information stored in archival / recall memory):",
|
|
97
101
|
]
|
|
@@ -101,10 +105,12 @@ def compile_memory_metadata_block(
|
|
|
101
105
|
|
|
102
106
|
def compile_system_message(
|
|
103
107
|
system_prompt: str,
|
|
108
|
+
agent_id: str,
|
|
104
109
|
in_context_memory: Memory,
|
|
105
110
|
in_context_memory_last_edit: datetime.datetime, # TODO move this inside of BaseMemory?
|
|
111
|
+
actor: PydanticUser,
|
|
106
112
|
archival_memory: Optional[ArchivalMemory] = None,
|
|
107
|
-
|
|
113
|
+
message_manager: Optional[MessageManager] = None,
|
|
108
114
|
user_defined_variables: Optional[dict] = None,
|
|
109
115
|
append_icm_if_missing: bool = True,
|
|
110
116
|
template_format: Literal["f-string", "mustache", "jinja2"] = "f-string",
|
|
@@ -129,9 +135,11 @@ def compile_system_message(
|
|
|
129
135
|
else:
|
|
130
136
|
# TODO should this all put into the memory.__repr__ function?
|
|
131
137
|
memory_metadata_string = compile_memory_metadata_block(
|
|
138
|
+
actor=actor,
|
|
139
|
+
agent_id=agent_id,
|
|
132
140
|
memory_edit_timestamp=in_context_memory_last_edit,
|
|
133
141
|
archival_memory=archival_memory,
|
|
134
|
-
|
|
142
|
+
message_manager=message_manager,
|
|
135
143
|
)
|
|
136
144
|
full_memory_string = memory_metadata_string + "\n" + in_context_memory.compile()
|
|
137
145
|
|
|
@@ -164,9 +172,11 @@ def compile_system_message(
|
|
|
164
172
|
def initialize_message_sequence(
|
|
165
173
|
model: str,
|
|
166
174
|
system: str,
|
|
175
|
+
agent_id: str,
|
|
167
176
|
memory: Memory,
|
|
177
|
+
actor: PydanticUser,
|
|
168
178
|
archival_memory: Optional[ArchivalMemory] = None,
|
|
169
|
-
|
|
179
|
+
message_manager: Optional[MessageManager] = None,
|
|
170
180
|
memory_edit_timestamp: Optional[datetime.datetime] = None,
|
|
171
181
|
include_initial_boot_message: bool = True,
|
|
172
182
|
) -> List[dict]:
|
|
@@ -177,11 +187,13 @@ def initialize_message_sequence(
|
|
|
177
187
|
# system, memory, memory_edit_timestamp, archival_memory=archival_memory, recall_memory=recall_memory
|
|
178
188
|
# )
|
|
179
189
|
full_system_message = compile_system_message(
|
|
190
|
+
agent_id=agent_id,
|
|
180
191
|
system_prompt=system,
|
|
181
192
|
in_context_memory=memory,
|
|
182
193
|
in_context_memory_last_edit=memory_edit_timestamp,
|
|
194
|
+
actor=actor,
|
|
183
195
|
archival_memory=archival_memory,
|
|
184
|
-
|
|
196
|
+
message_manager=message_manager,
|
|
185
197
|
user_defined_variables=None,
|
|
186
198
|
append_icm_if_missing=True,
|
|
187
199
|
)
|
|
@@ -282,7 +294,8 @@ class Agent(BaseAgent):
|
|
|
282
294
|
self.interface = interface
|
|
283
295
|
|
|
284
296
|
# Create the persistence manager object based on the AgentState info
|
|
285
|
-
self.
|
|
297
|
+
self.archival_memory = EmbeddingArchivalMemory(agent_state)
|
|
298
|
+
self.message_manager = MessageManager()
|
|
286
299
|
|
|
287
300
|
# State needed for heartbeat pausing
|
|
288
301
|
self.pause_heartbeats_start = None
|
|
@@ -309,9 +322,11 @@ class Agent(BaseAgent):
|
|
|
309
322
|
init_messages = initialize_message_sequence(
|
|
310
323
|
model=self.model,
|
|
311
324
|
system=self.agent_state.system,
|
|
325
|
+
agent_id=self.agent_state.id,
|
|
312
326
|
memory=self.agent_state.memory,
|
|
327
|
+
actor=self.user,
|
|
313
328
|
archival_memory=None,
|
|
314
|
-
|
|
329
|
+
message_manager=None,
|
|
315
330
|
memory_edit_timestamp=get_utc_time(),
|
|
316
331
|
include_initial_boot_message=True,
|
|
317
332
|
)
|
|
@@ -333,8 +348,10 @@ class Agent(BaseAgent):
|
|
|
333
348
|
model=self.model,
|
|
334
349
|
system=self.agent_state.system,
|
|
335
350
|
memory=self.agent_state.memory,
|
|
351
|
+
agent_id=self.agent_state.id,
|
|
352
|
+
actor=self.user,
|
|
336
353
|
archival_memory=None,
|
|
337
|
-
|
|
354
|
+
message_manager=None,
|
|
338
355
|
memory_edit_timestamp=get_utc_time(),
|
|
339
356
|
include_initial_boot_message=True,
|
|
340
357
|
)
|
|
@@ -356,7 +373,6 @@ class Agent(BaseAgent):
|
|
|
356
373
|
|
|
357
374
|
# Put the messages inside the message buffer
|
|
358
375
|
self.messages_total = 0
|
|
359
|
-
# self._append_to_messages(added_messages=[cast(Message, msg) for msg in init_messages_objs if msg is not None])
|
|
360
376
|
self._append_to_messages(added_messages=init_messages_objs)
|
|
361
377
|
self._validate_message_buffer_is_utc()
|
|
362
378
|
|
|
@@ -413,7 +429,10 @@ class Agent(BaseAgent):
|
|
|
413
429
|
# TODO: need to have an AgentState object that actually has full access to the block data
|
|
414
430
|
# this is because the sandbox tools need to be able to access block.value to edit this data
|
|
415
431
|
try:
|
|
416
|
-
|
|
432
|
+
# TODO: This is NO BUENO
|
|
433
|
+
# TODO: Matching purely by names is extremely problematic, users can create tools with these names and run them in the agent loop
|
|
434
|
+
# TODO: We will have probably have to match the function strings exactly for safety
|
|
435
|
+
if function_name in BASE_TOOLS or function_name in O1_BASE_TOOLS:
|
|
417
436
|
# base tools are allowed to access the `Agent` object and run on the database
|
|
418
437
|
function_args["self"] = self # need to attach self to arg since it's dynamically linked
|
|
419
438
|
function_response = function_to_call(**function_args)
|
|
@@ -474,7 +493,7 @@ class Agent(BaseAgent):
|
|
|
474
493
|
# Pull the message objects from the database
|
|
475
494
|
message_objs = []
|
|
476
495
|
for msg_id in message_ids:
|
|
477
|
-
msg_obj = self.
|
|
496
|
+
msg_obj = self.message_manager.get_message_by_id(msg_id, actor=self.user)
|
|
478
497
|
if msg_obj:
|
|
479
498
|
if isinstance(msg_obj, Message):
|
|
480
499
|
message_objs.append(msg_obj)
|
|
@@ -522,16 +541,13 @@ class Agent(BaseAgent):
|
|
|
522
541
|
|
|
523
542
|
def _trim_messages(self, num):
|
|
524
543
|
"""Trim messages from the front, not including the system message"""
|
|
525
|
-
self.persistence_manager.trim_messages(num)
|
|
526
|
-
|
|
527
544
|
new_messages = [self._messages[0]] + self._messages[num:]
|
|
528
545
|
self._messages = new_messages
|
|
529
546
|
|
|
530
547
|
def _prepend_to_messages(self, added_messages: List[Message]):
|
|
531
548
|
"""Wrapper around self.messages.prepend to allow additional calls to a state/persistence manager"""
|
|
532
549
|
assert all([isinstance(msg, Message) for msg in added_messages])
|
|
533
|
-
|
|
534
|
-
self.persistence_manager.prepend_to_messages(added_messages)
|
|
550
|
+
self.message_manager.create_many_messages(added_messages, actor=self.user)
|
|
535
551
|
|
|
536
552
|
new_messages = [self._messages[0]] + added_messages + self._messages[1:] # prepend (no system)
|
|
537
553
|
self._messages = new_messages
|
|
@@ -540,8 +556,7 @@ class Agent(BaseAgent):
|
|
|
540
556
|
def _append_to_messages(self, added_messages: List[Message]):
|
|
541
557
|
"""Wrapper around self.messages.append to allow additional calls to a state/persistence manager"""
|
|
542
558
|
assert all([isinstance(msg, Message) for msg in added_messages])
|
|
543
|
-
|
|
544
|
-
self.persistence_manager.append_to_messages(added_messages)
|
|
559
|
+
self.message_manager.create_many_messages(added_messages, actor=self.user)
|
|
545
560
|
|
|
546
561
|
# strip extra metadata if it exists
|
|
547
562
|
# for msg in added_messages:
|
|
@@ -885,7 +900,6 @@ class Agent(BaseAgent):
|
|
|
885
900
|
messages=next_input_message,
|
|
886
901
|
**kwargs,
|
|
887
902
|
)
|
|
888
|
-
step_response.messages
|
|
889
903
|
heartbeat_request = step_response.heartbeat_request
|
|
890
904
|
function_failed = step_response.function_failed
|
|
891
905
|
token_warning = step_response.in_context_memory_warning
|
|
@@ -1247,7 +1261,7 @@ class Agent(BaseAgent):
|
|
|
1247
1261
|
assert new_system_message_obj.role == "system", new_system_message_obj
|
|
1248
1262
|
assert self._messages[0].role == "system", self._messages
|
|
1249
1263
|
|
|
1250
|
-
self.
|
|
1264
|
+
self.message_manager.create_message(new_system_message_obj, actor=self.user)
|
|
1251
1265
|
|
|
1252
1266
|
new_messages = [new_system_message_obj] + self._messages[1:] # swap index 0 (system)
|
|
1253
1267
|
self._messages = new_messages
|
|
@@ -1280,11 +1294,13 @@ class Agent(BaseAgent):
|
|
|
1280
1294
|
|
|
1281
1295
|
# update memory (TODO: potentially update recall/archival stats seperately)
|
|
1282
1296
|
new_system_message_str = compile_system_message(
|
|
1297
|
+
agent_id=self.agent_state.id,
|
|
1283
1298
|
system_prompt=self.agent_state.system,
|
|
1284
1299
|
in_context_memory=self.agent_state.memory,
|
|
1285
1300
|
in_context_memory_last_edit=memory_edit_timestamp,
|
|
1286
|
-
|
|
1287
|
-
|
|
1301
|
+
actor=self.user,
|
|
1302
|
+
archival_memory=self.archival_memory,
|
|
1303
|
+
message_manager=self.message_manager,
|
|
1288
1304
|
user_defined_variables=None,
|
|
1289
1305
|
append_icm_if_missing=True,
|
|
1290
1306
|
)
|
|
@@ -1370,20 +1386,20 @@ class Agent(BaseAgent):
|
|
|
1370
1386
|
# passage.id = create_uuid_from_string(f"{source_id}_{str(passage.agent_id)}_{passage.text}")
|
|
1371
1387
|
|
|
1372
1388
|
# insert into agent archival memory
|
|
1373
|
-
self.
|
|
1389
|
+
self.archival_memory.storage.insert_many(passages)
|
|
1374
1390
|
all_passages += passages
|
|
1375
1391
|
|
|
1376
1392
|
assert size == len(all_passages), f"Expected {size} passages, but only got {len(all_passages)}"
|
|
1377
1393
|
|
|
1378
1394
|
# save destination storage
|
|
1379
|
-
self.
|
|
1395
|
+
self.archival_memory.storage.save()
|
|
1380
1396
|
|
|
1381
1397
|
# attach to agent
|
|
1382
1398
|
source = SourceManager().get_source_by_id(source_id=source_id, actor=user)
|
|
1383
1399
|
assert source is not None, f"Source {source_id} not found in metadata store"
|
|
1384
1400
|
ms.attach_source(agent_id=self.agent_state.id, source_id=source_id, user_id=self.agent_state.user_id)
|
|
1385
1401
|
|
|
1386
|
-
total_agent_passages = self.
|
|
1402
|
+
total_agent_passages = self.archival_memory.storage.size()
|
|
1387
1403
|
|
|
1388
1404
|
printd(
|
|
1389
1405
|
f"Attached data source {source.name} to agent {self.agent_state.name}, consisting of {len(all_passages)}. Agent now has {total_agent_passages} embeddings in archival memory.",
|
|
@@ -1392,7 +1408,7 @@ class Agent(BaseAgent):
|
|
|
1392
1408
|
def update_message(self, request: UpdateMessage) -> Message:
|
|
1393
1409
|
"""Update the details of a message associated with an agent"""
|
|
1394
1410
|
|
|
1395
|
-
message = self.
|
|
1411
|
+
message = self.message_manager.get_message_by_id(message_id=request.id, actor=self.user)
|
|
1396
1412
|
if message is None:
|
|
1397
1413
|
raise ValueError(f"Message with id {request.id} not found")
|
|
1398
1414
|
assert isinstance(message, Message), f"Message is not a Message object: {type(message)}"
|
|
@@ -1413,10 +1429,10 @@ class Agent(BaseAgent):
|
|
|
1413
1429
|
message.tool_call_id = request.tool_call_id
|
|
1414
1430
|
|
|
1415
1431
|
# Save the updated message
|
|
1416
|
-
self.
|
|
1432
|
+
self.message_manager.update_message_by_id(message_id=message.id, message=message, actor=self.user)
|
|
1417
1433
|
|
|
1418
1434
|
# Return the updated message
|
|
1419
|
-
updated_message = self.
|
|
1435
|
+
updated_message = self.message_manager.get_message_by_id(message_id=message.id, actor=self.user)
|
|
1420
1436
|
if updated_message is None:
|
|
1421
1437
|
raise ValueError(f"Error persisting message - message with id {request.id} not found")
|
|
1422
1438
|
return updated_message
|
|
@@ -1496,7 +1512,7 @@ class Agent(BaseAgent):
|
|
|
1496
1512
|
deleted_message = self._messages.pop()
|
|
1497
1513
|
# then also remove it from recall storage
|
|
1498
1514
|
try:
|
|
1499
|
-
self.
|
|
1515
|
+
self.message_manager.delete_message_by_id(deleted_message.id, actor=self.user)
|
|
1500
1516
|
popped_messages.append(deleted_message)
|
|
1501
1517
|
except Exception as e:
|
|
1502
1518
|
warnings.warn(f"Error deleting message {deleted_message.id} from recall memory: {e}")
|
|
@@ -1522,7 +1538,6 @@ class Agent(BaseAgent):
|
|
|
1522
1538
|
|
|
1523
1539
|
def retry_message(self) -> List[Message]:
|
|
1524
1540
|
"""Retry / regenerate the last message"""
|
|
1525
|
-
|
|
1526
1541
|
self.pop_until_user()
|
|
1527
1542
|
user_message = self.pop_message(count=1)[0]
|
|
1528
1543
|
assert user_message.text is not None, "User message text is None"
|
|
@@ -1569,12 +1584,14 @@ class Agent(BaseAgent):
|
|
|
1569
1584
|
num_tokens_from_messages(messages=messages_openai_format[1:], model=self.model) if len(messages_openai_format) > 1 else 0
|
|
1570
1585
|
)
|
|
1571
1586
|
|
|
1572
|
-
num_archival_memory = self.
|
|
1573
|
-
|
|
1587
|
+
num_archival_memory = self.archival_memory.storage.size()
|
|
1588
|
+
message_manager_size = self.message_manager.size(actor=self.user, agent_id=self.agent_state.id)
|
|
1574
1589
|
external_memory_summary = compile_memory_metadata_block(
|
|
1590
|
+
actor=self.user,
|
|
1591
|
+
agent_id=self.agent_state.id,
|
|
1575
1592
|
memory_edit_timestamp=get_utc_time(), # dummy timestamp
|
|
1576
|
-
archival_memory=self.
|
|
1577
|
-
|
|
1593
|
+
archival_memory=self.archival_memory,
|
|
1594
|
+
message_manager=self.message_manager,
|
|
1578
1595
|
)
|
|
1579
1596
|
num_tokens_external_memory_summary = count_tokens(external_memory_summary)
|
|
1580
1597
|
|
|
@@ -1600,7 +1617,7 @@ class Agent(BaseAgent):
|
|
|
1600
1617
|
# context window breakdown (in messages)
|
|
1601
1618
|
num_messages=len(self._messages),
|
|
1602
1619
|
num_archival_memory=num_archival_memory,
|
|
1603
|
-
num_recall_memory=
|
|
1620
|
+
num_recall_memory=message_manager_size,
|
|
1604
1621
|
num_tokens_external_memory_summary=num_tokens_external_memory_summary,
|
|
1605
1622
|
# top-level information
|
|
1606
1623
|
context_window_size_max=self.agent_state.llm_config.context_window,
|
|
@@ -27,13 +27,11 @@ from tqdm import tqdm
|
|
|
27
27
|
from letta.agent_store.storage import StorageConnector, TableType
|
|
28
28
|
from letta.config import LettaConfig
|
|
29
29
|
from letta.constants import MAX_EMBEDDING_DIM
|
|
30
|
-
from letta.metadata import EmbeddingConfigColumn
|
|
30
|
+
from letta.metadata import EmbeddingConfigColumn
|
|
31
31
|
from letta.orm.base import Base
|
|
32
32
|
from letta.orm.file import FileMetadata as FileMetadataModel
|
|
33
33
|
|
|
34
34
|
# from letta.schemas.message import Message, Passage, Record, RecordType, ToolCall
|
|
35
|
-
from letta.schemas.message import Message
|
|
36
|
-
from letta.schemas.openai.chat_completions import ToolCall
|
|
37
35
|
from letta.schemas.passage import Passage
|
|
38
36
|
from letta.settings import settings
|
|
39
37
|
|
|
@@ -69,69 +67,6 @@ class CommonVector(TypeDecorator):
|
|
|
69
67
|
return np.frombuffer(value, dtype=np.float32)
|
|
70
68
|
|
|
71
69
|
|
|
72
|
-
class MessageModel(Base):
|
|
73
|
-
"""Defines data model for storing Message objects"""
|
|
74
|
-
|
|
75
|
-
__tablename__ = "messages"
|
|
76
|
-
__table_args__ = {"extend_existing": True}
|
|
77
|
-
|
|
78
|
-
# Assuming message_id is the primary key
|
|
79
|
-
id = Column(String, primary_key=True)
|
|
80
|
-
user_id = Column(String, nullable=False)
|
|
81
|
-
agent_id = Column(String, nullable=False)
|
|
82
|
-
|
|
83
|
-
# openai info
|
|
84
|
-
role = Column(String, nullable=False)
|
|
85
|
-
text = Column(String) # optional: can be null if function call
|
|
86
|
-
model = Column(String) # optional: can be null if LLM backend doesn't require specifying
|
|
87
|
-
name = Column(String) # optional: multi-agent only
|
|
88
|
-
|
|
89
|
-
# tool call request info
|
|
90
|
-
# if role == "assistant", this MAY be specified
|
|
91
|
-
# if role != "assistant", this must be null
|
|
92
|
-
# TODO align with OpenAI spec of multiple tool calls
|
|
93
|
-
# tool_calls = Column(ToolCallColumn)
|
|
94
|
-
tool_calls = Column(ToolCallColumn)
|
|
95
|
-
|
|
96
|
-
# tool call response info
|
|
97
|
-
# if role == "tool", then this must be specified
|
|
98
|
-
# if role != "tool", this must be null
|
|
99
|
-
tool_call_id = Column(String)
|
|
100
|
-
|
|
101
|
-
# Add a datetime column, with default value as the current time
|
|
102
|
-
created_at = Column(DateTime(timezone=True))
|
|
103
|
-
Index("message_idx_user", user_id, agent_id),
|
|
104
|
-
|
|
105
|
-
def __repr__(self):
|
|
106
|
-
return f"<Message(message_id='{self.id}', text='{self.text}')>"
|
|
107
|
-
|
|
108
|
-
def to_record(self):
|
|
109
|
-
# calls = (
|
|
110
|
-
# [ToolCall(id=tool_call["id"], function=ToolCallFunction(**tool_call["function"])) for tool_call in self.tool_calls]
|
|
111
|
-
# if self.tool_calls
|
|
112
|
-
# else None
|
|
113
|
-
# )
|
|
114
|
-
# if calls:
|
|
115
|
-
# assert isinstance(calls[0], ToolCall)
|
|
116
|
-
if self.tool_calls and len(self.tool_calls) > 0:
|
|
117
|
-
assert isinstance(self.tool_calls[0], ToolCall), type(self.tool_calls[0])
|
|
118
|
-
for tool in self.tool_calls:
|
|
119
|
-
assert isinstance(tool, ToolCall), type(tool)
|
|
120
|
-
return Message(
|
|
121
|
-
user_id=self.user_id,
|
|
122
|
-
agent_id=self.agent_id,
|
|
123
|
-
role=self.role,
|
|
124
|
-
name=self.name,
|
|
125
|
-
text=self.text,
|
|
126
|
-
model=self.model,
|
|
127
|
-
# tool_calls=[ToolCall(id=tool_call["id"], function=ToolCallFunction(**tool_call["function"])) for tool_call in self.tool_calls] if self.tool_calls else None,
|
|
128
|
-
tool_calls=self.tool_calls,
|
|
129
|
-
tool_call_id=self.tool_call_id,
|
|
130
|
-
created_at=self.created_at,
|
|
131
|
-
id=self.id,
|
|
132
|
-
)
|
|
133
|
-
|
|
134
|
-
|
|
135
70
|
class PassageModel(Base):
|
|
136
71
|
"""Defines data model for storing Passages (consisting of text, embedding)"""
|
|
137
72
|
|
|
@@ -367,11 +302,6 @@ class PostgresStorageConnector(SQLStorageConnector):
|
|
|
367
302
|
self.db_model = PassageModel
|
|
368
303
|
if self.config.archival_storage_uri is None:
|
|
369
304
|
raise ValueError(f"Must specify archival_storage_uri in config {self.config.config_path}")
|
|
370
|
-
elif table_type == TableType.RECALL_MEMORY:
|
|
371
|
-
self.uri = self.config.recall_storage_uri
|
|
372
|
-
self.db_model = MessageModel
|
|
373
|
-
if self.config.recall_storage_uri is None:
|
|
374
|
-
raise ValueError(f"Must specify recall_storage_uri in config {self.config.config_path}")
|
|
375
305
|
elif table_type == TableType.FILES:
|
|
376
306
|
self.uri = self.config.metadata_storage_uri
|
|
377
307
|
self.db_model = FileMetadataModel
|
|
@@ -490,12 +420,6 @@ class SQLLiteStorageConnector(SQLStorageConnector):
|
|
|
490
420
|
# get storage URI
|
|
491
421
|
if table_type == TableType.ARCHIVAL_MEMORY or table_type == TableType.PASSAGES:
|
|
492
422
|
raise ValueError(f"Table type {table_type} not implemented")
|
|
493
|
-
elif table_type == TableType.RECALL_MEMORY:
|
|
494
|
-
# TODO: eventually implement URI option
|
|
495
|
-
self.path = self.config.recall_storage_path
|
|
496
|
-
if self.path is None:
|
|
497
|
-
raise ValueError(f"Must specify recall_storage_path in config.")
|
|
498
|
-
self.db_model = MessageModel
|
|
499
423
|
elif table_type == TableType.FILES:
|
|
500
424
|
self.path = self.config.metadata_storage_path
|
|
501
425
|
if self.path is None:
|
|
@@ -110,11 +110,6 @@ class StorageConnector:
|
|
|
110
110
|
from letta.agent_store.qdrant import QdrantStorageConnector
|
|
111
111
|
|
|
112
112
|
return QdrantStorageConnector(table_type, config, user_id, agent_id)
|
|
113
|
-
# TODO: add back
|
|
114
|
-
# elif storage_type == "lancedb":
|
|
115
|
-
# from letta.agent_store.db import LanceDBConnector
|
|
116
|
-
|
|
117
|
-
# return LanceDBConnector(agent_config=agent_config, table_type=table_type)
|
|
118
113
|
|
|
119
114
|
elif storage_type == "sqlite":
|
|
120
115
|
from letta.agent_store.db import SQLLiteStorageConnector
|
{letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/cli/cli.py
RENAMED
|
@@ -171,7 +171,6 @@ def run(
|
|
|
171
171
|
# printd("State path:", agent_config.save_state_dir())
|
|
172
172
|
# printd("Persistent manager path:", agent_config.save_persistence_manager_dir())
|
|
173
173
|
# printd("Index path:", agent_config.save_agent_index_dir())
|
|
174
|
-
# persistence_manager = LocalStateManager(agent_config).load() # TODO: implement load
|
|
175
174
|
# TODO: load prior agent state
|
|
176
175
|
|
|
177
176
|
# Allow overriding model specifics (model, model wrapper, model endpoint IP + type, context_window)
|
|
@@ -3054,16 +3054,13 @@ class LocalClient(AbstractClient):
|
|
|
3054
3054
|
|
|
3055
3055
|
# recall memory
|
|
3056
3056
|
|
|
3057
|
-
def get_messages(
|
|
3058
|
-
self, agent_id: str, before: Optional[str] = None, after: Optional[str] = None, limit: Optional[int] = 1000
|
|
3059
|
-
) -> List[Message]:
|
|
3057
|
+
def get_messages(self, agent_id: str, cursor: Optional[str] = None, limit: Optional[int] = 1000) -> List[Message]:
|
|
3060
3058
|
"""
|
|
3061
3059
|
Get messages from an agent with pagination.
|
|
3062
3060
|
|
|
3063
3061
|
Args:
|
|
3064
3062
|
agent_id (str): ID of the agent
|
|
3065
|
-
|
|
3066
|
-
after (str): Get messages after a certain time
|
|
3063
|
+
cursor (str): Get messages after a certain time
|
|
3067
3064
|
limit (int): Limit number of messages
|
|
3068
3065
|
|
|
3069
3066
|
Returns:
|
|
@@ -3074,8 +3071,7 @@ class LocalClient(AbstractClient):
|
|
|
3074
3071
|
return self.server.get_agent_recall_cursor(
|
|
3075
3072
|
user_id=self.user_id,
|
|
3076
3073
|
agent_id=agent_id,
|
|
3077
|
-
|
|
3078
|
-
after=after,
|
|
3074
|
+
cursor=cursor,
|
|
3079
3075
|
limit=limit,
|
|
3080
3076
|
reverse=True,
|
|
3081
3077
|
)
|
{letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/constants.py
RENAMED
|
@@ -38,6 +38,7 @@ DEFAULT_PRESET = "memgpt_chat"
|
|
|
38
38
|
|
|
39
39
|
# Base tools that cannot be edited, as they access agent state directly
|
|
40
40
|
BASE_TOOLS = ["send_message", "conversation_search", "conversation_search_date", "archival_memory_insert", "archival_memory_search"]
|
|
41
|
+
O1_BASE_TOOLS = ["send_thinking_message", "send_final_message"]
|
|
41
42
|
# Base memory tools CAN be edited, and are added by default by the server
|
|
42
43
|
BASE_MEMORY_TOOLS = ["core_memory_append", "core_memory_replace"]
|
|
43
44
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
from datetime import datetime
|
|
1
2
|
from typing import Optional
|
|
2
3
|
|
|
3
4
|
from letta.agent import Agent
|
|
@@ -38,7 +39,7 @@ Returns:
|
|
|
38
39
|
"""
|
|
39
40
|
|
|
40
41
|
|
|
41
|
-
def pause_heartbeats(self: Agent, minutes: int) -> Optional[str]:
|
|
42
|
+
def pause_heartbeats(self: "Agent", minutes: int) -> Optional[str]:
|
|
42
43
|
import datetime
|
|
43
44
|
|
|
44
45
|
from letta.constants import MAX_PAUSE_HEARTBEATS
|
|
@@ -80,7 +81,15 @@ def conversation_search(self: "Agent", query: str, page: Optional[int] = 0) -> O
|
|
|
80
81
|
except:
|
|
81
82
|
raise ValueError(f"'page' argument must be an integer")
|
|
82
83
|
count = RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
|
|
83
|
-
|
|
84
|
+
# TODO: add paging by page number. currently cursor only works with strings.
|
|
85
|
+
# original: start=page * count
|
|
86
|
+
results = self.message_manager.list_user_messages_for_agent(
|
|
87
|
+
agent_id=self.agent_state.id,
|
|
88
|
+
actor=self.user,
|
|
89
|
+
query_text=query,
|
|
90
|
+
limit=count,
|
|
91
|
+
)
|
|
92
|
+
total = len(results)
|
|
84
93
|
num_pages = math.ceil(total / count) - 1 # 0 index
|
|
85
94
|
if len(results) == 0:
|
|
86
95
|
results_str = f"No results found."
|
|
@@ -112,10 +121,29 @@ def conversation_search_date(self: "Agent", start_date: str, end_date: str, page
|
|
|
112
121
|
page = 0
|
|
113
122
|
try:
|
|
114
123
|
page = int(page)
|
|
124
|
+
if page < 0:
|
|
125
|
+
raise ValueError
|
|
115
126
|
except:
|
|
116
127
|
raise ValueError(f"'page' argument must be an integer")
|
|
128
|
+
|
|
129
|
+
# Convert date strings to datetime objects
|
|
130
|
+
try:
|
|
131
|
+
start_datetime = datetime.strptime(start_date, "%Y-%m-%d").replace(hour=0, minute=0, second=0, microsecond=0)
|
|
132
|
+
end_datetime = datetime.strptime(end_date, "%Y-%m-%d").replace(hour=23, minute=59, second=59, microsecond=999999)
|
|
133
|
+
except ValueError:
|
|
134
|
+
raise ValueError("Dates must be in the format 'YYYY-MM-DD'")
|
|
135
|
+
|
|
117
136
|
count = RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
|
|
118
|
-
results
|
|
137
|
+
results = self.message_manager.list_user_messages_for_agent(
|
|
138
|
+
# TODO: add paging by page number. currently cursor only works with strings.
|
|
139
|
+
agent_id=self.agent_state.id,
|
|
140
|
+
actor=self.user,
|
|
141
|
+
start_date=start_datetime,
|
|
142
|
+
end_date=end_datetime,
|
|
143
|
+
limit=count,
|
|
144
|
+
# start_date=start_date, end_date=end_date, limit=count, start=page * count
|
|
145
|
+
)
|
|
146
|
+
total = len(results)
|
|
119
147
|
num_pages = math.ceil(total / count) - 1 # 0 index
|
|
120
148
|
if len(results) == 0:
|
|
121
149
|
results_str = f"No results found."
|
|
@@ -136,7 +164,7 @@ def archival_memory_insert(self: "Agent", content: str) -> Optional[str]:
|
|
|
136
164
|
Returns:
|
|
137
165
|
Optional[str]: None is always returned as this function does not produce a response.
|
|
138
166
|
"""
|
|
139
|
-
self.
|
|
167
|
+
self.archival_memory.insert(content)
|
|
140
168
|
return None
|
|
141
169
|
|
|
142
170
|
|
|
@@ -163,7 +191,7 @@ def archival_memory_search(self: "Agent", query: str, page: Optional[int] = 0) -
|
|
|
163
191
|
except:
|
|
164
192
|
raise ValueError(f"'page' argument must be an integer")
|
|
165
193
|
count = RETRIEVAL_QUERY_DEFAULT_PAGE_SIZE
|
|
166
|
-
results, total = self.
|
|
194
|
+
results, total = self.archival_memory.search(query, count=count, start=page * count)
|
|
167
195
|
num_pages = math.ceil(total / count) - 1 # 0 index
|
|
168
196
|
if len(results) == 0:
|
|
169
197
|
results_str = f"No results found."
|
{letta_nightly-0.6.1.dev20241206104246 → letta_nightly-0.6.1.dev20241207104149}/letta/main.py
RENAMED
|
@@ -190,8 +190,8 @@ def run_agent_loop(
|
|
|
190
190
|
elif user_input.lower() == "/memory":
|
|
191
191
|
print(f"\nDumping memory contents:\n")
|
|
192
192
|
print(f"{letta_agent.agent_state.memory.compile()}")
|
|
193
|
-
print(f"{letta_agent.
|
|
194
|
-
print(f"{letta_agent.
|
|
193
|
+
print(f"{letta_agent.archival_memory.compile()}")
|
|
194
|
+
print(f"{letta_agent.recall_memory.compile()}")
|
|
195
195
|
continue
|
|
196
196
|
|
|
197
197
|
elif user_input.lower() == "/model":
|