Coder Social home page Coder Social logo

b0bot's Introduction

B0Bot - CyberSecurity News API

Setup

  1. Install all necessary packages

pip install -r ./requirements.txt

  1. Set up your MongoDB Atlas database

https://www.mongodb.com/atlas/database

  1. Set up your OpenAI API account

https://platform.openai.com/docs/overview

  1. Create .env file in the root directory
# ./env

# OpenAI
OPENAI_API_KEY='[Your OpenAI API Key here]'

# MongoDB Atlas
DB_PASSWORD='[Your database password here]'
  1. Remember to replace the MongoDB connection string
# Example
client = MongoClient(f"mongodb+srv://b0bot:{DB_PASSWORD}@cluster0.zqgexb4.mongodb.net/") # Replace the string with yours
  1. Enrich/Update news data into your database

Run ./db_update/Update.py as a worker on a cloud service (e.g. heroku). Or, run ./db_update/Update.py manually in local.

  1. Run the flask app

flask --app app.py run

  1. Two available url paths
/news
/news_keywords?keywords=[Place news keywords here]

In this project, our objective is to develop a CyberSecurity News API tailored for automated bots on social media platforms.

It is a cutting-edge Flask-based API that grants seamless access to the latest cybersecurity and hacker news. Users can effortlessly retrieve news articles either through specific keywords or without, streamlining the information acquisition process.

Once a user requests our API, it retrieves news data from our knowledge base and feeds it to ChatGPT. After ChatGPT processes the data, the API obtains the response and returns it in JSON format.

High-Level Architecture Diagram

Our API lives inside a Flask API and is powered by LangChain and OpenAI API.

In addition, to keep the knowledge base of news up to date, a scheduled script will be executed on a regular interval to retrieve the most recent cybersecurity news by scraping a list of target news websites and store them into the MongoDB Atlas Database. Everytime a user requests the API, news in the database will be read into LangChain's memory and fed to the LLM of OpenAI. Then, answers will be generated based on both OpenAI model and our knowledge base.

image image

The API will continuely run as a serverless function (hosted on Render) and it will record a successfull operation in a monitoring dashboard set up in Better Uptime.

b0bot's People

Contributors

cotoyo avatar niweera avatar debrupf2946 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.