Building a Slack LLM Secretary with Tool Chaining A developer built a Slack-based AI assistant using Open Claw, an AI agent framework, to execute natural language commands through tool chaining. The system integrates session memory and persistent message cursors to avoid reprocessing messages after restarts. The project demonstrates that combining algorithmic programming with LLMs improves accuracy for personal assistant tasks. This will be my second project. AS I know there are three main types of representative AI agents: Claude Code, Open Claw, and Hermes. This time, I attempted to build a small AI assistant utilizing 'Open Claw'. I believe the most powerful aspect of Open Claw is its ability to "bring together and utilize various tools." Although it is not a large project, I intend to leverage this feature to issue commands in natural language and demonstrate that it can "act like a personal assistant." The details are as follows: If you issue a command via the Slack chat window, the AI agent receives the response and executes the command. There are four main types of commands. Let me introduce just three key technologies for implementing this. SELECT TOOLS SCHEMA = { "type": "function", "function": { "name": "select tools", ... "tools": { "type": "array", "items": { "enum": ... }, }, }, } python def describe chain semantics tools : if tools == "TEXT SUMMARY", "PDF CONVERT" : return "요약 내용을 PDF로 생성합니다." if tools == "PDF CONVERT", "TEXT SUMMARY" : return "원본 문서를 PDF로 변환하고, 내용을 요약합니다." ... if previous tool == "TEXT SUMMARY" and last summary: create summary docx last summary, ... 요약본 → PDF else: convert docx to pdf input path, ... 원본 → PDF 3.It has a session memory feature. It can remember past chats. However, that is how the system stores the state. LLM only reads it. I wanted to prevent the project from becoming too large. python def make session key channel id, user id, thread ts=None : if thread ts: return f"{channel id}:{thread ts}" return f"{channel id}:user:{user id}" This involved attempting to retrieve its tools immediately by reading the last conversation within Slack right after stopping and restarting the agent. The cause was that, initially, last seen ts was stored only in memory dict . When the bot is turned off and on again, this value is initialized to {}, and last seen = 0 . Then, the 10 most recent messages in the channel plus thread replies all satisfy the condition ts 0 , so they are processed all at once. The key is to persist the cursor watermark based on the message ID ts . python polling state.py class LastSeenStore: def mark self, channel id, ts : if float ts self.get channel id : self. state channel id = float ts self. save saving disk last seen store = LastSeenStore last seen.json 로드 channel last ts = last seen store.get channel id pending = collect pending messages channel id, channel last ts python def seed channel ... : latest = max Channel Message + replys' ts self. state channel id = latest read cheack So, here is the answer: Save processed Slack message ts to a file by channel and process only subsequent messages. We were able to prove that it is possible to create a decent AI assistant by combining ideas from Slack and OpenClaw I am pleased with the results, as they were much better than expected. The important point is that processing tasks with the help of algorithmic programming, rather than relying too heavily on LLM, helps improve accuracy. Thanks you for reading