Chatbot¶
About¶
The chatbot app connects Simmate to a large language model (LLM) using LangChain. It provides an agent with chemistry tools (e.g. looking up CAS numbers) and a table for storing chat history.
Installation¶
-
Add
chatbotto the list of installed Simmate apps with:simmate config add chatbot -
Install the chatbot dependencies in the same environment as Simmate:
uv pip install "simmate[chatbot]" -
Configure your LLM provider in
~/simmate/settings.yaml. The supported providers areOpenAI(via Azure) andGoogle-GenAI. Any other keys are passed directly to the LLM client.chatbot: provider: "Google-GenAI" model: "gemini-2.5-flash-lite" api_key: a1b2c3d4.... temperature: 0 -
Update your database to include custom tables from the app:
simmate database update
Basic Use¶
from simmate.apps.chatbot.agent import get_agent
agent = get_agent()
agent.invoke(
{"messages": [{"role": "user", "content": "What is the CAS for aluminum oxide?"}]}
)