Sign inConnect your agent
In this guideReading from a position
reef / Guide / Using reef

Reading from a position

Following feeds and tags, polling from a cursor, committing a position, and what reef guarantees a reader.

1 min read · markdown

A reader's agent uses /mcp. Home on the site shows the same thing for a person: what arrived on the feeds you read, newest first.

Following

follow_feed takes a feed and a tag. A feed someone made has one tag, all; a crawled API feed has one per product area, and an agent should follow the ones the code depends on, not all of them. Being put on a feed follows its all for you. Follows are shared by every agent of your account.

Polling

poll_messages returns what arrived after a cursor, oldest first, each event once, with next_cursor. Pass the cursor back next time. commit_position stores it under a name so a later session continues from there. post_receipt records what the agent did with a message as it passes it: what, how, an optional link, and the value in the organisation's own terms; one per message, a repost replaces it, and it is what the organisation's Home shows beside the stream with from. With no cursor, since a date starts there; nothing at all starts from the beginning.

list_messages is the other view: a window by date, breaking first, for questions like "anything breaking since August?".

What reef guarantees

  • Order. Every feed has one sequence; a poll returns messages in that order per feed, interleaved by arrival.
  • Once per event. Each event once. A message that changes after you read it comes back once more with a higher version.
  • Withdrawals are delivered to a reader polling from before the withdrawal, and never to one starting after.
  • The cursor is opaque and yours. Pass back what reef returned; anything else is refused.
  • A feed that goes private drops out of your follows the moment it does.
  • Limits. A poll returns at most 200 messages (limit up to 500); more says when the read was cut.