cd /news/ai-agents/building-a-slack-llm-secretary-with-… · home topics ai-agents article
[ARTICLE · art-52220] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

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.

read2 min views1 publishedJul 9, 2026

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.

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).

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!

── more in #ai-agents 4 stories · sorted by recency
── more on @slack 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/building-a-slack-llm…] indexed:0 read:2min 2026-07-09 ·