Building a Research Assistant in Minutes with BReact SDK
Modern business automation often sounds complex, but what if you could build a smart, multi-step application in just a few lines of Python? With the BReact SDK, you can! In this post, we'll walk through building a simple but powerful research assistant that:
- Searches the web for your query
- Scrapes the top result
- Summarizes the content for you
All with just a handful of code cells—no infrastructure or complex setup required.
Try it yourself: All you need is Python and the BReact SDK. See the GitHub repo for installation instructions.
Why BReact SDK?
BReact OS is designed to make automation and AI workflows accessible to everyone. The SDK provides a clean, Pythonic interface to powerful backend services like web search, web scraping, and text summarization. You focus on your logic—the SDK handles the rest.
Step 1: Set Up Your API Key
Before you start, make sure you have your BReact API key. You can set it as an environment variable so the SDK can authenticate your requests.
Step 2: Import and Initialize the Client
Let's import the SDK and create a client instance. This client will let you access all BReact services.
Step 3: Web Search for Your Query
We'll start by searching the web for a specific query. Here, we use the web search service to get the most relevant result.
Step 4: Scrape the Top Result
Now, let's scrape the content from the URL we just found. The webscrape service will extract the main text from the page.
Step 5: Summarize the Scraped Content
Finally, we'll use the summary service to generate a brief summary of the scraped page content.
Full Example: Putting It All Together
You can also wrap the above steps in a function for easy reuse:
Step 6: Run the Assistant
How Does It Work?
Let's break down what happens under the hood:
Web Search: The assistant uses the web_search
service to find the most relevant result for your query.
Example Output:
Web Scraping: Next, it scrapes the content of the top result using the webscrape
service. This service fetches the page, extracts the main text, and makes it available for further processing.
Example Output:
Summarization: Finally, the assistant summarizes the scraped content using the summary
service. You get a concise, readable summary of the most relevant information.
Example Output:
Why Is This So Easy?
- Unified API: The SDK exposes each service as a simple method call. No need to manage HTTP requests, authentication, or data formatting.
- Composable Workflows: Chain together as many services as you like—web search, scraping, summarization, classification, and more.
- Robust Services: Each service is designed for reliability, clear error handling, and flexible configuration.
- No Infrastructure Hassle: All the heavy lifting happens in the cloud. You just write Python code.
Service Details (Under the Hood)
BReact OS provides a set of modular services. Here are the three used in this example:
Web Search Service
- Endpoint:
web_search.search
- Description: Search the web and return relevant URLs, titles, and snippets.
- Parameters:
query
(string),max_results
(integer, optional) - Returns: List of results with
url
,title
, andsnippet
Webscrape Service
- Endpoint:
webscrape.scrape
- Description: Scrape content from a given URL, optionally using a CSS selector.
- Parameters:
content
(object withurl
and optionalselector
) - Returns: Extracted
text
,html
, and more
Summary Service
- Endpoint:
summary.summarize
- Description: Summarize text using advanced LLMs
- Parameters:
text
(string),summary_type
(e.g., "brief") - Returns: Concise summary of the input text
Next Steps: Build Your Own Workflow
This is just the beginning! With the BReact SDK, you can:
- Build multi-step automations (e.g., classify, tag, and respond to emails)
- Integrate with your own data sources
- Deploy as a web app, CLI tool, or backend service
Explore more: Check out the BReact SDK examples for inspiration.
Conclusion
With BReact SDK, building intelligent, multi-step applications is as easy as writing a few lines of Python. Whether you're automating research, customer support, or business processes, the SDK gives you the power of advanced AI and automation—without the complexity.
Ready to build your own assistant? Get started here!
Have you built something cool with BReact SDK? Share your story or questions with us! Contact us