diff --git a/.env.example b/.env.example index 342da42..09de300 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,7 @@ # To separate your traces from other application LANGSMITH_PROJECT=memory-graph +# LANGSMITH_API_KEY= +# MODEL= # The following depend on your selected configuration diff --git a/pyproject.toml b/pyproject.toml index bae4c81..4339a24 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,16 +7,18 @@ authors = [ ] readme = "README.md" license = { text = "MIT" } -requires-python = ">=3.9" +requires-python = ">=3.11" dependencies = [ - "langgraph>=0.2.34,<0.3.0", + "langgraph>=0.6.0,<0.7.0", + "langgraph-api>=0.2.109,<0.3.0", # Optional (for selecting different models) "langchain-openai>=0.2.1", "langchain-anthropic>=0.2.1", "langchain>=0.3.8", "langchain-core>=0.3.8", "python-dotenv>=1.0.1", - "langgraph-sdk>=0.1.32", + "langgraph-sdk>=0.2.0", + "langgraph-cli>=0.3.6", ] [project.optional-dependencies] diff --git a/src/memory_agent/configuration.py b/src/memory_agent/configuration.py index 6288ba8..6e92abc 100644 --- a/src/memory_agent/configuration.py +++ b/src/memory_agent/configuration.py @@ -17,7 +17,7 @@ class Configuration: user_id: str = "default" """The ID of the user to remember in the conversation.""" model: Annotated[str, {"__template_metadata__": {"kind": "llm"}}] = field( - default="anthropic/claude-3-5-sonnet-20240620", + default_factory=lambda: os.environ.get("MODEL", "anthropic/claude-3-5-sonnet-20240620"), metadata={ "description": "The name of the language model to use for the agent. " "Should be in the form: provider/model-name." diff --git a/src/memory_agent/graph.py b/src/memory_agent/graph.py index c1ce917..48d4c33 100644 --- a/src/memory_agent/graph.py +++ b/src/memory_agent/graph.py @@ -89,7 +89,7 @@ def route_message(state: State): # Create the graph + all nodes -builder = StateGraph(State, config_schema=configuration.Configuration) +builder = StateGraph(State, context_schema=configuration.Configuration) # Define the flow of the memory extraction process builder.add_node(call_model)