BriefAgent — Devpost Project Sections

=============================================================================

Inspiration

=============================================================================

Every finance, consulting, and strategy team we know has the same problem: their institutional knowledge lives in Slack, but their research happens everywhere else. Before a client meeting or investment committee, someone has to manually open a dozen browser tabs, search through old Slack threads, and spend hours stitching it all together into a brief.

We kept asking: why does no one inside Slack already know what the team has discussed about this topic? Why does research always start from zero?

The Slack Real-Time Search API gave us the answer. For the first time, we could build a tool that pulls what the team already knows — directly from Slack — and combine it with live external data in a single, structured brief. That insight became BriefAgent.

=============================================================================

What it does

=============================================================================

BriefAgent is a Slack AI assistant that generates decision-ready research briefs on any topic — a company, market, policy, or question — in under 30 seconds.

Open BriefAgent from the Slack sidebar, type any topic directly, and it immediately begins researching two sources in parallel: your team's internal Slack messages via the Real-Time Search API, and live external web data via Tavily. Claude synthesizes both into a structured brief covering Executive Summary, Why It Matters, Internal Context, External Context, Key Insights, Risks and Unknowns, Recommendations, and Next Steps.

From there, users refine the brief through natural conversation — "make it shorter", "focus on the risks", "give me a slide-ready version" — using conversation history so Claude makes targeted edits rather than starting over. When satisfied, users export the brief as a professionally formatted PDF or plain TXT file with one click.

=============================================================================

How we built it

=============================================================================

BriefAgent is built on Slack Bolt for Python with Socket Mode, using Slack's Assistant framework to handle the assistant thread lifecycle — including the action_token required by the Real-Time Search API.

The core research pipeline runs in three steps: first, the RTS API (assistant.search.context) pulls relevant internal workspace messages using the user's topic as a keyword. Second, Tavily searches the live web for current market data, news, and competitor information. Third, Claude (claude-sonnet-4-6) synthesizes both sources into a structured brief using a carefully engineered system prompt that enforces analyst-quality tone, formatting, and section structure.

Prompt templates are stored as external .txt files (system_prompt.txt, user_prompt.txt, refinement_prompt.txt) so we can iterate on prompt engineering without touching the codebase. The refinement loop uses conversation history — passing the original request, Claude's first brief, and the user's follow-up as a full message array — so refinements are precise and context-aware.

PDF export is handled by ReportLab, which converts the brief into a professionally formatted document with custom typography, section headers, and BriefAgent branding. In-memory session management (keyed by user_id and thread_ts) tracks each user's active brief and resets cleanly when a new thread is started.

=============================================================================

Challenges we ran into

=============================================================================

The biggest challenge was the Slack Real-Time Search API. The action_token required to call assistant.search.context is only available when a user sends a message inside an assistant thread — not when the thread first opens. This meant we couldn't auto-trigger research on thread start the way we originally designed. We restructured the flow so the first message the user sends becomes the topic itself, which gives us the action_token we need while actually improving the UX.

Getting the assistant thread event system working correctly was also harder than expected. The older app.event() approach for handling assistant_thread_started stopped working in newer versions of Bolt, and the switch to the AsyncAssistant middleware required refactoring significant parts of the event registration layer.

Formatting consistency between Slack's mrkdwn renderer and the ReportLab PDF parser was another challenge — Claude would sometimes produce mixed formatting that rendered correctly in one context but broke in the other. We solved it by enforcing strict formatting rules in the prompt (## headers, bold only) and converting to Slack mrkdwn on the fly before posting to the thread.

=============================================================================

Accomplishments that we're proud of

=============================================================================

The Internal Context section of every brief is what we're most proud of. Watching BriefAgent pull a team's actual prior discussions — supply chain concerns, investment thesis notes, flagged risks — and weave them into a brief alongside live market data is genuinely useful in a way that generic AI search tools aren't. That's the core value proposition working exactly as intended.

We're also proud of the refinement loop. The conversation history approach means Claude understands exactly what it generated and makes surgical edits rather than rewriting everything. "Make it shorter" actually makes it shorter. "Focus on risks" expands only the risks section. That kind of precision took real prompt engineering to get right.

The PDF output quality exceeded our expectations. ReportLab gave us enough control to produce a document that looks like something a junior analyst actually wrote — not an AI dump.

=============================================================================

What we learned

=============================================================================

The Slack Assistant framework is significantly more powerful than the documentation suggests, but it requires building against very specific event lifecycle assumptions that aren't always obvious. The action_token flow, the set_suggested_prompts API, and the difference between say() and chat_postMessage inside an assistant thread all have non-obvious behaviors that cost us meaningful debugging time.

We also learned that prompt engineering for structured output is as important as the underlying model. The same Claude model produces dramatically different results depending on how precisely you specify the output format, section structure, and tone. Moving prompts to external .txt files and building a separate test script to iterate on them without running the full Slack app was one of the best decisions we made — it cut iteration time significantly.

=============================================================================

What's next for BriefAgent

=============================================================================

The most immediate next step is Slack AI integration — using Slack's native AI summarization to pre-process RTS results before they reach Claude. This would clean up raw message text and improve brief quality when internal context is long or noisy.

Beyond that, MCP server integration would allow BriefAgent to expose its research pipeline as callable tools so other agents in the workspace can request briefs programmatically. A sales agent could call BriefAgent's research tool mid-conversation to get a live market brief on a prospect's industry.

Longer term, we see BriefAgent evolving from a single-user research tool into a team research layer — where briefs are shared, annotated, and built on collaboratively inside Slack, with version history tracked through the Canvas API as it matures.

Built With

Share this project:

Updates