Skip to content

feat: add moss-connector-dynamodb (DynamoDB source connector)#180

Open
Abhijitam01 wants to merge 5 commits intousemoss:mainfrom
Abhijitam01:feat/add-moss-connector-dynamodb
Open

feat: add moss-connector-dynamodb (DynamoDB source connector)#180
Abhijitam01 wants to merge 5 commits intousemoss:mainfrom
Abhijitam01:feat/add-moss-connector-dynamodb

Conversation

@Abhijitam01
Copy link
Copy Markdown

@Abhijitam01 Abhijitam01 commented Apr 26, 2026

Summary

  • Add new moss-connector-dynamodb package that scans a DynamoDB table, maps items to DocumentInfo via user-supplied mapper, and ingests into a Moss search index
  • Follows established connector pattern (mirrors MongoDB connector structure with _template/ scaffold)
  • Pulls in existing moss-data-connector/ packages (template, SQLite, MongoDB) from upstream
  • Updates parent README connector table and adds streaming ingest TODO

Key design decisions

  • scan_kwargs dict — single passthrough dict for all DynamoDB scan options (FilterExpression, ProjectionExpression, ExpressionAttributeNames, etc.) instead of separate params
  • endpoint_url param — enables DynamoDB Local / localstack for dev/testing
  • Standard boto3 credential chain — no AWS credential constructor params
  • Immutable scan_kwargs copy in __iter__ to prevent mutation across iterations

Closes #171

Test plan

  • 4 unit tests passing (single page, multi page, scan_kwargs forwarding, empty table)
  • Integration test requires live AWS + Moss credentials (DYNAMODB_TABLE, AWS_REGION, MOSS_PROJECT_ID, MOSS_PROJECT_KEY)
  • Verify pip install -e ".[dev]" and python -c "from moss_connector_dynamodb import DynamoDBConnector, ingest" work

Generated with Claude Code


Open in Devin Review

Abhijitam01 and others added 5 commits April 9, 2026 01:10
Adds a Python Semantic Kernel plugin that exposes Moss retrieval as a
@kernel_function, letting any SK agent query a Moss index with 3 lines
of code. Mirrors the strands-agents-moss integration pattern.

Includes plugin implementation, 14 unit/integration tests, example,
README with Quick Start and configuration docs, and TODOS.md for
follow-up work (CI/CD pipeline, .NET design doc).
feat: add Semantic Kernel plugin for Moss semantic search
Aligns with the rest of the repo — all other integration packages
(strands-agents-moss, elevenlabs-moss, pipecat-moss, moss-cli) depend
on moss and import from moss, not inferedge-moss.
Add a new DynamoDB source connector package that reads every item from
a DynamoDB table via boto3 scan with automatic pagination, maps each
item to a DocumentInfo via a user-supplied mapper, and ingests them
into a Moss search index.

Key design decisions:
- scan_kwargs dict for all DynamoDB scan options (FilterExpression,
  ProjectionExpression, ExpressionAttributeNames, etc.)
- endpoint_url param for DynamoDB Local / localstack dev/testing
- Standard boto3 credential chain (no AWS credential params)
- Immutable scan_kwargs copy in __iter__ to prevent mutation

Also pulls in the existing moss-data-connector packages (template,
SQLite, MongoDB) from upstream/main, updates the parent README with
the DynamoDB row, and adds a streaming/batched ingest TODO.

Closes usemoss#171

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

View 3 additional findings in Devin Review.

Open in Devin Review

Comment on lines +30 to +32
# Import your driver *inside* this method, not at module top, so
# importing the package never fails just because the driver isn't
# installed.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Template connector comment contradicts template README import rule

The template connector.py comment on lines 30-32 says to import the driver inside __iter__, but the template README.md at packages/moss-data-connector/_template/README.md:30 explicitly states the opposite rule: "Declare your driver as a main dependency in pyproject.toml and import it at the top of the module." All three actual connectors (SQLite, MongoDB, DynamoDB) follow the README rule and import at the top. A new contributor copying this template would see contradictory advice, and if they follow the code comment, their connector would diverge from the established pattern and the authoritative rules.

Suggested change
# Import your driver *inside* this method, not at module top, so
# importing the package never fails just because the driver isn't
# installed.
# Import your driver at the top of the module (see README rules).
# Declare it as a main dependency in pyproject.toml so pip installs it.
#
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment on lines +64 to +71
project_id: Moss project ID. Falls back to ``MOSS_PROJECT_ID`` env var.
project_key: Moss project key. Falls back to ``MOSS_PROJECT_KEY`` env var.
index_name: Name of the Moss index to query.
top_k: Number of results to retrieve per query.
alpha: Blend between semantic (1.0) and keyword (0.0) scoring.
result_prefix: Prefix prepended to formatted search results.
"""
self._client = MossClient(project_id=project_id, project_key=project_key)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 MossPlugin documents env-var fallback that isn't implemented in MossClient

The MossPlugin.__init__ docstring at packages/semantic-kernel-moss/src/semantic_kernel_moss/moss_plugin.py:64-65 claims project_id and project_key fall back to MOSS_PROJECT_ID / MOSS_PROJECT_KEY env vars. However, MossClient.__init__ at sdks/python/sdk/src/moss/client/moss_client.py:65 takes project_id: str, project_key: str with no env-var fallback visible in the Python layer. The pre-existing strands-agents-moss package follows the identical pattern (strands_agents_moss/moss_search_tool.py:72), so this appears to be an intentional convention — the fallback likely happens in the Rust ManageClient/IndexManager bindings. Could not verify without access to the Rust source. If the Rust layer does NOT handle None, users relying on env-var fallback would get a runtime error.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@yatharthk2
Copy link
Copy Markdown
Collaborator

can you please provide with loom demo, does not have to be more than 1 min

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feat] : Add moss-connector-dynamodb; DynamoDB source connector

2 participants