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
RecursiveCharacterTextSplitterandTokenTextSplitter. - Environment-Based Configurations: Manages API keys and settings securely using
.envfiles. - 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, orpinecone. - Text Splitter Strategy: Select chunking strategies like
RecursiveCharacterTextSplitterorTokenTextSplitter. - 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.200openai>=0.28.1faiss-cpu>=1.7.6chromadb>=0.3.22python-dotenv>=0.21.0
Install these dependencies using:
pip install -r requirements.txt
๐ก License
This project is licensed under the MIT License.
๐ Additional Resources
- LangChain Documentation
- OpenAI API Documentation
- FAISS Documentation
- ChromaDB Documentation
- Python-Dotenv Documentation
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file schoginiai-0.2.1.tar.gz.
File metadata
- Download URL: schoginiai-0.2.1.tar.gz
- Upload date:
- Size: 9.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d2b1c6cb5469635017ff579ee8d73b18bc5670c733174a31b86b6c5980376c0
|
|
| MD5 |
8eb4fb424357ba084d48cd24958429f4
|
|
| BLAKE2b-256 |
309f521117bb5957a7fd66e768d548aa5d8949745ecfb8a6bb3a8f23bbcc1150
|
File details
Details for the file SchoginiAI-0.2.1-py3-none-any.whl.
File metadata
- Download URL: SchoginiAI-0.2.1-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e727e9490f31d9013b22a796d5e7253de7fabc19bd951bca8ca1e998f41cc866
|
|
| MD5 |
8e3696fee97cf4405dd3db9aeca794f6
|
|
| BLAKE2b-256 |
085627ee5ae1dd3b99548916ee470eda96d29878cb407a2d20c54e9051a3fc92
|