Skip to content

Add agentic request-response example #1294

@GautamBytes

Description

@GautamBytes

Description

Add a new standalone example on top of libp2p.request_response that demonstrates a simple agent workflow using two one-shot request/response exchanges:

  1. capability_query
  2. store_intent

The example should be Filecoin-aligned in naming and semantics, but fully local to py-libp2p. It should not call Synapse SDK, Filecoin services, or any external providers.

Motivation

The new libp2p.request_response helper currently has a generic JSON example, but there is no higher-level example showing how to build an agent-style control plane on top of it.

This example should demonstrate:

  • capability discovery
  • structured task submission
  • validation and rejection paths
  • partial-success results
  • deterministic, inspectable responses over real libp2p streams

Requirements

  • add an example-local protocol module for message validation and deterministic simulation
  • add a runnable demo that:
    • starts a listener without -d
    • connects and sends capability_query then store_intent with -d
  • use a single protocol ID with a "type" discriminator
  • simulate Filecoin-aligned storage semantics:
    • size validation
    • metadata limits
    • root vs session-key style authorization
    • provider catalog with one unhealthy provider
    • complete, partial, and rejected result states
  • register a console script for the example
  • add docs page + examples index entry
  • add focused tests for validation logic and host-to-host integration

Open questions

No response

Are you planning to do it yourself in a pull request ?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions