Get Your Credentials

Copy URI from Morphik Dashboard

From the Morphik dashboard:

  • Python SDK: Click “Copy URI”
  • TypeScript/API: Click “Copy Token”

Installation

npm install morphik

Ingest a Document

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

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)