Quickstart.md
To install the RagaAI Catalyst package, run the following command in your terminal:
pip install ragaai-catalyst
To begin using Catalyst, initialize it as follows:
from ragaai_catalyst import RagaAICatalyst
catalyst = RagaAICatalyst(
access_key="YOUR_ACCESS_KEY", # Replace with your access key
secret_key="YOUR_SECRET_KEY", # Replace with your secret key
base_url="BASE_URL"
)
Create a new project and choose a use case from the available options:
# Create a new project
project = catalyst.create_project(
project_name="Project_Name",
usecase="Q/A" # Options : Chatbot, Q/A, Others, Agentic Application
)
# List available use cases
print(catalyst.project_use_cases())
Initialize the dataset manager and create a dataset from a CSV file, DataFrame, or JSONl file.
Define a schema mapping for the dataset.
from ragaai_catalyst import Dataset
# Initialize dataset manager
dataset_manager = Dataset(project_name="Project_Name")
# Create dataset from a CSV file
dataset_manager.create_from_csv(
csv_path="path/to/your.csv",
dataset_name="MyDataset",
schema_mapping={
'column1': 'schema_element1',
'column2': 'schema_element2'
}
)
# View dataset schema
print(dataset_manager.get_schema_mapping())
Auto-Instrumentation automatically traces your application after initializing the correct tracer.
from ragaai_catalyst import init_tracing, Tracer
# Initialize the tracer
tracer = Tracer(
project_name="Project_Name",
dataset_name="Dataset_Name",
tracer_type="agentic/langgraph"
)
# Enable auto-instrumentation
init_tracing(catalyst=catalyst, tracer=tracer)
Choose from the given supported tracer types based on your framework:
agentic/langgraphagentic/langchainagentic/smolagentsagentic/openai_agentsagentic/llamaindexagentic/haystackYou can enable custom tracing in two ways:
with tracer() function.tracer.start() and tracer.stop().from ragaai_catalyst import Tracer
# Initialize production tracer
tracer = Tracer(
project_name="Project_Name",
dataset_name="tracer_dataset_name",
tracer_type="tracer_type"
)
# Start a trace recording (Option 1)
with tracer():
# Your code here
# Start a trace recording (Option 2)
tracer.start()
# Your code here
# Stop the trace recording
tracer.stop()
# Verify data capture
print(tracer.get_upload_status())
Evaluation from ragaai_catalyst.from ragaai_catalyst import Evaluation
# Initialize evaluation engine
evaluation = Evaluation(
project_name="Project_Name",
dataset_name="MyDataset"
)
# Define Schema-mapping
schema_mapping = {
'Query': 'prompt',
'response': 'response',
'Context': 'context',
'expectedResponse': 'expected_response'
}
evaluation.add_metrics(
metrics=[
{
"name": "Faithfulness",
"config": {"model": "gpt-4o-mini", "provider": "openai", "threshold": {"gte": 0.232323}},
"column_name": "Faithfulness_v1",
"schema_mapping": schema_mapping
}
]
)
# Get status and results
print(f"Status: {evaluation.get_status()}")
print(f"Results: {evaluation.get_results()}")
Version: 1.0.0 | Last Updated: Mar 2025