Skip to content

Commit 3b8e8f6

Browse files
committed
*
1 parent 11c4845 commit 3b8e8f6

File tree

1 file changed

+136
-7
lines changed

1 file changed

+136
-7
lines changed

threads.mdx

Lines changed: 136 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,12 @@ Most AI agent development follows a painful pattern:
2727

2828
**Threads eliminates this translation loss.** Domain experts work directly with
2929
agents, training them through conversation, seeing immediate results, and
30-
iterating in real-time.
30+
iterating in real-time. When ready, **eject to code** exports your trained agent
31+
as a complete Modus application.
3132

3233
```text
3334
Traditional: Idea → Requirements → Code → Deploy → Test → Repeat
34-
Threads: Idea → Conversation → Working Agent → Deploy
35+
Threads: Idea → Conversation → Working Agent → Eject to Code
3536
```
3637

3738
## Core concepts
@@ -59,14 +60,14 @@ can:
5960
- Search the web for up-to-date information
6061
- Integrate with custom tools through Model Context Protocol (MCP) servers
6162

62-
### Natural language to production code
63+
### Natural language to deployable code
6364

64-
Everything you build in Threads can be **deployed to production**:
65+
Everything you build in Threads can be **exported as real software**:
6566

6667
- Your agent's personality and instructions
6768
- The tools it has access to
6869
- Its conversation patterns and responses
69-
- Ready-to-deploy Modus applications
70+
- Complete Modus applications through **eject to code**
7071

7172
## Connections
7273

@@ -192,11 +193,11 @@ You: "I want to deploy this agent to handle our GitHub PRs automatically"
192193
Threads: *Agent is now available for deployment through Hypermode*
193194
- Agent configuration and prompts saved
194195
- Tool integrations and permissions configured
195-
- Ready for production deployment
196+
- Ready for deployment
196197
- Accessible through Hypermode's infrastructure
197198
```
198199

199-
Your conversation just became a **production-ready agent**.
200+
Your conversation just became a **deployable agent**.
200201

201202
### Step 4: iterate and enhance
202203

@@ -246,6 +247,134 @@ instruction.
246247
detection to ticket creation, saving hours of manual work while ensuring nothing
247248
falls through the cracks.
248249

250+
## Eject to Code: From Conversation to Deployable Software
251+
252+
Your Code Review Agent works perfectly in Threads—automatically hosted and
253+
maintained. But if you want to hand it off to your development team or integrate
254+
it into larger systems, **eject to code** lets you export everything you built
255+
through natural language as a complete Modus application.
256+
257+
### From Threads to Modus Code
258+
259+
Remember your Code Review Agent that analyzes pull requests and creates Linear
260+
tickets? Here's what that conversation becomes when exported:
261+
262+
```go
263+
// Your Threads conversation becomes this structured agent
264+
type CodeReviewAgent struct {
265+
agents.AgentBase
266+
267+
// Persistent memory - remembers your training
268+
ReviewHistory []CodeReview
269+
TeamPreferences TeamSettings
270+
SecurityRules []SecurityCheck
271+
NamingConventions []NamingRule
272+
}
273+
274+
// Your natural language instructions become system prompts
275+
func (a *CodeReviewAgent) analyzePullRequest(prData string) (*string, error) {
276+
systemPrompt := buildPromptFromThreadsTraining(
277+
a.TeamPreferences, // "Security issues are high priority"
278+
a.NamingConventions, // "Avoid names like 'data1', 'temp_thing'"
279+
a.ReviewHistory, // Learns from previous reviews
280+
)
281+
282+
// AI analysis with your trained context
283+
analysis := model.Invoke(systemPrompt, prData)
284+
285+
// Tool integrations you configured in Connections
286+
for issue := range extractIssues(analysis) {
287+
if issue.Type == "security" {
288+
linearAPI.CreateTicket(issue, priority="High", tag="code-review-bot")
289+
}
290+
}
291+
292+
// State persists across sessions automatically
293+
a.ReviewHistory = append(a.ReviewHistory, newReview)
294+
295+
return formatResponse(analysis, ticketsCreated)
296+
}
297+
298+
// GraphQL API generated automatically
299+
func ReviewPullRequest(agentId string, prData string) (string, error) {
300+
return agents.SendMessage(agentId, "review_pull_request", prData)
301+
}
302+
```
303+
304+
### The Power of Eject to Code
305+
306+
#### **From Conversation to Real Software**
307+
308+
**What you built in Threads:**
309+
310+
- "Check for security issues and suggest better variable names"
311+
- "Create Linear tickets with high priority for security, medium for quality"
312+
- "Tag everything with 'code-review-bot'"
313+
314+
**What gets exported:**
315+
316+
- Complete Modus agent with persistent memory
317+
- Your exact training becomes structured system prompts
318+
- Tool integrations (GitHub, Linear) configured and functional
319+
- GraphQL API ready for deployment
320+
321+
#### **Built on Open Source Modus**
322+
323+
Your exported agent runs on **Modus**, Hypermode's open-source agent runtime:
324+
325+
```bash
326+
# Your agent becomes a standard Modus app
327+
git clone your-exported-agent
328+
cd code-review-agent
329+
modus dev # Local development
330+
modus deploy # Production deployment
331+
```
332+
333+
**Key advantages:**
334+
335+
- **No vendor lock-in**: Your code runs anywhere Modus runs
336+
- **Open source ecosystem**: Extend with community tools and integrations
337+
- **Standard DevOps**: CI/CD, testing, monitoring work normally
338+
- **Full transparency**: Complete visibility into agent behavior
339+
340+
#### **Enterprise-Grade Architecture**
341+
342+
The exported code isn't a prototype—it's enterprise-grade software:
343+
344+
- **Persistent State**: Agent memory survives restarts and failures
345+
- **Concurrency**: Handle thousands of simultaneous operations
346+
- **Sandboxing**: Each agent instance runs in isolation
347+
- **Observability**: Built-in logging, tracing, and debugging
348+
- **Security**: Tool access scoped to agent roles
349+
350+
#### **Developer-Friendly Handoff**
351+
352+
Platform teams get real software they can audit and extend while preserving all
353+
the natural language training from Threads.
354+
355+
### Ready to Build Sophisticated Agents?
356+
357+
**This is just the beginning.** The pseudo-code above shows the concept, but
358+
Modus provides a complete framework for building sophisticated, stateful agents
359+
that scale.
360+
361+
**Your agent works perfectly in Threads.** For many use cases, keeping your
362+
agent hosted automatically in Threads is ideal—it handles deployment, scaling,
363+
and maintenance for you.
364+
365+
**Ready for more control?** If you're looking to hand off to other engineers,
366+
integrate with existing systems, or build coordinated multi-agent workflows, you
367+
can eject to code and get a complete Modus application that your development
368+
team can own, extend, and deploy anywhere.
369+
370+
**Learn more about building agents with Modus:** For complete documentation on
371+
agent development, tool integration, and deployment, visit our
372+
[Developer Documentation](/developers).
373+
374+
**Your Threads conversation was just the design phase.** With Modus, you can
375+
build agents that become as reliable and scalable as any microservice in your
376+
infrastructure.
377+
249378
## Real-world examples
250379

251380
### Sales pipeline agent

0 commit comments

Comments
 (0)