# ragsys

RAGSys API is an innovative AI retrieval engine developed by Crossing Minds to enhance 
Large Language Model (LLM) performance without the need for traditional fine-tuning. 
By integrating Retrieval-Augmented Generation (RAG) techniques, RAGSys enables seamless adaptation 
of LLMs to various tasks and domains, offering a cost-effective and scalable solution for 
enterprises. 

Key Features of RAGSys:

- **Seamless Integration**: Compatible with any LLM, including those from Anthropic, OpenAI, and open-source alternatives, allowing effortless switching between models without losing optimizations. 
- **Enhanced Retrieval with RAG Embeddings**: Utilizes proprietary RAG embeddings to ensure better understanding and rapid information retrieval, even with massive datasets, resulting in more contextually relevant and accurate LLM outputs. 
- **Groundbreaking Accuracy Improvements**: Consistently outperforms traditional fine-tuning, achieving up to a 76% improvement on key benchmarks, with significant enhancements in truthfulness, emotion detection, and commonsense reasoning across various LLMs. 
- **Scalable Architecture**: Designed for enterprise-scale deployment, efficiently handling large datasets and complex retrieval tasks, ensuring consistent performance as AI needs grow. 

By leveraging RAGSys, organizations can rapidly adapt LLMs to new tasks or domains, saving computational resources and accelerating deployment cycles, all while maintaining high levels of accuracy and relevance in AI outputs. 


This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:

- API version: 1.0.0
- Package version: 1.0.0
- Generator version: 7.12.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.PythonClientCodegen

## Requirements.

Python 3.8+

## Installation & Usage
### pip install

If the python package is hosted on a repository, you can install directly using:

```sh
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
```
(you may need to run `pip` with root permission: `sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git`)

Then import the package:
```python
import ragsys
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import ragsys
```

### Tests

Execute `pytest` to run the tests.

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:

```python

import ragsys
from ragsys.rest import ApiException
from pprint import pprint

# Defining the base_url is optional and defaults to https://ragsys-api.crossingminds.com
# Create a RAGsys client with the API Key if necessary.
ragsys_client = ragsys.RAGSys(
    base_url="https://ragsys-api.crossingminds.com",
    # Configure API key using Bearer authorization: HTTPBearer
    api_key=os.environ["RAGSYS_API_KEY"]
)

# Enter a context with an instance of the API client
with ragsys.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = ragsys.CompletionApi(api_client)
    db_name = 'db_name_example' # str | Database name or ID
    completion_body = ragsys.CompletionBody() # CompletionBody | 

    try:
        # Completion
        api_response = api_instance.completion(db_name, completion_body)
        print("The response of CompletionApi->completion:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling CompletionApi->completion: %s\n" % e)

```

## Documentation for API Endpoints

All URIs are relative to *https://ragsys-api.crossingminds.com*

Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*CompletionApi* | [**completion**](docs/CompletionApi.md#completion) | **POST** /v1/databases/{db_name}/chat/completion | Completion
*CompletionApi* | [**get_models**](docs/CompletionApi.md#get_models) | **GET** /v1/databases/{db_name}/llm/models | Get Models
*DatabaseApi* | [**create_database**](docs/DatabaseApi.md#create_database) | **POST** /v1/databases | Create Database
*DatabaseApi* | [**get_database**](docs/DatabaseApi.md#get_database) | **GET** /v1/databases/{db_name} | Get Database
*DatabaseApi* | [**get_databases**](docs/DatabaseApi.md#get_databases) | **GET** /v1/databases | Get Databases
*DatabaseApi* | [**update_database**](docs/DatabaseApi.md#update_database) | **PATCH** /v1/databases/{db_name} | Update Database
*FewShotExampleApi* | [**get_saved_examples**](docs/FewShotExampleApi.md#get_saved_examples) | **GET** /v1/databases/{db_name}/examples | Get Saved Examples
*FewShotExampleApi* | [**retrieve_ranked_examples**](docs/FewShotExampleApi.md#retrieve_ranked_examples) | **POST** /v1/databases/{db_name}/examples/retrieve | Rank Examples With Retrieval Model
*FewShotExampleApi* | [**save_examples**](docs/FewShotExampleApi.md#save_examples) | **PATCH** /v1/databases/{db_name}/examples | Save Examples
*TaskApi* | [**get_task**](docs/TaskApi.md#get_task) | **GET** /v1/databases/{db_name}/task-types/{task_type}/tasks/{task_id} | Get Task
*TaskApi* | [**train_retrieval_model**](docs/TaskApi.md#train_retrieval_model) | **POST** /v1/databases/{db_name}/task-types/retrieval_model_retrain/tasks | Train Retrieval Model


## Documentation For Models

 - [Choice](docs/Choice.md)
 - [CompletionBody](docs/CompletionBody.md)
 - [CompletionResponse](docs/CompletionResponse.md)
 - [Content](docs/Content.md)
 - [ContentItem](docs/ContentItem.md)
 - [ContentItemType](docs/ContentItemType.md)
 - [CreateDatabaseRequest](docs/CreateDatabaseRequest.md)
 - [CreateOrPartialUpdateExamplesResponse](docs/CreateOrPartialUpdateExamplesResponse.md)
 - [DatabaseItem](docs/DatabaseItem.md)
 - [DatabaseListResponse](docs/DatabaseListResponse.md)
 - [Example](docs/Example.md)
 - [ExampleResponse](docs/ExampleResponse.md)
 - [ExamplesBody](docs/ExamplesBody.md)
 - [ExamplesResponse](docs/ExamplesResponse.md)
 - [GetConfigurationResponse](docs/GetConfigurationResponse.md)
 - [HTTPValidationError](docs/HTTPValidationError.md)
 - [ImageUrl](docs/ImageUrl.md)
 - [InitDatabaseResponse](docs/InitDatabaseResponse.md)
 - [LlmListModelsResponse](docs/LlmListModelsResponse.md)
 - [MessageCompletionContent](docs/MessageCompletionContent.md)
 - [MessageContent](docs/MessageContent.md)
 - [MessageRole](docs/MessageRole.md)
 - [Retrieval](docs/Retrieval.md)
 - [RetrieveExamples](docs/RetrieveExamples.md)
 - [RetrieveExamplesResponse](docs/RetrieveExamplesResponse.md)
 - [TaskResponse](docs/TaskResponse.md)
 - [TaskType](docs/TaskType.md)
 - [TaskWithDetailsResponse](docs/TaskWithDetailsResponse.md)
 - [UpdateDatabase](docs/UpdateDatabase.md)
 - [Usage](docs/Usage.md)
 - [ValidationError](docs/ValidationError.md)
 - [ValidationErrorLocInner](docs/ValidationErrorLocInner.md)


<a id="documentation-for-authorization"></a>
## Documentation For Authorization


Authentication schemes defined for the API:
<a id="HTTPBearer"></a>
### HTTPBearer

- **Type**: Bearer authentication


## Author

contact@crossingminds.com


