Skip to main content

A powerful CLI and Telegram bot interface for Perplexity AI

Project description

NeuraX AI Assistant

A powerful dual-mode AI assistant powered by Perplexity AI

Python License Platform Version Status Stars Forks Contributors Languages Code Size

๐Ÿ“– Table of Contents

๐ŸŒŸ Overview

NeuraX is an open-source AI assistant tool that seamlessly integrates with Perplexity AI, offering both a sophisticated Command Line Interface (CLI) and a fully-featured Telegram bot. Developed by Alex Butler from the Vritra Security Organization, NeuraX is designed for developers, researchers, and AI enthusiasts who want powerful AI capabilities at their fingertips.

Why NeuraX?

  • ๐Ÿš€ Dual Interface: Choose between CLI for quick queries or Telegram for on-the-go access
  • ๐Ÿง  Powered by Perplexity AI: Leverages cutting-edge AI technology
  • ๐Ÿ”’ Secure Configuration: Safe storage of API keys and tokens
  • ๐ŸŒ Cross-Platform: Works on Linux, macOS, Windows, and Android (Termux)
  • ๐Ÿ“ฆ Modular Design: Professional, maintainable codebase
  • ๐ŸŽจ Beautiful Interface: Colorful CLI with intuitive commands

โœจ Features

Core Features

  • Interactive CLI Chat Interface with rich color output
  • Telegram Bot Integration with full command support
  • Persistent Configuration Management with secure storage
  • Context-Aware Conversations with chat history
  • Multi-User Support for Telegram bot
  • Cross-Platform Compatibility (Linux, macOS, Windows, Android)
  • Professional Error Handling and logging
  • Signal Handling for graceful shutdowns

Advanced Features

  • Asynchronous Operations for optimal performance
  • Modular Architecture for easy maintenance
  • Configuration Validation with helpful error messages
  • Interactive and Inline Configuration options
  • Real-time Status Monitoring
  • Comprehensive Help System

๐Ÿ—๏ธ Architecture

NeuraX follows a modular architecture pattern:

NeuraX/
โ”œโ”€โ”€ README.md                 # Project documentation
โ”œโ”€โ”€ requirements.txt          # Python dependencies
โ”œโ”€โ”€ neurax.py                # Main application entry point
โ”œโ”€โ”€ LICENSE                  # MIT License file
โ””โ”€โ”€ modules/
    โ”œโ”€โ”€ __init__.py          # Package initialization and exports
    โ”œโ”€โ”€ ai_client.py         # Perplexity AI client implementation
    โ”œโ”€โ”€ colors.py            # ANSI color codes and banner
    โ”œโ”€โ”€ config.py            # Configuration management system
    โ”œโ”€โ”€ telegram_bot.py      # Telegram bot implementation
    โ””โ”€โ”€ utils.py             # Utility functions and helpers

Module Descriptions

  • neurax.py: Main entry point with argument parsing and mode selection
  • ai_client.py: Handles communication with Perplexity AI API
  • colors.py: Provides ANSI color codes and the NeuraX banner
  • config.py: Manages persistent configuration storage and retrieval
  • telegram_bot.py: Complete Telegram bot implementation with async handlers
  • utils.py: Common utility functions for UI and system operations

๐Ÿš€ Installation

Linux Installation

# Clone the repository
git clone https://github.com/VritraSecz/NeuraX.git

# Navigate to the project directory
cd NeuraX

# Install Python dependencies
pip install -r requirements.txt

# Verify Installation
python neurax.py --help

Termux Installation

# Update packages and install dependencies
pkg update && pkg upgrade
pkg install git python

# Clone the repository
git clone https://github.com/VritraSecz/NeuraX.git

# Navigate to the project directory
cd NeuraX

# Install Python dependencies
pip install -r requirements.txt

# Check Installation
python neurax.py --about

Dependencies

  • Python 3.7+
  • requests >= 2.31.0
  • python-telegram-bot == 21.5 (for bot functionality)
  • pytz >= 2024.1 (for timezone support)
  • colorama >= 0.4.6 (for cross-platform colors)

โš™๏ธ Configuration

NeuraX stores configurations in ~/.config-vritrasecz/neurax-config.json for persistent settings across sessions.

Required Configurations

  1. Perplexity API Key

  2. Telegram Bot Token (Optional - only for bot functionality)

    • Create a bot via @BotFather on Telegram
    • Configure: python neurax.py --token

Configuration Commands

# Interactive API key configuration
python neurax.py --api

# Direct API key configuration
python neurax.py --api sk-proj-your-api-key-here

# Interactive Telegram token configuration
python neurax.py --token

# Direct Telegram token configuration
python neurax.py --token 1234567890:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

# View current configuration
python neurax.py --config

๐ŸŽฏ Usage

CLI Mode

Start an interactive chat session:

python neurax.py

CLI Commands during chat:

  • exit, quit, or bye - Exit chat mode
  • clear - Clear chat history
  • help - Show available commands

Telegram Bot Mode

  1. Configure the bot token:

    python neurax.py --token
    
  2. Start the bot:

    python neurax.py --bot
    

Telegram Bot Commands:

  • /start - Welcome message and bot introduction
  • /help - Show available commands
  • /clear - Clear your chat history
  • /about - Information about the bot and developer
  • /status - Check bot status and statistics

