Skip to main content

POMA AI Logo

POMA: Preserving Optimal Markdown Architecture

Quick-Start Guide

Installation

Requires Python 3.10+. Install the core package:

pip install poma

For different integrations:

pip install 'poma[langchain]'
pip install 'poma[llamaindex]'
pip install 'poma[qdrant]'

# Or LangChain/LlamaIndex/Qdrant including example extras:
pip install 'poma[all]'
  • You may also want: pip install python-dotenv to load API keys from a .env file.
  • API keys required (POMA_API_KEY) for the POMA AI client via environment variables.
  • To request a POMA_API_KEY, please contact us at sdk@poma-ai.com

Usage

from poma import PrimeCut, generate_cheatsheets

pc = PrimeCut(api_key="your_key")

# Ingest a document — submits the file, polls, and returns typed results
result = pc.ingest("document.pdf")

print(result.chunksets[0])
print(result.chunks[0].content)

# Eco ingestion uses the same flow against the eco endpoints
eco_result = pc.ingest_eco("document.pdf")

To test this flow from the command line (requires POMA_API_KEY in the environment):

python -m poma document.pdf          # run both ingest and ingest_eco
python -m poma path/to/file.pdf      # custom file
python -m poma document.pdf --no-eco   # standard ingest only
python -m poma document.pdf --eco     # eco ingest only

Generate cheatsheets as a top-level utility:

cheatsheets = generate_cheatsheets(
    relevant_chunksets=result.chunksets,
    all_chunks=result.chunks,
)
print(cheatsheets[0]["content"])

If you already have a .poma archive, unpack it directly:

from poma import unpack

archived_result = unpack("document.poma")
print(archived_result.chunks[0].content)

Async clients use the same API shape:

import asyncio

from poma import AsyncPrimeCut


async def main() -> None:
    async with AsyncPrimeCut(api_key="your_key") as pc:
        result = await pc.ingest("document.pdf")
        print(result.chunksets[0])


asyncio.run(main())

Grill ingests documents into a per-project namespace and serves prompt-ready retrieval context for RAG.

Auth note: Grill endpoints require a project-level key (prefix poma_proj_gr_...), not the account-level POMA_API_KEY. Set POMA_GRILL_API_KEY in your environment. The SDK validates the prefix at construction and raises InvalidGrillApiKeyError if you accidentally use the wrong one.

from poma import Grill

g = Grill()  # reads POMA_GRILL_API_KEY

# 1. Ingest a document. Grill indexes it into your project namespace
#    (no archive download). `result.status == "done"` when ready.
#    Attach up to 64 categorical labels for query-time filtering, and
#    two integer fields (e.g. a timestamp / revision) for range queries.
result = g.ingest(
    "document.pdf",
    labels=["year:1982", "source:treasury"],
    meta_int_1=1672531200,
)
print(result.job_id, result.status, result.usage)

# 1b. Or let Grill fetch the file itself from a public URL — no upload.
#     Optionally POST a webhook when the job finishes; the value is
#     "<url>|<header>:<value>|..." (server caps it at 1024 chars).
result = g.ingest(
    remote_url="https://example.com/document.pdf",
    completion="https://example.com/hook|x-api-key:secret",
)

# 2. Run hybrid search across all documents in the namespace.
#    Returns a prompt-ready XML+Markdown block — drop it into an LLM prompt.
#    Optionally narrow by labels: labels_any (match any) / labels_all (match all).
ctx = g.search(
    "How do I configure retries?",
    target_tokens=2048,
    labels_all=["source:treasury"],
    meta_int_1_gte=1640995200,  # range filter on the integer metadata
)
print(ctx.context)

# 3. List, inspect, and delete documents in the namespace.
#    To find the doc you just ingested, match source_job_id to the job_id.
for doc in g.list_docs():
    print(doc.doc_id, doc.filename, doc.pages)

deleted = g.delete_doc(doc.doc_id)
print(deleted.vectors_deleted, deleted.storage_deleted)

The async client mirrors the same surface:

import asyncio
from poma import AsyncGrill


async def main() -> None:
    async with AsyncGrill() as g:
        ctx = await g.search_in_doc("summarize section 3", "doc_abc123")
        print(ctx.context)


asyncio.run(main())

Example Implementations

All examples, integrations, and additional information can be found in our GitHub repository: poma-ai/poma

We provide example implementations to help you get started with POMA AI:

  • example.py — A standalone implementation for documents, showing the basic POMA AI workflow with simple keyword-based retrieval
  • example_langchain.py — Integration with LangChain, demonstrating how easy it is to use POMA AI with LangChain
  • example_llamaindex.py — Integration with LlamaIndex, showing how simple it is to use POMA AI with LlamaIndex

Note: The integration examples use OpenAI embeddings. Make sure to set your OPENAI_API_KEY environment variable, or replace the embeddings with your preferred ones.

All examples follow the same two-phase process (ingest → retrieve) but demonstrate different integration options for your RAG pipeline.

! Please do NOT send any sensitive and/or personal information to POMA AI endpoints without having a signed contract & DPA !

Metadata

Release files for poma 0.6.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poma 0.6.1
File Size Uploaded
poma-0.6.1.tar.gz 65.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for poma 0.6.1
File Interpreter ABI Platform
poma-0.6.1-py3-none-any.whl Python 3 none any Details

Total release size: 120.1 kB

Release files / poma-0.6.1.tar.gz

Download URL poma-0.6.1.tar.gz
Size 65.4 kB
Tags Source
SHA-256 checksum
How to use checksums
141bcbee8216ebd87384e193155bd7c4dadb693c3db989ca601707bdf105b2bb
BLAKE2b-256 checksum
How to use checksums
09c0a4ab48f2a5c1885d0dc63fd0c3c8c8e3f0c848cdf113a918df447b77d352
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release files / poma-0.6.1-py3-none-any.whl

Download URL poma-0.6.1-py3-none-any.whl
Size 54.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bdcf00d7f6cab0b28aaa8a53ca8b4f89ad349e5919b5f311a9636336686a6215
BLAKE2b-256 checksum
How to use checksums
ceefac6b027f035a7d8a71669acc0119df0fc845376f0d43b4f98f0ada576c6b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 23, 2026.

Transparency log

Release history Release notifications | RSS feed

0.8.0

2 release files

0.7.0

2 release files

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.4

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.4

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.7

2 release files

0.3.6

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.4

2 release files

0.1.2

2 release files

0.1.0

2 release files

0.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page