πŸš€ Quick StartΒΆ

Get up and running with Ryoma in under 5 minutes! This guide covers the essentials to start analyzing data with AI.

πŸ“‹ PrerequisitesΒΆ

  • Python 3.9+ - Ryoma requires Python 3.9 or higher

  • API Key - OpenAI API key or other supported LLM provider

  • Database (optional) - PostgreSQL, MySQL, SQLite, or other supported databases

πŸ“¦ InstallationΒΆ

Basic InstallationΒΆ

pip install ryoma_ai

With Database SupportΒΆ

# PostgreSQL support
pip install ryoma_ai[postgres]

# Snowflake support
pip install ryoma_ai[snowflake]

# All database connectors
pip install ryoma_ai[all]

🎯 Quick Start Options¢

Option 1: CLI InterfaceΒΆ

The fastest way to get started:

# Set your API key
export OPENAI_API_KEY="your-api-key-here"

# Start the CLI
ryoma_ai --setup

# Or start with defaults
ryoma_ai

Then use natural language:

ryoma_ai> show me all tables in my database
ryoma_ai> what customers made purchases last month?
ryoma_ai> create a chart of sales by region

Option 3: Pandas AgentΒΆ

For DataFrame analysis:

from ryoma_ai import Ryoma
import pandas as pd

# Create sample data
df = pd.DataFrame({
    'customer_id': [1, 2, 3, 4, 5],
    'revenue': [1000, 2500, 1800, 3200, 900],
    'region': ['North', 'South', 'East', 'West', 'North']
})

# Create Ryoma and pandas agent
ryoma = Ryoma()
agent = ryoma.pandas_agent(model="gpt-4")
agent.add_dataframe(df, df_id="sales_data")

# Analyze with natural language
result = agent.stream("What's the average revenue by region?")
print(result)

πŸš€ Advanced FeaturesΒΆ

Multiple DatasourcesΒΆ

from ryoma_ai import Ryoma
from ryoma_data import DataSource

# Create Ryoma instance
ryoma = Ryoma()

# Add multiple datasources
ryoma.add_datasource(
    DataSource("postgres", host="localhost", database="sales", user="user", password="pass"),
    name="sales"
)
ryoma.add_datasource(
    DataSource("postgres", host="localhost", database="marketing", user="user", password="pass"),
    name="marketing"
)

# Create agent (uses first datasource by default)
agent = ryoma.sql_agent(model="gpt-4", mode="enhanced")

# Query sales database
agent.stream("Show top products by revenue")

# Switch to marketing database
ryoma.set_active("marketing")
agent.stream("Show campaign performance")

Agent ModesΒΆ

# Basic mode - simple SQL generation
agent = ryoma.sql_agent(model="gpt-4", mode="basic")

# Enhanced mode - multi-step reasoning with safety validation
agent = ryoma.sql_agent(model="gpt-4", mode="enhanced")

# ReFoRCE mode - state-of-the-art with self-refinement
agent = ryoma.sql_agent(model="gpt-4", mode="reforce")

πŸ”§ ConfigurationΒΆ

Environment VariablesΒΆ

# Set your API key
export OPENAI_API_KEY="your-api-key-here"

# Optional: Configure other providers
export ANTHROPIC_API_KEY="your-anthropic-key"

βœ… Verify InstallationΒΆ

Run this quick test to ensure everything is working:

from ryoma_ai import Ryoma
from ryoma_data import DataSource

# Create in-memory SQLite database
datasource = DataSource("sqlite", database=":memory:")

# Create Ryoma and agent
ryoma = Ryoma(datasource=datasource)
agent = ryoma.sql_agent(model="gpt-3.5-turbo", mode="basic")

print("βœ… Ryoma is ready to use!")

🎯 Next Steps¢

Now that you have Ryoma running, explore these advanced features:

πŸ†˜ Need Help?ΒΆ