๐Ÿ“‹ Commands Reference

Command Description Example
--about Show information about NeuraX and developer python neurax.py --about
--connect Show developer contact information python neurax.py --connect
--api Configure Perplexity API key python neurax.py --api
--token Configure Telegram bot token python neurax.py --token
--bot Start Telegram bot python neurax.py --bot
--config Show current configuration python neurax.py --config
--help Show help message python neurax.py --help
(no args) Start CLI chat mode python neurax.py

๐Ÿ“ธ Screenshots

CLI Interface

NeuraX CLI

Telegram Bot

NeuraX Telegram Bot

Configuration Display

NeuraX Configuration

๐Ÿ”Œ API Integration

Perplexity AI Integration

NeuraX uses the Perplexity AI API for generating responses:

  • Model: sonar
  • Endpoint: https://api.perplexity.ai/chat/completions
  • Features: Context-aware conversations, chat history management
  • Error Handling: Comprehensive error handling for network and API issues

Telegram Bot API

The Telegram bot implementation includes:

  • Asynchronous Operations for better performance
  • Per-User Session Management for isolated conversations
  • Rich Command Support with markdown formatting
  • Error Recovery and logging
  • Multi-User Concurrent Support

๐Ÿค Contributing

  • We welcome contributions from the community! Here's how you can help:

Ways to Contribute

  • ๐Ÿ› Report Bugs: Use the Issues tab
  • ๐Ÿ’ก Suggest Features: Submit feature requests
  • ๐Ÿ”ง Code Contributions: Fork, develop, and submit pull requests
  • ๐Ÿ“– Documentation: Improve documentation and examples
  • ๐ŸŒ Translations: Help translate NeuraX to other languages

Development Setup

  1. ๐Ÿด Fork the repository
  2. ๐ŸŒฟ Create a feature branch (git checkout -b feature/AmazingFeature)
  3. ๐Ÿ’พ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. ๐Ÿ“ค Push to the branch (git push origin feature/AmazingFeature)
  5. ๐Ÿ”„ Open a Pull Request

Code Style Guidelines

  • Follow PEP 8 Python style guide
  • Use meaningful variable and function names
  • Add docstrings to functions and classes
  • Include type hints where appropriate
  • Write comprehensive error handling

๐Ÿ”ง Troubleshooting

Common Issues

  1. Import Errors

    # Solution: Install missing dependencies
    pip install -r requirements.txt
    
  2. API Key Issues

    # Solution: Reconfigure API key
    python neurax.py --api
    
  3. Telegram Bot Not Responding

    # Solution: Check token and restart bot
    python neurax.py --config
    python neurax.py --token
    
  4. Permission Errors

    # Solution: Check file permissions
    chmod +x neurax.py
    

Getting Help

๐Ÿ“ Changelog

Version 1.0.0 (Current)

  • โœ” Initial release
  • โœ” CLI chat interface
  • โœ” Telegram bot integration
  • โœ” Perplexity AI integration
  • โœ” Configuration management
  • โœ” Cross-platform support
  • โœ” Modular architecture

Planned Features

  • ๐Ÿ”„ Multiple AI provider support
  • ๐Ÿ“Š Usage statistics and analytics
  • ๐ŸŽจ Customizable themes and colors
  • ๐Ÿ“ฑ Web interface
  • ๐Ÿ” Enhanced security features

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

MIT License

Copyright (c) 2025 Alex Butler (Vritra Security Organization)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

๐Ÿ‘จโ€๐Ÿ’ป Developer

Alex Butler

Vritra Security Organization

GitHub Website Instagram YouTube

๐Ÿ“ฑ Telegram Channels

Central Main Channel Community Support Bot


๐ŸŒŸ Support the Project

If you find NeuraX helpful, please consider:

  • โญ Starring the repository
  • ๐Ÿด Forking and contributing
  • ๐Ÿ“ข Sharing with others
  • ๐Ÿ› Reporting issues
  • ๐Ÿ’ก Suggesting new features

Made with โค๏ธ by the Vritra Security Organization

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

neurax_ai-1.0.0.tar.gz (29.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

neurax_ai-1.0.0-py3-none-any.whl (31.2 kB view details)

Uploaded Python 3

File details

Details for the file neurax_ai-1.0.0.tar.gz.

File metadata

  • Download URL: neurax_ai-1.0.0.tar.gz
  • Upload date:
  • Size: 29.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for neurax_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7f3ff373e0bb284a8581c1555df4edf23d536b91709ae8ff6bb94849e44be794
MD5 b183f656ff2ab1f7aa93e8ca6087c1eb
BLAKE2b-256 526b391b49efdb43bb54e8b9d2239abe388cbe5c037c100ab56598c8b3a69b03

See more details on using hashes here.

File details

Details for the file neurax_ai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: neurax_ai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for neurax_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aa2e03a1e024c3fa2c4e45e20d83ea33b2376187fec796cd101ca5fbffe6d0a0
MD5 672d9cbffdd6243f01ed67a2eb0f7a2f
BLAKE2b-256 c70f5ca3ff81f395ec815abb6ddcf35408d5e7d559e74e6461badf39e7bc6e56

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page