Skip to main content

A sample AI toolkit by Schogini Systems with Retrieval-Augmented Generation (RAG).

Project description

SchoginiAI

SchoginiAI is a robust AI toolkit developed by Schogini Systems, providing advanced Retrieval-Augmented Generation (RAG) capabilities. It leverages the power of LangChain, OpenAI, and multiple vector storage options like FAISS, ChromaDB, and Pinecone. This makes it a versatile tool for building AI-driven solutions for various applications.


๐Ÿš€ Features

  • PDF & Text Processing: Extracts knowledge from PDF files or raw text for vector storage.
  • Flexible Vector Stores: Supports FAISS, ChromaDB, and Pinecone for vector management.
  • Advanced Text Chunking: Includes configurable chunking strategies like RecursiveCharacterTextSplitter and TokenTextSplitter.
  • Environment-Based Configurations: Manages API keys and settings securely using .env files.
  • RAG Capabilities: Combines vector retrieval with OpenAIโ€™s LLMs for generating relevant, context-aware responses.

๐Ÿ›  Installation

From PyPI

Install SchoginiAI directly from PyPI:

pip install SchoginiAI

From Source

Clone the repository and install locally:

git clone https://github.com/yourusername/SchoginiAI.git
cd SchoginiAI
pip install .

Replace yourusername with your GitHub username.


๐Ÿ”ง Configuration

Environment Variables

Create a .env file to securely store your API keys:

OPENAI_API_KEY=your_openai_api_key
PINECONE_API_KEY=your_pinecone_api_key

Custom Settings

Edit the settings.py file to configure the following options:

  • Vector Store Type: Choose between faiss, chroma, or pinecone.
  • Text Splitter Strategy: Select chunking strategies like RecursiveCharacterTextSplitter or TokenTextSplitter.
  • Chunk Size and Overlap: Control the size and overlap of text chunks.

Example settings.py snippet:

vector_store_type = "chroma"  # Options: 'faiss', 'chroma', 'pinecone'
text_splitter_strategy = "RecursiveCharacterTextSplitter"
chunk_size = 1000
chunk_overlap = 200

๐Ÿ“š Usage

Build Vector Store from Text

from SchoginiAI import SchoginiAIRAG

rag_ai = SchoginiAIRAG()

sample_text = """
Schogini Systems is a pioneer in AI Chatbots.
We specialize in automation solutions for small businesses.
"""

rag_ai.build_vector_store(sample_text)
rag_ai.save_vector_store()

Query the Vector Store

from SchoginiAI import SchoginiAIRAG

rag_ai = SchoginiAIRAG()
rag_ai.load_vector_store()

response = rag_ai.ask_question("What services does Schogini Systems provide?")
print("Response:", response)

Build Vector Store from PDF

from SchoginiAI import SchoginiAIRAG

rag_ai = SchoginiAIRAG()
rag_ai.build_vector_store_from_pdf("path/to/your/pdf_file.pdf")
rag_ai.save_vector_store()

๐Ÿณ Docker Usage

Build Docker Image

docker build --no-cache -t schoginiai .

Run Docker Commands

Create Vector Store

  • Using FAISS:

    docker run --rm -e OPENAI_API_KEY="your_openai_api_key" -e PINECONE_API_KEY="your_pinecone_api_key" schoginiai create
    
  • Using ChromaDB:

    docker run --rm -e OPENAI_API_KEY="your_openai_api_key" -e PINECONE_API_KEY="your_pinecone_api_key" schoginiai create
    

Query Vector Store

  • Using FAISS:

    docker run --rm -e OPENAI_API_KEY="your_openai_api_key" -e PINECONE_API_KEY="your_pinecone_api_key" schoginiai query
    
  • Using ChromaDB:

    docker run --rm -e OPENAI_API_KEY="your_openai_api_key" -e PINECONE_API_KEY="your_pinecone_api_key" schoginiai query
    

Replace "your_openai_api_key" and "your_pinecone_api_key" with your actual keys.


๐Ÿ—ƒ Project Structure

SchoginiAI/
โ”œโ”€โ”€ SchoginiAI/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ main.py
โ”œโ”€โ”€ examples/
โ”‚   โ”œโ”€โ”€ usage_example.py
โ”‚   โ”œโ”€โ”€ knowledge_creation.py
โ”‚   โ””โ”€โ”€ .env
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_faiss.py
โ”‚   โ”œโ”€โ”€ test_chroma.py
โ”œโ”€โ”€ settings.py
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ Dockerfile
โ”œโ”€โ”€ doit.sh
โ””โ”€โ”€ setup.py

๐Ÿ“ฆ Dependencies

SchoginiAI relies on the following Python packages:

  • langchain>=0.0.200
  • openai>=0.28.1
  • faiss-cpu>=1.7.6
  • chromadb>=0.3.22
  • python-dotenv>=0.21.0

Install these dependencies using:

pip install -r requirements.txt

๐Ÿ›ก License

This project is licensed under the MIT License.


๐Ÿ“š Additional Resources


With this setup, SchoginiAI is ready to handle advanced AI-driven tasks with ease and flexibility. For more details, refer to the source code or open an issue in the repository.

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

schoginiai-0.2.2.tar.gz (11.0 kB view details)

Uploaded Source

Built Distribution

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

SchoginiAI-0.2.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file schoginiai-0.2.2.tar.gz.

File metadata

  • Download URL: schoginiai-0.2.2.tar.gz
  • Upload date:
  • Size: 11.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for schoginiai-0.2.2.tar.gz
Algorithm Hash digest
SHA256 3f39c7d71d364878e009034b9bee94a1983658b7b058f52034613e3a542e3159
MD5 4f8c209d691228f745a6195e8141957d
BLAKE2b-256 829c13677f2f9c655668db562e8c621466a0bc4f53d8fd90aefe401c5edab5f8

See more details on using hashes here.

File details

Details for the file SchoginiAI-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: SchoginiAI-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.11

File hashes

Hashes for SchoginiAI-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2dce6aa41c609180f24448480fb9d6c36f4463f6cd150b34f9881f1d7927b86a
MD5 de1b786b7d6baa9a184f607a4b63a266
BLAKE2b-256 6288252da389ada8269a16b50bd05ca5f3d668c5144f765a90cff9ee361d6642

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