Skip to content

[P1] Adapter intent/context plumbing — all 8 adapters discard parameters #29

@se-jo-ma

Description

@se-jo-ma

Problem

Adapter.execute(intent, scope, context) accepts intent: IntentAnalysis and context: dict per the Protocol (nautilus/adapters/base.py:145-168), but every concrete adapter discards them:

  • nautilus/adapters/postgres.py:178del intent, context # Phase 1: intent/context not consumed by postgres adapter
  • nautilus/adapters/pgvector.py:208del intent # embedding comes from context, not intent, in Phase 1
  • nautilus/adapters/neo4j.py:313del intent, context # Phase 2: intent/context not consumed by Neo4j adapter
  • nautilus/adapters/elasticsearch.py:296del intent, context # Phase 2: intent/context not consumed by ES adapter
  • nautilus/adapters/influxdb.py:217del intent, context # Phase 1: intent/context not consumed
  • nautilus/adapters/s3.py:135del intent, context # Phase 1: not consumed by S3 adapter
  • nautilus/adapters/rest.py:405del intent, context # Phase 2: intent/context not consumed by REST adapter
  • nautilus/adapters/servicenow.py:245del intent, context # Phase 2: intent/context not consumed by SN adapter

Why it matters

Two paths forward:

  1. Implement intent-aware adapter behavior — at least one adapter should consume intent to demonstrate the contract. Candidates: pgvector (use intent.entities to filter ANN results), Elasticsearch (use intent.data_types_needed to bias scoring), Postgres (use intent.entities to add WHERE clauses beyond scope).
  2. Drop the params from the Protocol — if no adapter will ever consume them, the signature is dead weight + signature rot risk. Move to a separate IntentAwareAdapter Protocol that opts in.

Code locations

  • nautilus/adapters/base.py:145-168 — Protocol definition
  • All 8 adapter execute() impls listed above

Acceptance

Pick path 1 or 2 explicitly:

  • Path 1: at least one adapter ships intent-aware filtering with integration test demonstrating the difference vs intent=empty.
  • Path 2: Adapter.execute() Protocol simplified to (scope, context) or (scope) only; new IntentAwareAdapter Protocol introduced for the future use case.

Priority

P1 — current state risks signature rot and confuses adapter authors about the contract.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priority: load-bearing v1 gaparea/adaptersAdapter SDK + built-in adaptersenhancementNew feature or requestsize/L<1 week: cross-cutting feature

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions