Giter Club home page Giter Club logo

media-agent's Introduction

Media Agent

Media Agent scrapes Twitter and Reddit submissions, summarizes them, and chats with them in an interactive terminal.


Demo

https://www.loom.com/share/f4954e7d34ef4b7b8491e2bf910e8521

Functionalities

  • Scrapes tweets/submissions on your behalf either from a list of user accounts or a list of keywords.
  • Embeds the tweets/submissions using OpenAI
  • Indexes the embeddings (i.e. vectors) in ChromaDB
  • Enriches the index with additional metadata
  • Creates a summary of the tweets/submissions and provides potential questions to answer
  • Opens a chat session on top of the tweets
  • Saves the conversation with its metadata
  • A rich terminal UI and logging features

Tools and libraries used

  • Langchain ๐Ÿฆœ to build and compose LLMs
  • ChromaDB to store vectors (a.k.a embeddings) and query them to build conversational bots
  • Tweepy to connect to your the Twitter API and extract Tweets and metadata
  • Praw to connect to Reddit API
  • Rich to build a cool terminal UX/UI
  • Poetry to manage dependencies

Third party services

  • OpenAI (๐Ÿ”‘ needed)
  • Twitter (๐Ÿ”‘ needed)
  • Reddit (๐Ÿ”‘ needed)

Run the app locally

  • Install dependencies with poetry
poetry install --with dev
  • Add API credentials

Create .env file at the root of the project with the following keys:

OPENAI_API_KEY=<OPENAI KEY>
TWITTER_BEARER_TOKEN=<TWITTER BEARER TOKEN>
REDDIT_API_CLIENT_ID=<REDDIT_API_CLIENT_ID>
REDDIT_API_SECRET=<REDDIT_API_SECRET>
REDDIT_USER_AGENT=<REDDIT_USER_AGENT>

More info on these credentials here, here and here

  • Run the app
make run-media-agent

Future features:

This is an on-going project, so feel free to contribute:

Here's what I plan in the near future:

  • Add more data sources: substack, press, LinkedIN
  • support open-source LLMs (Falcon?)
  • support Pinecone in addition to ChromaDB
  • add instructions to deployment on a cloud infrastructure
  • improve the prompts to have a more engaging/enriching conversations
  • add actions to open URLs and fetch content from it

media-agent's People

Contributors

ahmedbesbes avatar syltruong avatar ahmedbesbes-servier avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.