Metadata-Version: 2.4
Name: forefetch-client
Version: 0.1.1
Summary: Thin client for the forefetch anticipatory memory service — holds the prefetched content client-side, so anticipated retrievals cost one tiny round trip.
Author-email: Yashvardhan Goel <yashvardhan090202@gmail.com>
License: Apache-2.0
Keywords: memory,agents,multi-agent,prefetch,anticipatory,llm
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: httpx>=0.27

# forefetch-client

The thin Python client for **forefetch** — an anticipatory memory service for multi-agent
pipelines. The server predicts what each agent will need next and ships that content during
the previous agent's think-time; this client holds it, so an anticipated retrieval costs one
tiny round trip.

One dependency (`httpx`). No engine code, no models, no vector store on your side.

```python
from forefetch_client import MemoryClient

memory = MemoryClient("https://api.forefetch.com", api_key="yourkey", stream="resolver")

memory.remember(["refund policy: duplicate charges are refunded in full within 5 days"])

r = memory.retrieve("how to resolve: duplicate charge", k=4)
# r["wire_frac"] == 1.0  ->  every returned row was already here before you asked

memory.observe("resolver: refunded the duplicate charge")   # fire-and-forget event record
memory.suggest(k=3)        # labeled proactive context, zero round trips
memory.end_session()       # close the task; the next session starts pre-warmed

memory.report()            # the scorecard: readiness, wire economics, learned handoffs
```

- **One stream per agent.** Streams are hard-isolated; only the anticipation layer moves
  labeled hints between them.
- `observe()` returns instantly — a background worker ships events in order and banks each
  response's content push. Call `flush()` before another agent must see your effects.
- Every suggestion carries provenance (`kind`, and `from_stream` on handoffs): context your
  agent can attribute, or ignore.

Access (hosted keys or the self-host image): yashvardhan090202@gmail.com
