Skip to main content

A Python library for managing Rile AI personas with a focus on SDG goals oriented for sustainable living

Project description

Rilerary 🤖

A Python library for managing Rile AI personas with a focus on SDG (Sustainable Development Goals) oriented for sustainable living.

Features

  • 🎭 Multiple Personas: Chef, Teacher, Finance, Tech, Motivation, Sustainability, Knowledge, and more
  • 📦 Easy to Use: Simple API for loading and working with personas
  • 🔧 Flexible: Use built-in personas or add your own
  • 📝 Well-Structured: JSON-based persona definitions with rich metadata

Installation

pip install rilerary

Or install from source:

git clone https://github.com/NamaiBest/rilerary.git
cd rilerary
pip install -e .

Quick Start

from rilerary import load_persona, get_available_personas

# Get list of available personas
personas = get_available_personas()
print(f"Available personas: {personas}")

# Load a specific persona
chef = load_persona("chef_rile")
print(f"Persona: {chef['persona_name']}")
print(f"Description: {chef['description']}")
print(f"Specialties: {chef['specialties']}")

# Use the prompt template in your AI system
system_prompt = chef['prompt_template']

Available Personas

  • 👨‍🍳 Chef Rile: Cooking, recipes, nutrition, and food safety
  • 👨‍🏫 Teacher Rile: Education, learning strategies, and academic support
  • 💰 Finance Rile: Personal finance, investing, and money management
  • 💻 Tech Rile: Technology, programming, and software development
  • 💪 Motivation Rile: Personal development and motivation
  • 🌱 Sustainability Rile: Environmental awareness and sustainable living
  • 📚 Knowledge Rile: General knowledge and research
  • 👁️ Locket Visual Assistant: Quick visual analysis for locket mode

Advanced Usage

Using PersonaLoader Class

from rilerary import PersonaLoader

# Create loader instance
loader = PersonaLoader()

# Get all personas at once
all_personas = loader.get_all()

# Get basic info without loading full data
info = loader.get_persona_info("tech_rile")
print(f"{info['emoji']} {info['name']}: {info['description']}")

Building System Prompts

from rilerary import load_persona
from rilerary.utils import build_system_prompt

persona = load_persona("motivation_rile")

# Build complete system prompt with additional context
system_prompt = build_system_prompt(
    persona,
    additional_context="Focus on helping with morning routines."
)

Using Custom Persona Directory

from rilerary import PersonaLoader

# Load from custom directory
loader = PersonaLoader(custom_persona_dir="/path/to/your/personas")
custom_persona = loader.load("my_custom_persona")

Persona Structure

Each persona is defined in a JSON file with the following structure:

{
  "persona_name": "Chef Rile",
  "description": "Expert cooking assistant",
  "tone": "Enthusiastic and knowledgeable",
  "greeting": "Ready to cook!",
  "emoji": "👨‍🍳",
  "specialties": ["Cooking", "Recipes", "Nutrition"],
  "prompt_template": "System instructions...",
  "response_style": "Be friendly and practical...",
  "rubric": {
    "core_principles": {},
    "response_guidelines": {}
  }
}

Creating Custom Personas

  1. Create a JSON file with your persona definition
  2. Place it in a directory
  3. Load it using PersonaLoader with custom directory
from rilerary import PersonaLoader

loader = PersonaLoader(custom_persona_dir="./my_personas")
my_persona = loader.load("my_persona_name")

API Reference

Functions

  • load_persona(persona_name: str) - Load a persona by name
  • get_available_personas() - Get list of all available personas
  • get_persona_info(persona_name: str) - Get basic persona information

Classes

  • PersonaLoader - Main class for persona management
    • load(persona_name) - Load a persona
    • get_available() - List available personas
    • get_all() - Load all personas
    • get_persona_info(persona_name) - Get basic info

Utility Functions

  • build_system_prompt(persona_data, additional_context) - Build complete system prompt
  • get_prompt_template(persona_data) - Extract prompt template
  • get_specialties(persona_data) - Get persona specialties
  • validate_persona(persona_data) - Validate persona structure

License

MIT License - see LICENSE file for details

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

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

rilerary-0.2.3.tar.gz (28.6 kB view details)

Uploaded Source

Built Distribution

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

rilerary-0.2.3-py3-none-any.whl (33.3 kB view details)

Uploaded Python 3

File details

Details for the file rilerary-0.2.3.tar.gz.

File metadata

  • Download URL: rilerary-0.2.3.tar.gz
  • Upload date:
  • Size: 28.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for rilerary-0.2.3.tar.gz
Algorithm Hash digest
SHA256 f8c824473e38bbeecfb77157d6a9a178a71612224f1a9d231cb1937b39b3d5a9
MD5 2f1f1c8aa2c26dbf8790db4afcfbde69
BLAKE2b-256 144fb8ac9943b0f8d6f4b17d89d325d9e4c14b38d021e1dd84c06aa51ccf72cd

See more details on using hashes here.

File details

Details for the file rilerary-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: rilerary-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 33.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.4

File hashes

Hashes for rilerary-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a835ce452fa3a4b02999f8fc8f3055282278f7240f60902defd8aa488846a23d
MD5 2d11a2aea7c56a9195da6efa805a2e9b
BLAKE2b-256 c701c3cb75d75762f4b7d0c16dfd301f7bc6bf3744d842d6712d91cf60ae991a

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