Skip to main content
Locker turns every completed document into an active part of your workflow. Deadlines are extracted from the document’s data and surfaced as obligations in the command center; the full document repository is searchable with natural-language queries.

Obligations

An obligation is a deadline or financial commitment derived from a document’s canonical data. For typed OREA/TRREB packs, obligations are derived deterministically—no AI is involved, and the result is exact.

Obligation types

When a document is generated, obligations are written to the DocumentObligation table and linked to the document’s deal (if one is set). When a document is signed (DOCUMENT_SIGNED event), the obligations are re-synced to reflect the executed state.

Urgency

Each obligation carries an urgency level computed from its due date relative to today:

The obligations feed

The obligations feed (GET /api/documents/obligations) returns upcoming and overdue obligations across your organization’s documents, sorted soonest first. By default it looks ahead 30 days; pass ?withinDays=N to adjust the window (maximum 365).
Locker indexes every document’s content as a vector embedding, enabling natural-language search over your document repository. Example queries:
  • “leases expiring this summer with rent over $3,000”
  • “condo purchase agreements for Harbour Street”
  • “rental applications with pets clause”
Search returns a ranked list of document IDs with similarity scores. Your application or the in-app search bar can then fetch the matched documents for display.
Semantic search requires the AI gateway to be configured (@repo/ai, including an embedding model accessible via the AI_EMBEDDING_MODEL environment variable). Without it, documents are still stored and their obligations are tracked, but natural-language search will return no results.
Embeddings are generated automatically when a document is rendered (generated). They are also regenerated when a signed document is re-indexed. The embedding model defaults to text-embedding-3-small and is configurable via the AI_EMBEDDING_MODEL environment variable.

What is indexed

The embedding is built from the document’s canonical data (all string values, traversed up to six levels deep) prefixed with the form key. For a typed OREA pack this includes parties, addresses, dates, amounts, conditions, and schedules. For uploaded generic templates it includes whatever text is in the fill data.

Obligation extraction from uploaded documents

For uploaded (generic) PDF templates and completed documents imported from external providers (such as DocuSign Connect), Locker can extract obligations using the AI gateway. The extraction is Zod-validated—the model’s output is checked against the obligation schema and rejected if it does not conform. AI-extracted obligations are flagged with extractedByAi: true so you can distinguish them from the deterministic OREA-pack derivation.
AI extraction requires the AI gateway to be configured. Typed OREA/TRREB packs never use AI extraction for obligations—their deadlines are derived exactly from the canonical data.

CRM wiring

Obligations link to deals via dealId. The morning command center reads the obligations feed and displays upcoming deadlines in urgency order.
A signed document does not automatically advance the deal stage or create a closing checklist on the deal — those are separate, manual steps today. The closing checklist has its own closing date and milestones; it is not generated from a document’s obligations.