Skip to main content

Get Your Credentials

Copy URI from Morphik Dashboard From the Morphik dashboard:
  • Python SDK: Click “Copy URI”
  • TypeScript/API: Click “Copy Token”

Installation

  • TypeScript/JavaScript
  • Python
npm install morphik

Ingest a Document

  • Python SDK
  • TypeScript SDK
  • API (cURL)
from morphik import Morphik

# Initialize with your URI
client = Morphik("YOUR_COPIED_URI")

# Ingest a file
with open('document.pdf', 'rb') as f:
    doc = client.ingest_file(f)
print(f"Document ID: {doc.id}")

Query Your Documents

  • Python SDK
  • TypeScript SDK
  • API (cURL)
from morphik import Morphik

# Initialize with your URI
client = Morphik("YOUR_COPIED_URI")

# Query with RAG
response = client.query(
    "What are the key points in this document?",
    k=5,
    use_colpali=True
)

print(response.answer)
I