RAGify Documentation
RAGify is an AI-powered document analysis framework that combines the capabilities of large language models with efficient document retrieval. It enables intelligent document processing, semantic search, and contextual question answering.
Fast Processing
Process large documents in seconds with optimized chunking and parallel processing capabilities.
Smart Analysis
Leverage GPT-4 for deep document understanding and intelligent question answering.
Vector Search
Utilize Pinecone for efficient semantic search across your document collection.
Getting Started
Follow these steps to set up RAGify in your environment:
Install Dependencies
pip install ragify
pip install openai pinecone-client langchain
Environment Setup
export OPENAI_API_KEY="your-api-key"
export PINECONE_API_KEY="your-pinecone-key"
export PINECONE_ENV="your-environment"
Pinecone Configuration
Configure Pinecone for vector storage and retrieval:
Initialize Pinecone
from ragify import PineconeManager
# Initialize Pinecone connection
pm = PineconeManager(
api_key="your-api-key",
environment="your-environment"
)
# Create vector index
pm.create_index("docs-index", dimension=1536)
# Connect to existing index
index = pm.connect_index("docs-index")
OpenAI Integration
Set up document processing with OpenAI embeddings:
Document Processing
from ragify import DocumentProcessor
processor = DocumentProcessor()
# Process single document
doc_embeddings = processor.process_file("document.pdf")
# Process directory
collection = processor.process_directory("./docs")
# Query documents
results = collection.query(
"What are the key findings?",
model="gpt-4-turbo-preview"
)
API Reference
Endpoint | Method | Description |
---|---|---|
/documents/process | POST | Process and embed documents |
/documents/query | POST | Query processed documents |
/collections | GET | List document collections |
/collections/{id} | GET | Get collection details |
Example API Usage
import requests
# Process document
response = requests.post(
"https://api.ragify.com/documents/process",
files={"file": open("document.pdf", "rb")}
)
# Query documents
response = requests.post(
"https://api.ragify.com/documents/query",
json={
"query": "What are the main conclusions?",
"collection_id": "col_123"
}
)