AQI Analysis Agent
The AQI Analysis Agent is a powerful air quality monitoring and health recommendation tool powered by Firecrawl and Agno's AI Agent framework. This ap…
- OpenAI
Agent Teams ·Advanced
Beifong manages your trusted articles and social media platform sources. It generates podcasts from the content you trust and curate. It handles the complete pipeline, from data collection and analysis to the production of scripts and visuals.
ELEVENSLAB_API_KEYOPENAI_API_KEYSLACK_APP_TOKENSLACK_BOT_TOKENLicense Apache-2.0 · content curated and maintained by Doutor AI.
Beifong manages your trusted articles and social media platform sources. It generates podcasts from the content you trust and curate. It handles the complete pipeline, from data collection and analysis to the production of scripts and visuals.
🔗 Blog
Before installing Beifong, ensure you have:
# Clone the repository
git clone https://github.com/arun477/beifong.git
cd beifong
# Create virtual environment
cd beifong
python -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Install browser
python -m playwright install
# (Optional but recommended) Download demo content
# Navigate to the beifong directory if not already there
cd beifong # Skip if already in the beifong folder
# This populates the system with sample data, curated source feeds, and assets
python bootstrap_demo.py
Create a .env file in the /beifong directory with your API keys:
OPENAI_API_KEY=your_openai_api_key
ELEVENSLAB_API_KEY=your_elevenlabs_api_key # Optional
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
Launch all required services in separate terminals (but make sure you start python main.py first before starting others, because the first time run will do db initialization):
⚠️ Make sure to activate the virtual environment in all terminals before starting each script.
source venv/bin/activate
# Terminal 1: Start the main backend (first time run may take 2 to 3 minutes due to the setup process)
cd beifong
python main.py
# Terminal 2: Start the scheduler
cd beifong
python -m scheduler
# Terminal 3: Start the chat workers
cd beifong
python -m celery_worker
# Verify Redis is running
redis-cli ping
# Navigate to web directory
cd web
# Install dependencies
npm install
# Start development server
npm start
Beifong offers flexibility in how you interact with the system:
Beifong includes several specialized processors for different content sources:
Extend Beifong's capabilities by adding your own content processors:
# processors/my_custom_processor.py
def process_custom_task(parameter1=None, parameter2=None):
# Your processing logic here
stats = {"processed": 0, "success": 0, "errors": 0}
# Processing implementation
return stats
if __name__ == "__main__":
stats = process_custom_task()
print(f"Processed: {stats['processed']}, Success: {stats['success']}")
Add your processor to the system in models/tasks_schemas.py:
class TaskType(str, Enum):
# Existing task types...
my_custom_processor = "my_custom_processor"
TASK_TYPES = {
# Existing types...
"my_custom_processor": {
"name": "My Custom Processor",
"command": "python -m processors.my_custom_processor",
"description": "Performs custom processing task",
},
}
Create a new task using the API or UI with your custom processor type.
Beifong's AI system is built on the agno framework and includes:
Extend the agent's capabilities with custom tools:
# tools/my_custom_tool.py
from agno.agent import Agent
def my_custom_tool(agent: Agent, param1: str, param2: str) -> str:
"""Tool description here"""
agent.session_state["my_key"] = "my_value"
# Tool implementation
result = f"Processed {param1} and {param2}"
return result
Register your tool in services/celery_tasks.py:
# Add import
from tools.my_custom_tool import my_custom_tool
# Add to tools list
tools = [my_custom_tool]
Modify the agent's instructions and behavior in db/agent_config_v2.py:
# Update the instructions to modify the agent's behavior
# Be careful to preserve the core flow stages while adding your customizations
Beifong's search agent has full browser automation capabilities through the browseruse library, enabling web research and automated data collection from any website.
You can give the agent specific search instructions like:
The agent will navigate websites, interact with page elements, and extract the requested information automatically.
For websites requiring authentication (X.com, Facebook, LinkedIn, etc.), you need to establish logged in sessions:
Setting Up Social Media Sessions:
For persistent logged in sessions and advanced browser management:
Persistent Session Path Configuration:
browsers/playwright_persistent_profile_web foldertools/web_search to use get_browser_session_path() from db/config.pyImportant Persistent Session Management Notes:
get_browser_session_path() functionPersistent Session Troubleshooting:
Beifong currently supports automated monitoring for:
To automatically collect your social media feeds:
Once your social media feeds are collected:
You can easily customize which feeds to monitor:
Modifying Feed Sources:
/tools/social/ directoryURL Configuration Examples:
Beifong supports easy expansion to additional platforms:
Currently Supported:
Easy Integration Options:
Future Updates:
Important Scheduling Considerations:
⚠️ Avoid Concurrent Execution - When scheduling multiple social media feed collection tasks, ensure they don't run simultaneously. All social media processors share the same persistent browser session.
Recommended Scheduling Approach:
Example Safe Scheduling:
Future Improvements:
Beifong supports multiple text to speech options:
Commercial Options:
Open Source Options:
The TTS system supports integration of additional engines:
Potential Next Open Source Integration Options:
Add custom TTS engines through the tts_selector engine interface in the utils directory.
Beifong can be integrated with other platforms.
Beifong's Slack integration enables you to interact with the AI agent directly from your Slack workspace. Each conversation with Beifong creates a dedicated Slack thread for the session.
Key Feature:
To integrate Beifong with your Slack workspace, you need to create a Slack app in Socket Mode:
connections:write scopeSLACK_APP_TOKEN)SLACK_BOT_TOKEN)Your Slack app requires specific permissions to function properly with Beifong:
Add the following scopes under "OAuth & Permissions" → "Bot Token Scopes":
app_mentions:read - View messages that directly mention @BeifongAI in conversations that the app is inassistant:write - Allow BeifongAI to act as an App Agentchannels:history - View messages and other content in public channels that BeifongAI has been added tochannels:read - View basic information about public channels in a workspacechat:write - Send messages as @BeifongAIfiles:read - View files shared in channels and conversations that BeifongAI has been added tofiles:write - Upload, edit, and delete files as @BeifongAIim:read - View basic information about direct messages that BeifongAI has been added toim:write - Start direct messages with peopleUnder "Event Subscriptions" → "Subscribe to bot events", add:
app_mention - Subscribe to only the message events that mention your app or botapp_mentions:readmessage.channels - A message was posted to a channelchannels:historyAdd your Slack tokens to the .env file in the /beifong directory:
# Existing environment variables...
OPENAI_API_KEY=your_openai_api_key
ELEVENSLAB_API_KEY=your_elevenlabs_api_key # Optional
# Slack Integration
SLACK_BOT_TOKEN=xoxb-your-bot-user-oauth-token
SLACK_APP_TOKEN=xapp-your-app-level-token
# Redis configuration
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
Once you've configured your Slack app and environment variables:
# Navigate to beifong directory
cd beifong
# Ensure your environment is activated
source venv/bin/activate
# Run the Slack integration script
python -m integrations.slack.chat
In Slack Channels:
@BeifongAI Can you help me analyze the latest news about AI developments?Reference Documentation:
All application databases are organized in the databases directory for easy management and backup.
Generated podcasts, audio files, and visual assets are stored in the podcasts directory.
If asset storage grows, consider these storage optimization strategies:
Cloud Storage Integration:
.env to use larger drivesAutomated Cleanup:
Storage Monitoring:
Note: More efficient storage management and cloud connectors will be added in the next version.
# Start the backend with network access
cd beifong
python main.py --host 0.0.0.0 --port 7000
This makes the application accessible via your machine's IP address on your local network.
For accessing Beifong from outside your local network (workaround):
# Forward local port to remote machine
ssh -L 7000:localhost:7000 username@your-server-ip
# Create temporary public tunnel
ngrok http 7000
Provides a temporary public URL that forwards to your local instance.
Beifong doesn't include an authentication layer yet. Authentication will be added in the next version.
Coming Soon!
✅ Cloud version of Beifong
✅ More social media connectors
✅ More API options. Claude, Gemini, OpenAI, Ollama
✅ Podcast customization with more styles
✅ More voice options
✅ Better data collection and storage management
✅ Authentication layer
If your installation fails due to the Kokoro library, you can skip installing this library and only install it when needed as a TTS engine. Kokoro is optional and only required if you want to use it for text-to-speech generation.
For more information about Kokoro, check the reference: https://github.com/hexgrad/kokoro
If your installation fails due to browseruse, make sure the Playwright version is properly installed. Browser automation features depend on Playwright being correctly set up.
For more reference and troubleshooting: https://github.com/browser-use/browser-use
If the FAISS library installation fails, you can safely ignore this error and skip installing FAISS. This library is only required if you want to use the semantic search feature. If you don't need semantic search functionality, you can safely ignore the FAISS installation failure.
For reference: https://github.com/facebookresearch/faiss
Some of the data collection features rely on browser automation, which sometimes won't work properly in server environments. While Beifong will still function, some browser dependent features may not work in server environments without proper browser setup.
🚀 Repo
The AQI Analysis Agent is a powerful air quality monitoring and health recommendation tool powered by Firecrawl and Agno's AI Agent framework. This ap…
An AI-powered multi-agent codebase migration assistant built with LangGraph and Streamlit that plans file-by-file refactoring tasks, performs human-in…
An advanced AI research agent built using the Agno Agent framework, Together AI's Qwen model, and Composio tools. This agent helps users conduct compr…
Need a tailor-made solution?
Not sure where to start with AI in your business? Get a free assessment and a tailored plan - no commitment.
Doutor AI gives you 1,859 ready-to-copy AI prompts, by industry and in plain English - plus a complete technical library for those who want to go further.