# Context Compressor: Notes to a Task Brief (`physealabs/context-compressor`) Actor

Turn long notes, logs, transcripts, or handoffs into a brief for a named task.

- **URL**: https://apify.com/physealabs/context-compressor.md
- **Developed by:** [jay casey](https://apify.com/physealabs) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$10.00 / 1,000 document compresseds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Context Compressor

Turn long notes, logs, transcripts, or handoffs into a brief for a named task.

### What can Context Compressor do?

Send one or more text items and state the task each item should support. The Actor returns an objective, facts, constraints, steps, unresolved points, and the next evidence needed.

| What you get | Features |
|--|--|
| 📌 A task brief with facts and constraints | 📦 Batch input with one result row per item |
| 🪜 Steps, open points, and next evidence | 📝 JSON dataset plus Markdown report |

### Who this is for

- Prepare a clean brief from meeting notes
- Condense logs before a new work session
- Extract next steps from a handoff

### What you get back

| Field | Type | What you get | Example |
|--|--|--|--|
| `index` | `integer` | Position of this item in the input list. | `1` |
| `status` | `string` | Whether this item completed its requested analysis. | `success` |
| `title` | `string` | Title reported for the source item. | `Product launch notes` |
| `task` | `string` | Task used to focus the compressed brief. | `Prepare a launch go or no-go decision` |
| `objective` | `string` | Goal extracted for the task. | `Prepare a launch go or no-go decision` |
| `facts` | `array` | Facts retained from the source notes. | `["Launch target is October 1","Budget is $20,000","Alice owns engineering","Security review takes four weeks","Vendor A costs $12,000 per year","The team pre...` |
| `constraints` | `array` | Conditions that limit the next action. | `["Budget must not exceed $20,000","Security review must be completed before launch","EU data residency must be resolved before launch"]` |
| `steps` | `array` | Recommended next actions. | `["Confirm EU data residency compliance status","Evaluate if Vendor A fits within budget and maintenance preferences","Schedule and complete security review b...` |
| `unresolved` | `array` | Open issues that still need resolution. | `["EU data residency compliance status","Final vendor selection and cost validation","Security review completion status"]` |
| `error` | `null` | Problem details when this item does not complete. | `null` |
| `decisions` | `array` | Decisions found in the source notes. | `[]` |
| `source_references` | `array` | Source chunks supporting the brief. | `[{"ref":"source chunk 1 of 1","note":"Initial task-relevant facts provided"}]` |
| `resolved_conflicts` | `array` | Conflicts settled from the provided context. | `[]` |
| `rejected_approaches` | `array` | Approaches ruled out by the provided context. | `[]` |
| `next_required_evidence` | `array` | Evidence needed before the next decision. | `["EU data residency compliance documentation","Vendor A cost breakdown and maintenance requirements","Security review completion confirmation"]` |
| `processedAt` | `string` | Time the Actor processed this item. | `2026-09-11T17:07:24.758504+00:00` |

The run also links to its dataset and any files named in the Actor output.

### What you need to provide

| Field | Type | Required | What it does | Example |
|--|--|--:|--|--|
| `items` | `array` | Yes | Process one or more items in a single run. Each item produces exactly one dataset row. | `[{"title":"October product launch notes","task":"Prepare the launch go/no-go decision",...` |
| `items[].title` | `string` | No | A short label used to identify this document in results. | `October product launch notes` |
| `items[].task` | `string` | Yes | The task or next decision the compressed brief should support. | `Prepare the launch go/no-go decision` |
| `items[].text` | `string` | Yes | The long notes, transcript, logs, or source context to compress. | `We need launch by October. Budget is $20,000. Alice owns engineering. Security review t...` |

#### Quick start

1. Open the Actor in Apify Console.
2. Click **Try for free** or **Create a task**.
3. Replace the sample values with your own input.
4. Click **Start**.
5. Open the dataset and the named output files when the run ends.

### Pricing

- `document-compressed`: $0.01 per document compressed.
- Failed or skipped work is not charged unless an event is listed in the run charges.
- Normal Apify compute and proxy costs may also apply.

### Limits and honest notes

- Each item must include `task` and `text`. A title is optional.
- The Actor compresses the source for the named task. It does not return the full source text.
- An item failure is saved as an error row. Other items can still finish.

### Code and API

The examples below use the same values as the Apify Console sample.

#### Input JSON

```json
{
  "items": [
    {
      "title": "October product launch notes",
      "task": "Prepare the launch go/no-go decision",
      "text": "We need launch by October. Budget is $20,000. Alice owns engineering. Security review takes four weeks. Vendor A costs $12,000 yearly. Team prefers low maintenance. Open question: EU data residency."
    }
  ]
}
```

#### Real output sample

This excerpt comes from the real run named in the current marketplace release report.

```json
{
  "index": 1,
  "status": "success",
  "title": "October product launch notes",
  "task": "Prepare the launch go/no-go decision",
  "objective": "Prepare the launch go/no-go decision",
  "facts": [
    "Launch target date is October",
    "Budget is $20,000",
    "Alice owns engineering",
    "Security review takes four weeks",
    "Vendor A costs $12,000 yearly",
    "Team prefers low maintenance",
    "Open question: EU data residency"
  ],
  "constraints": [
    "Must meet October launch date",
    "Cannot exceed $20,000 budget",
    "Security review is mandatory and takes four weeks",
    "Team preference is for low maintenance solutions"
  ],
  "decisions": [],
  "source_references": [
    {
      "ref": "Source chunk 1",
      "note": "Initial task-relevant facts provided"
    }
  ],
  "resolved_conflicts": [],
  "rejected_approaches": [],
  "steps": [
    "Confirm October launch date feasibility",
    "Assess vendor costs against budget",
    "Schedule security review",
    "Evaluate EU data residency implications",
    "Confirm engineering ownership and readiness",
    "Assess maintenance requirements of selected vendor"
  ],
  "unresolved": [
    "EU data residency compliance status",
    "Final vendor selection",
    "Exact timeline for security review integration"
  ],
  "next_required_evidence": [
    "EU data residency compliance status",
    "Vendor A maintenance requirements",
    "Engineering readiness report from Alice"
  ],
  "processedAt": "2026-09-11T04:30:08.300852+00:00"
}
```

#### curl

```sh
curl -X POST "https://api.apify.com/v2/acts/physealabs~context-compressor/runs?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d @input.json
```

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("physealabs/context-compressor").call(run_input={'items': [{'title': 'October product launch notes', 'task': 'Prepare the launch go/no-go decision', 'text': 'We need launch by October. Budget is $20,000. Alice owns engineering. Security review takes four weeks. Vendor A costs $12,000 yearly. Team prefers low maintenance. Open question: EU data residency.'}]})
items = client.dataset(run["defaultDatasetId"]).list_items().items
```

#### Node.js

```js
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('physealabs/context-compressor').call({"items": [{"title": "October product launch notes", "task": "Prepare the launch go/no-go decision", "text": "We need launch by October. Budget is $20,000. Alice owns engineering. Security review takes four weeks. Vendor A costs $12,000 yearly. Team prefers low maintenance. Open question: EU data residency."}]});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
```

You can call this Actor from an agent or LLM tool that can send HTTP requests to the Apify API. Keep the Apify token in a secret store.

### FAQ

#### How many items can I send?

You can add more than one object to `items`. Each object produces one row.

#### Is a title required?

No. `title` is optional.

#### Where are the readable results?

Open `RESULTS.md` in the run key value store.

# Actor input Schema

## `items` (type: `array`):

Process one or more items in a single run. Each item produces exactly one dataset row.

## Actor input object example

```json
{
  "items": [
    {
      "title": "October product launch notes",
      "task": "Prepare the launch go/no-go decision",
      "text": "We need launch by October. Budget is $20,000. Alice owns engineering. Security review takes four weeks. Vendor A costs $12,000 yearly. Team prefers low maintenance. Open question: EU data residency."
    }
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

One structured result row per input item.

## `markdown` (type: `string`):

Readable report containing all item results.

## `summary` (type: `string`):

Processed, succeeded, and error counts.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "items": [
        {
            "title": "October product launch notes",
            "task": "Prepare the launch go/no-go decision",
            "text": "We need launch by October. Budget is $20,000. Alice owns engineering. Security review takes four weeks. Vendor A costs $12,000 yearly. Team prefers low maintenance. Open question: EU data residency."
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("physealabs/context-compressor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "items": [{
            "title": "October product launch notes",
            "task": "Prepare the launch go/no-go decision",
            "text": "We need launch by October. Budget is $20,000. Alice owns engineering. Security review takes four weeks. Vendor A costs $12,000 yearly. Team prefers low maintenance. Open question: EU data residency.",
        }] }

# Run the Actor and wait for it to finish
run = client.actor("physealabs/context-compressor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "items": [
    {
      "title": "October product launch notes",
      "task": "Prepare the launch go/no-go decision",
      "text": "We need launch by October. Budget is $20,000. Alice owns engineering. Security review takes four weeks. Vendor A costs $12,000 yearly. Team prefers low maintenance. Open question: EU data residency."
    }
  ]
}' |
apify call physealabs/context-compressor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,physealabs/context-compressor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/D0vfJ2q8KW3NKo66O/builds/bWGa0fzt9gpW2y886/openapi.json
