Skip to content

rossman22590/aitutor-api-rag

Repository files navigation

AI Tutor RAG API

The intelligent solution for storing your documents and powering context-aware AI agents. Build powerful RAG applications at any scale.

License: MIT


Table of Contents


Overview

AI Tutor RAG API is a cutting-edge solution designed to empower your AI applications with context-aware answers derived directly from your document storage. By leveraging Retrieval-Augmented Generation (RAG) techniques, our API enhances AI responses by combining general AI capabilities with precise, context-specific information from your documents. Whether you're running an enterprise-level solution or a personal project, AI Tutor RAG API scales seamlessly to meet your needs.


What is RAG?

RAG (Retrieval-Augmented Generation) enhances AI responses by integrating relevant data directly from your documents. Instead of relying solely on pre-trained AI models, RAG dynamically searches your document repositories to fetch accurate and context-aware information. This allows your AI system to provide responses that are not only intelligent but also highly specific to your content.

Learn More


Key Features

  • Full Control:
    Leverage our RAG API with the freedom to choose your infrastructure. Customize and modify your document workflows to precisely match your requirements.

  • Enterprise-Grade Privacy:
    Secure your data with robust security measures including Row-Level Security (RLS) for granular, role-based access control. Your documents remain private and protected at all times.

  • Built to Scale:
    Efficiently handle millions of documents with concurrent processing and horizontal scaling. Our solution is built using modern technologies like AI Tutor, Next.js, and TypeScript to ensure performance at scale.

  • Developer-First Experience:
    Enjoy an intuitive API with comprehensive documentation, a quick setup process, and deep customization options. Get your project up and running in no time.

  • Community Driven:
    Join a thriving community of developers who continuously contribute, improve, and extend the capabilities of the API.


Installation

Node.js

To install the AI Tutor RAG API package in a Node.js environment, run:

pnpm install 

Python

For Python projects, please refer to our documentation for detailed setup instructions and package availability.

Other Environments

Check our documentation for additional installation guides and Docker support to deploy on your preferred platform.


Environment Variables

Before running the API, ensure that the following environment variables are set in your project:

# API Keys and URL configurations
DEMO_RAG_API_KEY=715031
NEXT_PUBLIC_API_URL=https://rag-api-llm.up.railway.app
OPENAI_API_KEY=sk-ppQA

These environment variables are required to authenticate and configure the API endpoints properly.


Usage

Below is a simple example demonstrating how to integrate AI Tutor RAG API into your Node.js project:

const RAGApi = require('ai-tutor-rag-api');

const client = new RAGApi({
  apiKey: process.env.DEMO_RAG_API_KEY,
  endpoint: process.env.NEXT_PUBLIC_API_URL
});

async function getResponse(query) {
  try {
    const response = await client.query({ q: query });
    console.log('Context-Aware Answer:', response.answer);
  } catch (error) {
    console.error('Error querying the API:', error);
  }
}

getResponse('Explain the benefits of RAG in document management.');

For more examples and detailed usage instructions, refer to our API Documentation.


API Documentation

Explore our comprehensive API documentation that covers:

  • Endpoint descriptions
  • Query parameters
  • Authentication methods
  • Response formats
  • Error handling guidelines

Visit our Documentation Page for a complete guide.


Contributing

We welcome contributions to improve AI Tutor RAG API! To get started:

  1. Fork the Repository:
    Create a fork of the project on GitHub.

  2. Create a New Branch:
    Develop your feature or bug fix on a new branch.

    git checkout -b feature/YourFeature
  3. Commit Your Changes:
    Make meaningful commits with clear messages.

    git commit -m "Add feature: Detailed description of your changes"
  4. Push and Create a Pull Request:
    Push your branch to your fork and open a pull request.

Ensure that your code adheres to our style guidelines and that all tests pass before submitting your PR.


Community

Join our vibrant community of developers and enthusiasts:

  • Contributors:
    Charlie Davis, Marie Otaki, Diana Evans, Magio, Taishi Kato, and many more.

  • Discussion Forums:
    Share ideas and seek help on our Community Forum.

  • Chat with PDF Demo:
    Explore live demos showcasing how our API interacts with PDF documents to provide deep insights.


License

This project is licensed under the MIT License. See the LICENSE file for details.


Contact

For questions, suggestions, or support, please reach out via:

  • GitHub Issues: Open an issue in this repository
  • Community Forum: Engage with fellow developers on our Forum

© AI Tutor RAG API. All rights reserved.