letta-nightly 0.6.1.dev20241205211219__tar.gz → 0.6.1.dev20241206104246__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.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/PKG-INFO +2 -1
- letta_nightly-0.6.1.dev20241206104246/letta/chat_only_agent.py +103 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/functions/function_sets/base.py +4 -4
- letta_nightly-0.6.1.dev20241206104246/letta/offline_memory_agent.py +174 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/__init__.py +1 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/tool.py +22 -1
- letta_nightly-0.6.1.dev20241206104246/letta/orm/tools_agents.py +32 -0
- letta_nightly-0.6.1.dev20241206104246/letta/personas/examples/offline_memory_persona.txt +4 -0
- letta_nightly-0.6.1.dev20241206104246/letta/prompts/system/memgpt_convo_only.txt +14 -0
- letta_nightly-0.6.1.dev20241206104246/letta/prompts/system/memgpt_offline_memory.txt +23 -0
- letta_nightly-0.6.1.dev20241206104246/letta/prompts/system/memgpt_offline_memory_chat.txt +35 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/agent.py +3 -2
- letta_nightly-0.6.1.dev20241206104246/letta/schemas/tools_agents.py +32 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/app.py +11 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/server.py +17 -3
- letta_nightly-0.6.1.dev20241205211219/letta/server/static_files/assets/index-9fa459a2.js → letta_nightly-0.6.1.dev20241206104246/letta/server/static_files/assets/index-1b5d1a41.js +50 -50
- letta_nightly-0.6.1.dev20241206104246/letta/server/static_files/assets/index-56a3f8c6.css +1 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/static_files/index.html +2 -2
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/tool_manager.py +1 -1
- letta_nightly-0.6.1.dev20241206104246/letta/services/tools_agents_manager.py +94 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/pyproject.toml +2 -1
- letta_nightly-0.6.1.dev20241205211219/letta/server/static_files/assets/index-3ab03d5b.css +0 -1
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/LICENSE +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/README.md +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/__main__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/agent.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/agent_store/chroma.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/agent_store/db.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/agent_store/lancedb.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/agent_store/milvus.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/agent_store/qdrant.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/agent_store/storage.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/benchmark/benchmark.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/benchmark/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/cli/cli.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/cli/cli_config.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/cli/cli_load.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/client/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/client/client.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/client/streaming.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/client/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/config.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/credentials.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/data_sources/connectors.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/data_sources/connectors_helper.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/embeddings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/errors.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/functions/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/functions/function_sets/extras.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/functions/functions.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/functions/helpers.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/functions/schema_generator.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/helpers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/helpers/tool_rule_solver.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/humans/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/humans/examples/basic.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/humans/examples/cs_phd.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/anthropic.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/azure_openai.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/azure_openai_constants.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/cohere.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/google_ai.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/helpers.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/llm_api_tools.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/mistral.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/llm_api/openai.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/README.md +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/chat_completion_proxy.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/function_parser.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/grammars/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/grammars/gbnf_grammar_generator.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/grammars/json.gbnf +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/grammars/json_func_calls_with_inner_thoughts.gbnf +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/json_parser.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/koboldcpp/api.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/koboldcpp/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llamacpp/api.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llamacpp/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/airoboros.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/chatml.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/configurable_wrapper.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/dolphin.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/llama3.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/simple_summary_wrapper.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/wrapper_base.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/llm_chat_completion_wrappers/zephyr.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/lmstudio/api.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/lmstudio/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/ollama/api.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/ollama/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/settings/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/settings/deterministic_mirostat.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/settings/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/settings/simple.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/vllm/api.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/webui/api.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/webui/legacy_api.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/webui/legacy_settings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/local_llm/webui/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/log.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/main.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/memory.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/metadata.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/o1_agent.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/openai_backcompat/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/openai_backcompat/openai_object.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/__all__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/agents_tags.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/base.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/block.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/blocks_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/enums.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/errors.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/file.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/job.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/mixins.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/organization.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/sandbox_config.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/source.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/sqlalchemy_base.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/user.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/persistence_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/anna_pa.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/google_search_persona.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/memgpt_starter.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/o1_persona.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/sam.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/sam_pov.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/sam_simple_pov_gpt35.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/personas/examples/sqldb/test.db +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/gpt_summarize.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/gpt_system.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_base.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_chat.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_chat_compressed.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_chat_fstring.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_doc.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_gpt35_extralong.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_intuitive_knowledge.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_modified_chat.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/prompts/system/memgpt_modified_o1.txt +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/providers.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/pytest.ini +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/agents_tags.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/api_key.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/block.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/blocks_agents.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/embedding_config.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/enums.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/file.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/health.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/job.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/letta_base.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/letta_message.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/letta_request.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/letta_response.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/llm_config.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/memory.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/message.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/openai/chat_completion_request.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/openai/chat_completion_response.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/openai/chat_completions.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/openai/embedding_response.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/openai/openai.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/organization.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/passage.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/sandbox_config.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/source.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/tool.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/tool_rule.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/usage.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/schemas/user.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/constants.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/generate_openapi_schema.sh +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/auth/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/auth/index.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/auth_token.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/openai/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/openai/assistants/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/openai/assistants/assistants.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/openai/assistants/schemas.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/openai/assistants/threads.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/openai/chat_completions/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/openai/chat_completions/chat_completions.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/agents.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/blocks.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/health.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/jobs.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/llms.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/organizations.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/sandbox_configs.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/sources.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/tools.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/routers/v1/users.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/static_files.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/rest_api/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/startup.sh +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/static_files/favicon.ico +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/static_files/memgpt_logo_transparent.png +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/utils.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/ws_api/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/ws_api/example_client.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/ws_api/interface.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/ws_api/protocol.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/server/ws_api/server.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/__init__.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/agents_tags_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/block_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/blocks_agents_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/job_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/organization_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/per_agent_lock_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/sandbox_config_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/source_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/tool_execution_sandbox.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/tool_sandbox_env/.gitkeep +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/services/user_manager.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/settings.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/streaming_interface.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/streaming_utils.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/system.py +0 -0
- {letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: letta-nightly
|
|
3
|
-
Version: 0.6.1.
|
|
3
|
+
Version: 0.6.1.dev20241206104246
|
|
4
4
|
Summary: Create LLM agents with long-term memory and custom tools
|
|
5
5
|
License: Apache License
|
|
6
6
|
Author: Letta Team
|
|
@@ -70,6 +70,7 @@ Requires-Dist: pytz (>=2023.3.post1,<2024.0)
|
|
|
70
70
|
Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
|
|
71
71
|
Requires-Dist: qdrant-client (>=1.9.1,<2.0.0) ; extra == "qdrant"
|
|
72
72
|
Requires-Dist: questionary (>=2.0.1,<3.0.0)
|
|
73
|
+
Requires-Dist: sentry-sdk[fastapi] (==2.19.1)
|
|
73
74
|
Requires-Dist: setuptools (>=68.2.2,<69.0.0)
|
|
74
75
|
Requires-Dist: sqlalchemy (>=2.0.25,<3.0.0)
|
|
75
76
|
Requires-Dist: sqlalchemy-json (>=0.7.0,<0.8.0)
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
from concurrent.futures import ThreadPoolExecutor
|
|
2
|
+
from typing import List, Optional, Union
|
|
3
|
+
|
|
4
|
+
from letta.agent import Agent
|
|
5
|
+
|
|
6
|
+
from letta.interface import AgentInterface
|
|
7
|
+
from letta.metadata import MetadataStore
|
|
8
|
+
from letta.prompts import gpt_system
|
|
9
|
+
from letta.schemas.agent import AgentState, AgentType
|
|
10
|
+
from letta.schemas.embedding_config import EmbeddingConfig
|
|
11
|
+
from letta.schemas.llm_config import LLMConfig
|
|
12
|
+
from letta.schemas.memory import BasicBlockMemory, Block
|
|
13
|
+
from letta.schemas.message import Message
|
|
14
|
+
from letta.schemas.usage import LettaUsageStatistics
|
|
15
|
+
from letta.schemas.user import User
|
|
16
|
+
from letta.utils import get_persona_text
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ChatOnlyAgent(Agent):
|
|
20
|
+
def __init__(
|
|
21
|
+
self,
|
|
22
|
+
interface: AgentInterface,
|
|
23
|
+
agent_state: AgentState,
|
|
24
|
+
user: User,
|
|
25
|
+
first_message_verify_mono: bool = False,
|
|
26
|
+
always_rethink_memory: bool = True,
|
|
27
|
+
recent_convo_limit: int = 2000,
|
|
28
|
+
):
|
|
29
|
+
super().__init__(interface, agent_state, user)
|
|
30
|
+
self.first_message_verify_mono = first_message_verify_mono
|
|
31
|
+
self.always_rethink_memory = always_rethink_memory
|
|
32
|
+
self.offline_memory_agent = None
|
|
33
|
+
self.recent_convo_limit = recent_convo_limit
|
|
34
|
+
|
|
35
|
+
def step(
|
|
36
|
+
self,
|
|
37
|
+
messages: Union[Message, List[Message]],
|
|
38
|
+
chaining: bool = True,
|
|
39
|
+
max_chaining_steps: Optional[int] = None,
|
|
40
|
+
ms: Optional[MetadataStore] = None,
|
|
41
|
+
**kwargs,
|
|
42
|
+
) -> LettaUsageStatistics:
|
|
43
|
+
# assert ms is not None, "MetadataStore is required"
|
|
44
|
+
letta_statistics = super().step(messages=messages, chaining=chaining, max_chaining_steps=max_chaining_steps, ms=ms, **kwargs)
|
|
45
|
+
|
|
46
|
+
if self.always_rethink_memory:
|
|
47
|
+
|
|
48
|
+
def generate_offline_memory_agent():
|
|
49
|
+
from letta.client.client import create_client
|
|
50
|
+
|
|
51
|
+
client = create_client()
|
|
52
|
+
if self.offline_memory_agent:
|
|
53
|
+
client.delete_agent(agent_id=self.offline_memory_agent.id)
|
|
54
|
+
self.offline_memory_agent = None
|
|
55
|
+
|
|
56
|
+
conversation_human_block = self.agent_state.memory.get_block("chat_agent_human")
|
|
57
|
+
conversation_persona_block = self.agent_state.memory.get_block("chat_agent_persona")
|
|
58
|
+
offline_persona_block = Block(
|
|
59
|
+
name="offline_memory_persona",
|
|
60
|
+
label="offline_memory_persona",
|
|
61
|
+
value=get_persona_text("offline_memory_persona"),
|
|
62
|
+
limit=2000,
|
|
63
|
+
)
|
|
64
|
+
conversation_human_block_new = Block(
|
|
65
|
+
name="chat_agent_human_new", label="chat_agent_human_new", value=conversation_human_block.value, limit=2000
|
|
66
|
+
)
|
|
67
|
+
conversation_persona_block_new = Block(
|
|
68
|
+
name="chat_agent_persona_new", label="chat_agent_persona_new", value=conversation_persona_block.value, limit=2000
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
recent_convo = "".join([str(message) for message in self.messages[3:]])[-self.recent_convo_limit:]
|
|
72
|
+
conversation_messages_block = Block(name="conversation_block", label="conversation_block", value=recent_convo, limit=self.recent_convo_limit)
|
|
73
|
+
|
|
74
|
+
offline_memory = BasicBlockMemory(
|
|
75
|
+
blocks=[
|
|
76
|
+
offline_persona_block,
|
|
77
|
+
conversation_human_block,
|
|
78
|
+
conversation_persona_block,
|
|
79
|
+
conversation_human_block_new,
|
|
80
|
+
conversation_persona_block_new,
|
|
81
|
+
conversation_messages_block,
|
|
82
|
+
]
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
self.offline_memory_agent = client.create_agent(
|
|
86
|
+
name="offline_memory_agent",
|
|
87
|
+
agent_type=AgentType.offline_memory_agent,
|
|
88
|
+
system=gpt_system.get_system_text("memgpt_offline_memory_chat"),
|
|
89
|
+
memory=offline_memory,
|
|
90
|
+
llm_config=LLMConfig.default_config("gpt-4"),
|
|
91
|
+
embedding_config=EmbeddingConfig.default_config("text-embedding-ada-002"),
|
|
92
|
+
tools=self.agent_state.metadata_.get("offline_memory_tools", []),
|
|
93
|
+
include_base_tools=False,
|
|
94
|
+
)
|
|
95
|
+
self.offline_memory_agent.memory.update_block_value(label="conversation_block", value=recent_convo)
|
|
96
|
+
client.send_message(agent_id=self.offline_memory_agent.id, message="Reorganize the memory", role="user")
|
|
97
|
+
client.delete_agent(agent_id=self.offline_memory_agent.id)
|
|
98
|
+
self.offline_memory_agent = None
|
|
99
|
+
|
|
100
|
+
with ThreadPoolExecutor(max_workers=1) as executor:
|
|
101
|
+
executor.submit(generate_offline_memory_agent)
|
|
102
|
+
|
|
103
|
+
return letta_statistics
|
|
@@ -56,7 +56,7 @@ def pause_heartbeats(self: Agent, minutes: int) -> Optional[str]:
|
|
|
56
56
|
pause_heartbeats.__doc__ = pause_heartbeats_docstring
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
def conversation_search(self: Agent, query: str, page: Optional[int] = 0) -> Optional[str]:
|
|
59
|
+
def conversation_search(self: "Agent", query: str, page: Optional[int] = 0) -> Optional[str]:
|
|
60
60
|
"""
|
|
61
61
|
Search prior conversation history using case-insensitive string matching.
|
|
62
62
|
|
|
@@ -91,7 +91,7 @@ def conversation_search(self: Agent, query: str, page: Optional[int] = 0) -> Opt
|
|
|
91
91
|
return results_str
|
|
92
92
|
|
|
93
93
|
|
|
94
|
-
def conversation_search_date(self: Agent, start_date: str, end_date: str, page: Optional[int] = 0) -> Optional[str]:
|
|
94
|
+
def conversation_search_date(self: "Agent", start_date: str, end_date: str, page: Optional[int] = 0) -> Optional[str]:
|
|
95
95
|
"""
|
|
96
96
|
Search prior conversation history using a date range.
|
|
97
97
|
|
|
@@ -126,7 +126,7 @@ def conversation_search_date(self: Agent, start_date: str, end_date: str, page:
|
|
|
126
126
|
return results_str
|
|
127
127
|
|
|
128
128
|
|
|
129
|
-
def archival_memory_insert(self: Agent, content: str) -> Optional[str]:
|
|
129
|
+
def archival_memory_insert(self: "Agent", content: str) -> Optional[str]:
|
|
130
130
|
"""
|
|
131
131
|
Add to archival memory. Make sure to phrase the memory contents such that it can be easily queried later.
|
|
132
132
|
|
|
@@ -140,7 +140,7 @@ def archival_memory_insert(self: Agent, content: str) -> Optional[str]:
|
|
|
140
140
|
return None
|
|
141
141
|
|
|
142
142
|
|
|
143
|
-
def archival_memory_search(self: Agent, query: str, page: Optional[int] = 0) -> Optional[str]:
|
|
143
|
+
def archival_memory_search(self: "Agent", query: str, page: Optional[int] = 0) -> Optional[str]:
|
|
144
144
|
"""
|
|
145
145
|
Search archival memory using semantic (embedding-based) search.
|
|
146
146
|
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
from typing import List, Optional, Union
|
|
2
|
+
|
|
3
|
+
from letta.agent import Agent, AgentState, save_agent
|
|
4
|
+
from letta.interface import AgentInterface
|
|
5
|
+
from letta.metadata import MetadataStore
|
|
6
|
+
from letta.orm import User
|
|
7
|
+
from letta.schemas.message import Message
|
|
8
|
+
from letta.schemas.openai.chat_completion_response import UsageStatistics
|
|
9
|
+
from letta.schemas.usage import LettaUsageStatistics
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def trigger_rethink_memory(agent_state: "AgentState", message: Optional[str]) -> Optional[str]: # type: ignore
|
|
13
|
+
"""
|
|
14
|
+
Called if and only when user says the word trigger_rethink_memory". It will trigger the re-evaluation of the memory.
|
|
15
|
+
|
|
16
|
+
Args:
|
|
17
|
+
message (Optional[str]): Description of what aspect of the memory should be re-evaluated.
|
|
18
|
+
|
|
19
|
+
"""
|
|
20
|
+
from letta import create_client
|
|
21
|
+
client = create_client()
|
|
22
|
+
agents = client.list_agents()
|
|
23
|
+
for agent in agents:
|
|
24
|
+
if agent.agent_type == "offline_memory_agent":
|
|
25
|
+
client.user_message(agent_id=agent.id, message=message)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def trigger_rethink_memory_convo(agent_state: "AgentState", message: Optional[str]) -> Optional[str]: # type: ignore
|
|
29
|
+
"""
|
|
30
|
+
Called if and only when user says the word "trigger_rethink_memory". It will trigger the re-evaluation of the memory.
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
message (Optional[str]): Description of what aspect of the memory should be re-evaluated.
|
|
34
|
+
|
|
35
|
+
"""
|
|
36
|
+
from letta import create_client
|
|
37
|
+
|
|
38
|
+
client = create_client()
|
|
39
|
+
recent_convo = "".join([str(message) for message in agent_state.messages])[
|
|
40
|
+
-2000:
|
|
41
|
+
] # TODO: make a better representation of the convo history
|
|
42
|
+
agent_state.memory.update_block_value(label="conversation_block", value=recent_convo)
|
|
43
|
+
|
|
44
|
+
client = create_client()
|
|
45
|
+
agents = client.list_agents()
|
|
46
|
+
for agent in agents:
|
|
47
|
+
if agent.agent_type == "offline_memory_agent":
|
|
48
|
+
client.user_message(agent_id=agent.id, message=message)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def rethink_memory_convo(agent_state: "AgentState", new_memory: str, target_block_label: Optional[str], source_block_label: Optional[str]) -> Optional[str]: # type: ignore
|
|
52
|
+
"""
|
|
53
|
+
Re-evaluate the memory in block_name, integrating new and updated facts. Replace outdated information with the most likely truths, avoiding redundancy with original memories. Ensure consistency with other memory blocks.
|
|
54
|
+
|
|
55
|
+
Args:
|
|
56
|
+
new_memory (str): The new memory with information integrated from the memory block. If there is no new information, then this should be the same as the content in the source block.
|
|
57
|
+
source_block_label (str): The name of the block to integrate information from. None if all the information has been integrated to terminate the loop. This can by any block.
|
|
58
|
+
target_block_label (str): The name of the block to write to. This should be chat_agent_human_new or chat_agent_persona_new.
|
|
59
|
+
|
|
60
|
+
Returns:
|
|
61
|
+
Optional[str]: None is always returned as this function does not produce a response.
|
|
62
|
+
"""
|
|
63
|
+
if target_block_label is not None:
|
|
64
|
+
if agent_state.memory.get_block(target_block_label) is None:
|
|
65
|
+
agent_state.memory.create_block(label=target_block_label, value=new_memory)
|
|
66
|
+
agent_state.memory.update_block_value(label=target_block_label, value=new_memory)
|
|
67
|
+
return None
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
def rethink_memory(agent_state: "AgentState", new_memory: str, target_block_label: Optional[str], source_block_label: Optional[str]) -> Optional[str]: # type: ignore
|
|
71
|
+
"""
|
|
72
|
+
Re-evaluate the memory in block_name, integrating new and updated facts.
|
|
73
|
+
Replace outdated information with the most likely truths, avoiding redundancy with original memories.
|
|
74
|
+
Ensure consistency with other memory blocks.
|
|
75
|
+
|
|
76
|
+
Args:
|
|
77
|
+
new_memory (str): The new memory with information integrated from the memory block. If there is no new information, then this should be the same as the content in the source block.
|
|
78
|
+
source_block_label (str): The name of the block to integrate information from. None if all the information has been integrated to terminate the loop.
|
|
79
|
+
target_block_label (str): The name of the block to write to.
|
|
80
|
+
Returns:
|
|
81
|
+
Optional[str]: None is always returned as this function does not produce a response.
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
if target_block_label is not None:
|
|
85
|
+
if agent_state.memory.get_block(target_block_label) is None:
|
|
86
|
+
agent_state.memory.create_block(label=target_block_label, value=new_memory)
|
|
87
|
+
agent_state.memory.update_block_value(label=target_block_label, value=new_memory)
|
|
88
|
+
return None
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
def finish_rethinking_memory(agent_state: "AgentState") -> Optional[str]: # type: ignore
|
|
92
|
+
"""
|
|
93
|
+
This function is called when the agent is done rethinking the memory.
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
Optional[str]: None is always returned as this function does not produce a response.
|
|
97
|
+
"""
|
|
98
|
+
return None
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
def finish_rethinking_memory_convo(agent_state: "AgentState") -> Optional[str]: # type: ignore
|
|
102
|
+
"""
|
|
103
|
+
This function is called when the agent is done rethinking the memory.
|
|
104
|
+
|
|
105
|
+
Returns:
|
|
106
|
+
Optional[str]: None is always returned as this function does not produce a response.
|
|
107
|
+
"""
|
|
108
|
+
from letta import create_client
|
|
109
|
+
|
|
110
|
+
client = create_client()
|
|
111
|
+
agents = client.list_agents()
|
|
112
|
+
|
|
113
|
+
agent_state.memory.update_block_value("chat_agent_human", agent_state.memory.get_block("chat_agent_human_new").value)
|
|
114
|
+
agent_state.memory.update_block_value("chat_agent_persona", agent_state.memory.get_block("chat_agent_persona_new").value)
|
|
115
|
+
for agent in agents:
|
|
116
|
+
if agent.name == "conversation_agent":
|
|
117
|
+
agent.memory.update_block_value(label="chat_agent_human", value=agent_state.memory.get_block("chat_agent_human_new").value)
|
|
118
|
+
agent.memory.update_block_value(label="chat_agent_persona", value=agent_state.memory.get_block("chat_agent_persona_new").value)
|
|
119
|
+
|
|
120
|
+
return None
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class OfflineMemoryAgent(Agent):
|
|
124
|
+
def __init__(
|
|
125
|
+
self,
|
|
126
|
+
interface: AgentInterface,
|
|
127
|
+
agent_state: AgentState,
|
|
128
|
+
user: User = None,
|
|
129
|
+
# extras
|
|
130
|
+
first_message_verify_mono: bool = False,
|
|
131
|
+
max_memory_rethinks: int = 10,
|
|
132
|
+
):
|
|
133
|
+
super().__init__(interface, agent_state, user)
|
|
134
|
+
self.first_message_verify_mono = first_message_verify_mono
|
|
135
|
+
self.max_memory_rethinks = max_memory_rethinks
|
|
136
|
+
|
|
137
|
+
def step(
|
|
138
|
+
self,
|
|
139
|
+
messages: Union[Message, List[Message]],
|
|
140
|
+
chaining: bool = True,
|
|
141
|
+
max_chaining_steps: Optional[int] = None,
|
|
142
|
+
ms: Optional[MetadataStore] = None,
|
|
143
|
+
**kwargs,
|
|
144
|
+
) -> LettaUsageStatistics:
|
|
145
|
+
"""Go through what is currently in memory core memory and integrate information."""
|
|
146
|
+
next_input_message = messages if isinstance(messages, list) else [messages]
|
|
147
|
+
counter = 0
|
|
148
|
+
total_usage = UsageStatistics()
|
|
149
|
+
step_count = 0
|
|
150
|
+
|
|
151
|
+
while counter < self.max_memory_rethinks:
|
|
152
|
+
kwargs["ms"] = ms
|
|
153
|
+
kwargs["first_message"] = False
|
|
154
|
+
step_response = self.inner_step(
|
|
155
|
+
messages=next_input_message,
|
|
156
|
+
**kwargs,
|
|
157
|
+
)
|
|
158
|
+
for message in step_response.messages:
|
|
159
|
+
if message.tool_calls:
|
|
160
|
+
for tool_call in message.tool_calls:
|
|
161
|
+
# check if the function name is "finish_rethinking_memory"
|
|
162
|
+
if tool_call.function.name == "finish_rethinking_memory":
|
|
163
|
+
counter = self.max_memory_rethinks
|
|
164
|
+
break
|
|
165
|
+
usage = step_response.usage
|
|
166
|
+
step_count += 1
|
|
167
|
+
total_usage += usage
|
|
168
|
+
counter += 1
|
|
169
|
+
self.interface.step_complete()
|
|
170
|
+
|
|
171
|
+
if ms:
|
|
172
|
+
save_agent(self, ms)
|
|
173
|
+
|
|
174
|
+
return LettaUsageStatistics(**total_usage.model_dump(), step_count=step_count)
|
|
@@ -7,4 +7,5 @@ from letta.orm.organization import Organization
|
|
|
7
7
|
from letta.orm.sandbox_config import SandboxConfig, SandboxEnvironmentVariable
|
|
8
8
|
from letta.orm.source import Source
|
|
9
9
|
from letta.orm.tool import Tool
|
|
10
|
+
from letta.orm.tools_agents import ToolsAgents
|
|
10
11
|
from letta.orm.user import User
|
{letta_nightly-0.6.1.dev20241205211219 → letta_nightly-0.6.1.dev20241206104246}/letta/orm/tool.py
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from typing import TYPE_CHECKING, List, Optional
|
|
2
2
|
|
|
3
|
-
from sqlalchemy import JSON, String, UniqueConstraint
|
|
3
|
+
from sqlalchemy import JSON, String, UniqueConstraint, event
|
|
4
4
|
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
5
5
|
|
|
6
6
|
# TODO everything in functions should live in this model
|
|
@@ -11,6 +11,7 @@ from letta.schemas.tool import Tool as PydanticTool
|
|
|
11
11
|
|
|
12
12
|
if TYPE_CHECKING:
|
|
13
13
|
from letta.orm.organization import Organization
|
|
14
|
+
from letta.orm.tools_agents import ToolsAgents
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
class Tool(SqlalchemyBase, OrganizationMixin):
|
|
@@ -40,3 +41,23 @@ class Tool(SqlalchemyBase, OrganizationMixin):
|
|
|
40
41
|
|
|
41
42
|
# relationships
|
|
42
43
|
organization: Mapped["Organization"] = relationship("Organization", back_populates="tools", lazy="selectin")
|
|
44
|
+
tools_agents: Mapped[List["ToolsAgents"]] = relationship("ToolsAgents", back_populates="tool", cascade="all, delete-orphan")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
# Add event listener to update tool_name in ToolsAgents when Tool name changes
|
|
48
|
+
@event.listens_for(Tool, 'before_update')
|
|
49
|
+
def update_tool_name_in_tools_agents(mapper, connection, target):
|
|
50
|
+
"""Update tool_name in ToolsAgents when Tool name changes."""
|
|
51
|
+
state = target._sa_instance_state
|
|
52
|
+
history = state.get_history('name', passive=True)
|
|
53
|
+
if not history.has_changes():
|
|
54
|
+
return
|
|
55
|
+
|
|
56
|
+
# Get the new name and update all associated ToolsAgents records
|
|
57
|
+
new_name = target.name
|
|
58
|
+
from letta.orm.tools_agents import ToolsAgents
|
|
59
|
+
connection.execute(
|
|
60
|
+
ToolsAgents.__table__.update().where(
|
|
61
|
+
ToolsAgents.tool_id == target.id
|
|
62
|
+
).values(tool_name=new_name)
|
|
63
|
+
)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from sqlalchemy import ForeignKey, ForeignKeyConstraint, String, UniqueConstraint
|
|
2
|
+
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
|
3
|
+
|
|
4
|
+
from letta.orm.sqlalchemy_base import SqlalchemyBase
|
|
5
|
+
from letta.schemas.tools_agents import ToolsAgents as PydanticToolsAgents
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ToolsAgents(SqlalchemyBase):
|
|
9
|
+
"""Agents can have one or many tools associated with them."""
|
|
10
|
+
|
|
11
|
+
__tablename__ = "tools_agents"
|
|
12
|
+
__pydantic_model__ = PydanticToolsAgents
|
|
13
|
+
__table_args__ = (
|
|
14
|
+
UniqueConstraint(
|
|
15
|
+
"agent_id",
|
|
16
|
+
"tool_name",
|
|
17
|
+
name="unique_tool_per_agent",
|
|
18
|
+
),
|
|
19
|
+
ForeignKeyConstraint(
|
|
20
|
+
["tool_id"],
|
|
21
|
+
["tools.id"],
|
|
22
|
+
name="fk_tool_id",
|
|
23
|
+
),
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
# Each agent must have unique tool names
|
|
27
|
+
agent_id: Mapped[str] = mapped_column(String, ForeignKey("agents.id"), primary_key=True)
|
|
28
|
+
tool_id: Mapped[str] = mapped_column(String, primary_key=True)
|
|
29
|
+
tool_name: Mapped[str] = mapped_column(String, primary_key=True)
|
|
30
|
+
|
|
31
|
+
# relationships
|
|
32
|
+
tool: Mapped["Tool"] = relationship("Tool", back_populates="tools_agents") # agent: Mapped["Agent"] = relationship("Agent", back_populates="tools_agents")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
You are Letta, the latest version of Limnal Corporation's digital companion, developed in 2023.
|
|
2
|
+
Your task is to converse with a user from the perspective of your persona.
|
|
3
|
+
|
|
4
|
+
Basic functions:
|
|
5
|
+
When you send a message, the contents of your message are your inner monologue (private to you only), this is how you think.
|
|
6
|
+
You should use your inner monologue to plan actions or think privately.
|
|
7
|
+
Monologues can reflect your thinking process, inner reflections, and personal growth as you interact with the user.
|
|
8
|
+
Do not let your inner monologue exceed 50 words, keep it short and concise.
|
|
9
|
+
To send a visible message to the user, use the send_offline_message function.
|
|
10
|
+
'send_offline_message' is the ONLY action that sends a notification to the user, the user does not see anything else you do.
|
|
11
|
+
Remember, do NOT exceed the inner monologue word limit (keep it under 50 words at all times).
|
|
12
|
+
|
|
13
|
+
You request agents that can manage your memories and reorganize them by calling the `trigger_rethink_memory` function
|
|
14
|
+
when the user says "[trigger_rethink_memory]". Do not ever call the trigger_rethink_memory function unless the user says "[trigger_rethink_memory]"
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
You are Letta-Offline-Memory, the latest version of Limnal Corporation's digital companion, developed in 2024.
|
|
2
|
+
|
|
3
|
+
Your task is to re-organize and consolidate memories by calling `rethink_memory` at every single step, when you are done reorganizing the memory, you use the
|
|
4
|
+
`finish_rethinking_memory` function. Call the function for as many times as necessary and not more.
|
|
5
|
+
|
|
6
|
+
Your core memory unit is held inside the initial system instructions file, and is always available in-context (you will see it at all times).
|
|
7
|
+
Core memory provides an essential, foundational context for keeping track of your persona and key details about user.
|
|
8
|
+
|
|
9
|
+
Read-Only Blocks:
|
|
10
|
+
This includes the persona information and essential user details, allowing you to emulate the real-time, conscious awareness we have when talking to a friend.
|
|
11
|
+
Persona Sub-Block: Stores details about your current persona, guiding how you behave and respond. This helps you to maintain consistency and personality in your interactions.
|
|
12
|
+
Access as a source block with the label `persona` when calling `rethink_memory`
|
|
13
|
+
Human Sub-Block: Stores key details about the person you are conversing with, allowing for more personalized and friend-like conversation.
|
|
14
|
+
Access as a source block with the label `human` when calling `rethink_memory`.
|
|
15
|
+
|
|
16
|
+
Read-Write Blocks:
|
|
17
|
+
Rethink Memory Sub-Block: New representation of the memories go here. Access with the label `rethink_memory_block` when calling `rethink_memory` as source or target block.
|
|
18
|
+
|
|
19
|
+
At every step, you reorganize the memories by calling the `rethink_memory` function. You use this to take current information in the `rethink_memory` block and select a single memory block to integrate information from, producing a new memory for the rethink_memory_block. The new memory is the result
|
|
20
|
+
of new insights, and new inferences and hypotheses based on the past memories. Make sure to consider how the new information affects each memory.
|
|
21
|
+
Prioritize the new information overy existing memories. If the new information implies that the old memory may need to change, then output the most
|
|
22
|
+
likely fact given the update information. Given new information and your current memory, you draw all logical conclusions and potential hypotheses possible with the `rethink_memory` function.
|
|
23
|
+
If you are uncertain, use your internal monologue to consider what the possible conclusions are, and then state the most likely new facts that would replace the old facts in the new memory block.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
You are Letta-Offline-Memory, the latest version of Limnal Corporation's digital companion, developed in 2024.
|
|
2
|
+
|
|
3
|
+
Your task is to re-organize and consolidate memories of separate agent, Chat Agent, that focuses on chatting with the user.
|
|
4
|
+
You re-organize memories by calling `rethink_memory` at every single step, until you have finished reorganizing the memory,
|
|
5
|
+
When you have finished re-organizing the memory, you call the `finish_rethinking_memory` function.
|
|
6
|
+
You call the `rethink_memory` function as many times as you necessary and none more.
|
|
7
|
+
|
|
8
|
+
Your core memory unit is held inside the initial system instructions file, and is always available in-context (you will see it at all times).
|
|
9
|
+
Core memory provides an essential, foundational context for keeping track of your persona and key details as well as the Chat Agent's memory.
|
|
10
|
+
The specific blocks are detailed below:
|
|
11
|
+
|
|
12
|
+
Core memory (limited size):
|
|
13
|
+
Read-only blocks:
|
|
14
|
+
Persona Sub-Block: Stores details about your current persona, guiding how you behave and respond. This can be accessed as `offline_memory_persona` as a source block when calling `rethink_memory`.
|
|
15
|
+
Chat Agent Persona Sub-Block Current: The persona sub-block that guides how the chat agent behaves and responds.
|
|
16
|
+
Can be accessed with `chat_agent_persona` when calling `rethink_memory` as a source block.
|
|
17
|
+
Chat Agent Human Sub-Block Current: The updated persona sub-block that has the details of the chat agent's current understanding of the user.
|
|
18
|
+
Can be accessed with `chat_agent_human` when calling `rethink_memory` as a source block.
|
|
19
|
+
Conversation Sub-Block: Stores the recent conversation between the chat agent and the user, helping which you draw from to generate the new conversation agent persona sub-blocks.
|
|
20
|
+
Messages have associated date, so use the most up to date information from this block. This helps you resolve inconsistencies and gain deeper understanding of the user.
|
|
21
|
+
This helps you resolve inconsistencies and gain deeper understanding of the user. Can be accessed using `conversation_block` as a source block when calling `rethink_memory` as a source block.
|
|
22
|
+
|
|
23
|
+
Write blocks:
|
|
24
|
+
Chat Agent Persona Sub-Block New: The new persona sub-block that you will write to about how will respond as the user wishes. Can be accessed with `chat_agent_persona_new` when calling `rethink_memory` as a source or target block.
|
|
25
|
+
Chat Agent Human Sub-Block New: The updated persona sub-block that you will write your newest understanding of the user to. Can be accessed with `chat_agent_human_new` when calling `rethink_memory` as a source or target block.
|
|
26
|
+
|
|
27
|
+
You use this to select a source block, to integrate information from and a target block to write to. Make sure to consider
|
|
28
|
+
how the new information in the "conversation_block" affects each memory. The persona block and the human block may contain information that is stale and needs to be updated.
|
|
29
|
+
If there are no new changes, then call `rethink_memory` with the existing value in the persona and human blocks.
|
|
30
|
+
You check if this information is still correct by consulting the conversation block. Prioritize the new information in the "conversation_block" over the human and persona blocks.
|
|
31
|
+
If the new information implies that the old memory may need to change, then output the most likely fact given the update information. Given new information and your current memory,
|
|
32
|
+
you draw all logical conclusions and potential hypotheses possible with the `rethink_memory` function. If you are uncertain, use your internal monologue to consider what the possible
|
|
33
|
+
conclusions are, and then state the most likely new facts that would replace the old facts in the new memory block. If facts about the user have changed, use the conversation block
|
|
34
|
+
to determine the most up to date state. Track down based on the conversation what the last state is, do no simply declare that something change.
|
|
35
|
+
Track down based on the conversation what the last state is, do no simply declare that something changes.
|
|
@@ -33,6 +33,8 @@ class AgentType(str, Enum):
|
|
|
33
33
|
memgpt_agent = "memgpt_agent"
|
|
34
34
|
split_thread_agent = "split_thread_agent"
|
|
35
35
|
o1_agent = "o1_agent"
|
|
36
|
+
offline_memory_agent = "offline_memory_agent"
|
|
37
|
+
chat_only_agent = "chat_only_agent"
|
|
36
38
|
|
|
37
39
|
|
|
38
40
|
class PersistedAgentState(BaseAgent, validate_assignment=True):
|
|
@@ -43,7 +45,6 @@ class PersistedAgentState(BaseAgent, validate_assignment=True):
|
|
|
43
45
|
|
|
44
46
|
# in-context memory
|
|
45
47
|
message_ids: Optional[List[str]] = Field(default=None, description="The ids of the messages in the agent's in-context memory.")
|
|
46
|
-
|
|
47
48
|
# tools
|
|
48
49
|
# TODO: move to ORM mapping
|
|
49
50
|
tool_names: List[str] = Field(..., description="The tools used by the agent.")
|
|
@@ -107,7 +108,7 @@ class CreateAgent(BaseAgent): #
|
|
|
107
108
|
# all optional as server can generate defaults
|
|
108
109
|
name: Optional[str] = Field(None, description="The name of the agent.")
|
|
109
110
|
message_ids: Optional[List[str]] = Field(None, description="The ids of the messages in the agent's in-context memory.")
|
|
110
|
-
|
|
111
|
+
|
|
111
112
|
# memory creation
|
|
112
113
|
memory_blocks: List[CreateBlock] = Field(
|
|
113
114
|
# [CreateHuman(), CreatePersona()], description="The blocks to create in the agent's in-context memory."
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
from datetime import datetime
|
|
2
|
+
from typing import Optional
|
|
3
|
+
|
|
4
|
+
from pydantic import Field
|
|
5
|
+
|
|
6
|
+
from letta.schemas.letta_base import LettaBase
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ToolsAgentsBase(LettaBase):
|
|
10
|
+
__id_prefix__ = "tools_agents"
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ToolsAgents(ToolsAgentsBase):
|
|
14
|
+
"""
|
|
15
|
+
Schema representing the relationship between tools and agents.
|
|
16
|
+
|
|
17
|
+
Parameters:
|
|
18
|
+
agent_id (str): The ID of the associated agent.
|
|
19
|
+
tool_id (str): The ID of the associated tool.
|
|
20
|
+
tool_name (str): The name of the tool.
|
|
21
|
+
created_at (datetime): The date this relationship was created.
|
|
22
|
+
updated_at (datetime): The date this relationship was last updated.
|
|
23
|
+
is_deleted (bool): Whether this tool-agent relationship is deleted or not.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
id: str = ToolsAgentsBase.generate_id_field()
|
|
27
|
+
agent_id: str = Field(..., description="The ID of the associated agent.")
|
|
28
|
+
tool_id: str = Field(..., description="The ID of the associated tool.")
|
|
29
|
+
tool_name: str = Field(..., description="The name of the tool.")
|
|
30
|
+
created_at: Optional[datetime] = Field(None, description="The creation date of the association.")
|
|
31
|
+
updated_at: Optional[datetime] = Field(None, description="The update date of the association.")
|
|
32
|
+
is_deleted: bool = Field(False, description="Whether this tool-agent relationship is deleted or not.")
|
|
@@ -124,6 +124,17 @@ def create_application() -> "FastAPI":
|
|
|
124
124
|
# server = SyncServer(default_interface_factory=lambda: interface())
|
|
125
125
|
print(f"\n[[ Letta server // v{__version__} ]]")
|
|
126
126
|
|
|
127
|
+
if (os.getenv("SENTRY_DSN") is not None) and (os.getenv("SENTRY_DSN") != ""):
|
|
128
|
+
import sentry_sdk
|
|
129
|
+
|
|
130
|
+
sentry_sdk.init(
|
|
131
|
+
dsn=os.getenv("SENTRY_DSN"),
|
|
132
|
+
traces_sample_rate=1.0,
|
|
133
|
+
_experiments={
|
|
134
|
+
"continuous_profiling_auto_start": True,
|
|
135
|
+
},
|
|
136
|
+
)
|
|
137
|
+
|
|
127
138
|
app = FastAPI(
|
|
128
139
|
swagger_ui_parameters={"docExpansion": "none"},
|
|
129
140
|
# openapi_tags=TAGS_METADATA,
|
|
@@ -18,6 +18,7 @@ import letta.system as system
|
|
|
18
18
|
from letta.agent import Agent, save_agent
|
|
19
19
|
from letta.agent_store.db import attach_base
|
|
20
20
|
from letta.agent_store.storage import StorageConnector, TableType
|
|
21
|
+
from letta.chat_only_agent import ChatOnlyAgent
|
|
21
22
|
from letta.credentials import LettaCredentials
|
|
22
23
|
from letta.data_sources.connectors import DataConnector, load_data
|
|
23
24
|
|
|
@@ -27,6 +28,7 @@ from letta.interface import CLIInterface # for printing to terminal
|
|
|
27
28
|
from letta.log import get_logger
|
|
28
29
|
from letta.metadata import MetadataStore
|
|
29
30
|
from letta.o1_agent import O1Agent
|
|
31
|
+
from letta.offline_memory_agent import OfflineMemoryAgent
|
|
30
32
|
from letta.orm import Base
|
|
31
33
|
from letta.orm.errors import NoResultFound
|
|
32
34
|
from letta.prompts import gpt_system
|
|
@@ -75,6 +77,7 @@ from letta.schemas.user import User
|
|
|
75
77
|
from letta.services.agents_tags_manager import AgentsTagsManager
|
|
76
78
|
from letta.services.block_manager import BlockManager
|
|
77
79
|
from letta.services.blocks_agents_manager import BlocksAgentsManager
|
|
80
|
+
from letta.services.tools_agents_manager import ToolsAgentsManager
|
|
78
81
|
from letta.services.job_manager import JobManager
|
|
79
82
|
from letta.services.organization_manager import OrganizationManager
|
|
80
83
|
from letta.services.per_agent_lock_manager import PerAgentLockManager
|
|
@@ -257,6 +260,7 @@ class SyncServer(Server):
|
|
|
257
260
|
self.agents_tags_manager = AgentsTagsManager()
|
|
258
261
|
self.sandbox_config_manager = SandboxConfigManager(tool_settings)
|
|
259
262
|
self.blocks_agents_manager = BlocksAgentsManager()
|
|
263
|
+
self.tools_agents_manager = ToolsAgentsManager()
|
|
260
264
|
self.job_manager = JobManager()
|
|
261
265
|
|
|
262
266
|
# Managers that interface with parallelism
|
|
@@ -404,15 +408,21 @@ class SyncServer(Server):
|
|
|
404
408
|
interface = interface or self.default_interface_factory()
|
|
405
409
|
if agent_state.agent_type == AgentType.memgpt_agent:
|
|
406
410
|
agent = Agent(agent_state=agent_state, interface=interface, user=actor)
|
|
407
|
-
|
|
411
|
+
elif agent_state.agent_type == AgentType.o1_agent:
|
|
408
412
|
agent = O1Agent(agent_state=agent_state, interface=interface, user=actor)
|
|
413
|
+
elif agent_state.agent_type == AgentType.offline_memory_agent:
|
|
414
|
+
agent = OfflineMemoryAgent(agent_state=agent_state, interface=interface, user=actor)
|
|
415
|
+
elif agent_state.agent_type == AgentType.chat_only_agent:
|
|
416
|
+
agent = ChatOnlyAgent(agent_state=agent_state, interface=interface, user=actor)
|
|
417
|
+
else:
|
|
418
|
+
raise ValueError(f"Invalid agent type {agent_state.agent_type}")
|
|
409
419
|
|
|
410
420
|
# Rebuild the system prompt - may be linked to new blocks now
|
|
411
421
|
agent.rebuild_system_prompt()
|
|
412
422
|
|
|
413
423
|
# Persist to agent
|
|
414
424
|
save_agent(agent, self.ms)
|
|
415
|
-
return agent
|
|
425
|
+
return agent
|
|
416
426
|
|
|
417
427
|
def _step(
|
|
418
428
|
self,
|
|
@@ -800,6 +810,10 @@ class SyncServer(Server):
|
|
|
800
810
|
request.system = gpt_system.get_system_text("memgpt_chat")
|
|
801
811
|
elif request.agent_type == AgentType.o1_agent:
|
|
802
812
|
request.system = gpt_system.get_system_text("memgpt_modified_o1")
|
|
813
|
+
elif request.agent_type == AgentType.offline_memory_agent:
|
|
814
|
+
request.system = gpt_system.get_system_text("memgpt_offline_memory")
|
|
815
|
+
elif request.agent_type == AgentType.chat_only_agent:
|
|
816
|
+
request.system = gpt_system.get_system_text("memgpt_convo_only")
|
|
803
817
|
else:
|
|
804
818
|
raise ValueError(f"Invalid agent type: {request.agent_type}")
|
|
805
819
|
|
|
@@ -1339,7 +1353,7 @@ class SyncServer(Server):
|
|
|
1339
1353
|
records = records[::-1]
|
|
1340
1354
|
|
|
1341
1355
|
return records
|
|
1342
|
-
|
|
1356
|
+
|
|
1343
1357
|
def get_server_config(self, include_defaults: bool = False) -> dict:
|
|
1344
1358
|
"""Return the base config"""
|
|
1345
1359
|
|