r/openclaw • Active • 9d ago

Help Bulk / iterative tasks with LLM classification - how to optimise?

I'm trying to make my OpenClaw do an analysis of my LinkedIn communication history. I'm doing a lot of prospecting, and I wanted the agent to help me to classify which are the genuine leads and which are background noise. I pulled all my LinkedIn conversations (over 5k) and asked the agent to create a process that first filters out all my outbound messages with no answer, and for the messages with answer, to analyse the context and rank/categorise them. I left it for the night and woke up to only 377 of 5k conversations processed. It was supposed to be using Sol 6.1 low thinking (the process design/coordinator - Sol 6.1 high)

Issue #1
The speed it worked at was 46 conversations per hour, this was VERY slow, considering that it didn't filter out the "no answer" ones. I would imagine it would combine a couple of messages and send them via 1 request, or do something else to optimise the process. It didn't, just tried to grind through everything one by one, admitting in the morning that it is a terrible solution (of course it did!).

I know I was lazy of me not defining the process in detail in the beginning, but still OC should be able to figure out the way to do it better.

QUESTION: How do you approach these tasks that require an LLM to grind through many documents/conversations/emails and classify them?
I'm talking thousands or tens of thousands of items where doing them one by one in a session does not make sense. How do I make the model choose the right algorithm, other than telling it exactly what to do?

Issue #2
It plainly ignored my request to filter out messages in a deterministic way using script, when there is no answer to my initial question or a standard "thank you" that you can select from a dropdown. It simply ignored that order and went on doing it all through LLM. I don't think anyone has solution, it's simply the annoying thing LLM/OC does, but maybe someone has some clue?

3 Upvotes

14 comments sorted by

•

u/AutoModerator 9d ago

Welcome to r/openclaw Before posting: • Check the FAQ: https://docs.openclaw.ai/help/faq#faq • Use the right flair • Keep posts respectful and on-topic Need help fast? Discord: https://discord.com/invite/clawd

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/arglarg Member 9d ago

I have done similar work when mining old usenet posts. I gave the agent an api key for jev and let it classify the messages. There was some discussion upfront to specify what I wanted. It worked, even though the experiment itself was only somewhat successful.

1

u/Beautiful_Web_5771 Active 8d ago

were you satisfied with the speed ? what was it ?

1

u/arglarg Member 8d ago

I don't recall how long exactly it took but definitely not enough to sleep over it

1

u/Beautiful_Web_5771 Active 8d ago

ok, I'm "plowing through" though I just found a bunch of tool, hook and other bs errors that OC hangs on. It is a really annoying tool :-.

1

u/arglarg Member 8d ago

I ran it in Hermes, I'm using both

1

u/Budget_Complex_3132 9d ago

The trick that fixed this for me is to never let the agent do the classifying inside its own session. Ask it to write a script that calls the model API directly, then run the script. The agent becomes the guy who builds the machine, not the guy turning the handle 5000 times.

1

u/Beautiful_Web_5771 Active 8d ago

I have that and more actually. It's running a control process in a separate sub session which starts new sub sub sessions with blank context on few items to classify and then I try to ensure that the job doesn't stop on some stupid error so I created a poke/Auto Correction cron loop that checks the process every 30 minutes.

1

u/foninoteam 8d ago

+1 to having it write a script instead of doing it in the session. A few things that saved me on a similar job:

Have the script write each result to a file or a small sqlite table keyed by conversation ID as it goes, and skip IDs that already have a result. Then a crash or rate limit just means you rerun it and it picks up where it stopped.

Hand label 50 to 100 conversations yourself first and run the classifier on only those. If it disagrees with you a lot, fix the prompt or the categories before spending money on 5k.

Only send the last few messages of each thread, not the whole history. Most lead signals are in the last couple of replies, and it cuts tokens a lot. Anything the model marks low confidence goes to a "review" bucket instead of forcing a label.

1

u/Beautiful_Web_5771 Active 8d ago

I always start with separating deterministic activities first trying to limit the volume processed by LLM - but the problem is you have to do it on a really low level, cannot trust that higher level requirements will be implemented properly :-/

1

u/North_KingKong 8d ago

46 an hour sounds like the session context just kept growing. Every conversation it processed stayed in its memory, so each new one got slower and more expensive than the last. Anything over a couple hundred items should never live in one chat session.

1

u/Beautiful_Web_5771 Active 8d ago

either that or it spawned a new session for every one conversation :D ( I specifically said to keep the "manager" and "worker" sub agents separate)

0

u/[deleted] 9d ago

[removed] — view removed comment

1

u/Beautiful_Web_5771 Active 8d ago

Well, in the end this is what I did. But the issue is I had to be very specific and design the algorithm myself. This is not a challenging task to come up with if you're a junior developer with a a basic of algorithmic knowledge if you see the steps that you have to do and which of them can be combined or done in parallel and where is the biggest performance optimization etc. I've spent almost 20 years in database development and I've been doing this stuff daily for number of years so it amazes me how those super smart LLMs cannot come up with the idea themselves. They are basically like people who finished gender studies at college trying to do IT work.