Skip to main content

Intelligent documentation assistant CLI for Beagleboard projects

Project description


title: Beaglemind Rag Poc emoji: 👀 colorFrom: red colorTo: purple sdk: gradio sdk_version: 5.35.0 app_file: app.py pinned: false

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

BeagleMind CLI

An intelligent documentation assistant CLI tool for Beagleboard projects that uses RAG (Retrieval-Augmented Generation) to answer questions about codebases and documentation.

Features

  • Multi-backend LLM support: Use both cloud (Groq) and local (Ollama) language models
  • Intelligent search: Advanced semantic search with reranking and filtering
  • Rich CLI interface: Beautiful command-line interface with syntax highlighting
  • Persistent configuration: Save your preferences for seamless usage
  • Source attribution: Get references to original documentation and code

Installation

Development Installation

# Clone the repository
git clone https://github.com/beagleboard-gsoc/BeagleMind-RAG-PoC
cd BeagleMind-RAG-PoC

# Install in development mode
pip install -e .

Using pip

pip install beaglemind-cli

Environment Setup

For Groq (Cloud)

Set your Groq API key:

export GROQ_API_KEY="your-api-key-here"

For OpenAI (Cloud)

Set your OpenAI API key:

export OPENAI_API_KEY="your-api-key-here"

For Ollama (Local)

  1. Install Ollama: https://ollama.ai
  2. Pull a supported model:
    ollama pull qwen3:1.7b
    
  3. Ensure Ollama is running:
    ollama serve
    

Quick Start

1. List Available Models

See what language models are available:

# List all models
beaglemind list-models

# List models for specific backend
beaglemind list-models --backend groq
beaglemind list-models --backend ollama

2. Start Chatting

Ask questions about the documentation:

# Simple question
beaglemind chat -p "How do I configure the BeagleY-AI board?"

# With specific model and backend
beaglemind chat -p "Show me GPIO examples" --backend groq --model llama-3.3-70b-versatile

# With sources shown
beaglemind chat -p "What are the pin configurations?" --sources

CLI Commands

beaglemind list-models

List available language models.

Options:

  • --backend, -b: Show models for specific backend (groq/ollama)

Examples:

beaglemind list-models
beaglemind list-models --backend groq

beaglemind chat

Chat with BeagleMind using natural language.

Options:

  • --prompt, -p: Your question (required)
  • --backend, -b: LLM backend (groq/ollama)
  • --model, -m: Specific model to use
  • --temperature, -t: Response creativity (0.0-1.0)
  • --strategy, -s: Search strategy (adaptive/multi_query/context_aware/default)
  • --sources: Show source references

Examples:

# Basic usage
beaglemind chat -p "How to flash an image to BeagleY-AI?"

# Advanced usage
beaglemind chat \
  -p "Show me Python GPIO examples" \
  --backend groq \
  --model llama-3.3-70b-versatile \
  --temperature 0.2 \
  --strategy adaptive \
  --sources

# Code-focused questions
beaglemind chat -p "How to implement I2C communication?" --sources

# Documentation questions  
beaglemind chat -p "What are the system requirements?" --strategy context_aware

Interactive Chat Mode

You can start an interactive multi-turn chat session (REPL) that remembers context and lets you toggle features live.

Start it by simply running the chat command without a prompt:

beaglemind chat

Or force it explicitly:

beaglemind chat --interactive

During the session you can use these inline commands (type them as messages):

Command Description
/help Show available commands and tips
/sources Toggle display of source documents for answers
/tools Enable/disable tool usage (file creation, code analysis, etc.)
/config Show current backend/model/session settings
/clear Clear the screen and keep session state
/exit or /quit End the interactive session

Example interactive flow:

$ beaglemind chat
BeagleMind (1) > How do I configure GPIO?
...answer...
BeagleMind (2) > /sources
✓ Source display: enabled
BeagleMind (3) > Give me a Python example
...answer with sources...
BeagleMind (4) > /tools
✓ Tool usage: disabled
BeagleMind (5) > /exit

Tips:

  1. Use /sources when you need provenance; turn it off for faster, cleaner output.
  2. Disable tools (/tools) if you want read-only behavior.
  3. Ask follow-ups naturally; prior Q&A stays in context for better answers.

Available Models

Groq (Cloud)

  • llama-3.3-70b-versatile
  • llama-3.1-8b-instant
  • gemma2-9b-it
  • meta-llama/llama-4-scout-17b-16e-instruct
  • meta-llama/llama-4-maverick-17b-128e-instruct

OpenAI (Cloud)

  • gpt-4o
  • gpt-4o-mini
  • gpt-4-turbo
  • gpt-3.5-turbo
  • o1-preview
  • o1-mini

Ollama (Local)

  • qwen3:1.7b
  • smollm2:360m
  • deepseek-r1:1.5b

Tips for Best Results

  1. Be specific: "How to configure GPIO pins on BeagleY-AI?" vs "GPIO help"

  2. Use technical terms: Include model names, component names, exact error messages

  3. Ask follow-up questions: Build on previous responses for deeper understanding

  4. Use --sources: See exactly where information comes from

  5. Try different strategies: Some work better for different question types

Troubleshooting

"BeagleMind is not initialized"

Run beaglemind init first.

"No API Key" for Groq

Set the GROQ_API_KEY environment variable.

"No API Key" for OpenAI

Set the OPENAI_API_KEY environment variable.

"Service Down" for Ollama

Ensure Ollama is running: ollama serve

"Model not available"

Check beaglemind list-models for available options.

Development

Running from Source

# Make the script executable
chmod +x beaglemind

# Run directly
./beaglemind --help

# Or with Python
python -m src.cli --help

Adding New Models

Edit the model lists in src/cli.py:

GROQ_MODELS = [
    "new-model-name",
    # ... existing models
]

OPENAI_MODELS = [
    "new-openai-model",
    # ... existing models
]

OLLAMA_MODELS = [
    "new-local-model",
    # ... existing models  
]

License

MIT License - see LICENSE file for details.

Support

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

beaglemind_cli-1.0.5.tar.gz (38.8 kB view details)

Uploaded Source

Built Distribution

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

beaglemind_cli-1.0.5-py3-none-any.whl (41.6 kB view details)

Uploaded Python 3

File details

Details for the file beaglemind_cli-1.0.5.tar.gz.

File metadata

  • Download URL: beaglemind_cli-1.0.5.tar.gz
  • Upload date:
  • Size: 38.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for beaglemind_cli-1.0.5.tar.gz
Algorithm Hash digest
SHA256 9c2afd8c9416f0340cd2512adc8556ab7da99e7cf7d37e3d761007066c52d8c8
MD5 11b3a8adda64bab0423c187553ac6e9e
BLAKE2b-256 058d3d3013a76c245cd3cd0f722f98289efe032a029a526e6268f5cdac7d672f

See more details on using hashes here.

File details

Details for the file beaglemind_cli-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: beaglemind_cli-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 41.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for beaglemind_cli-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 b7fcb26bbb65434d4e60f7331e96c3895922277325925ee0b3c082cd023c4a72
MD5 cbd267f4609a9be0df0d2f285568c55c
BLAKE2b-256 ad91f56266e3e81b66bbc914d76c79291af9404741b0c7132e68fa8533c76f57

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