--- title: What would mother say? emoji: 🫶 colorFrom: pink colorTo: yellow sdk: streamlit sdk_version: 1.21.0 app_file: app.py pinned: false --- # What would mother say? This app includes a Haystack agent with access to 2 tools: - `MastodonRetriever`: Useful for when you need to retrive the latest posts from a username to get an understanding of their style - `WebSearch`: Useful for when you need to research the latest about a new topic We build an Agent that aims to first understand the style in which a username posts. Then, it uses the WebSearch tool to gain knowledge on a topic that the LLM may not have info on, to generate a post in the users style about that topic. ### Try it out on [🤗 Spaces](https://huggingface.co/spaces/Tuana/what-would-mother-say) ##### A showcase of a Haystack Agent with a custom `TwitterRetriever` Node and a `WebQAPipeline` as tools. **Custom Haystack Node** This repo contains a streamlit application that given a query about what a certain twitter username would post on a given topic, generates a post in their style (or tries to). It does so by using a custom Haystack node I've built called the [`MastodonFetcher`](https://haystack.deepset.ai/integrations/mastodon-fetcher) **Custom PromptTemplates** It's been built with [Haystack](https://haystack.deepset.ai) using the [`Agent`](https://docs.haystack.deepset.ai/docs/agent) and by creating a custom [`PromptTemplate`](https://docs.haystack.deepset.ai/docs/prompt_node#templates) All the prompt templates used in this demo, both for the `WebQAPipeline` and the `Agent` can be found in `./prompts`. image ## To learn more about the Agent Check out our tutorial on the Conversational Agent [here](https://haystack.deepset.ai/tutorials/24_building_chat_app) ## Installation and Running 1. Install requirements: `pip install -r requirements.txt` 2. Run the streamlit app: `streamlit run app.py` 3. Createa a `.env` and add your Twitter Bearer token, OpenAI Key, and SerperDev Key: `TWITTER_BEARER_TOKEN` `SERPER_KEY` `OPENAI_API_KEY` This will start up the app on `localhost:8501` where you will find a simple search bar #### The Haystack Community is on [Discord](https://discord.com/invite/VBpFzsgRVF)