Skip to content

feat: auto-generate document IDs in MossClient and CLI#181

Open
Abhijitam01 wants to merge 5 commits intousemoss:mainfrom
Abhijitam01:AbhijitamSylus/auto-id-ingest
Open

feat: auto-generate document IDs in MossClient and CLI#181
Abhijitam01 wants to merge 5 commits intousemoss:mainfrom
Abhijitam01:AbhijitamSylus/auto-id-ingest

Conversation

@Abhijitam01
Copy link
Copy Markdown

@Abhijitam01 Abhijitam01 commented Apr 26, 2026

Summary

  • Adds auto_id: bool = False parameter to MossClient.create_index() and MossClient.add_docs() — when True, replaces all document IDs with fresh UUID4 values using an immutable pattern (new DocumentInfo objects, originals untouched)
  • Adds auto_id support to load_documents() in moss-cli, making the id field optional in JSON/CSV/JSONL source files when --auto-id is passed
  • Adds --auto-id CLI flag to moss index create and moss doc add commands

Closes #172

Test plan

  • 9 new SDK unit tests (TestApplyAutoIds + TestAutoIdIntegration) — all passing
  • 8 new CLI unit tests (TestLoadDocumentsAutoId) — all passing
  • 55/55 existing SDK tests pass (zero regressions)
  • Manual smoke test with real index
  • Verify --auto-id flag works end-to-end via CLI

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 `auto_id: bool = False` to MossClient.create_index() and
MossClient.add_docs() that replaces all document IDs with fresh UUID4
values. Uses immutable pattern — creates new DocumentInfo objects,
never mutates originals.

Also adds auto_id support to moss-cli's load_documents() and
--auto-id flags on `moss index create` and `moss doc add` commands,
making the `id` field optional in JSON/CSV/JSONL source files.

Includes 17 new tests (9 SDK + 8 CLI) with full coverage.

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 1 potential issue.

⚠️ 1 issue in files not directly in the diff

⚠️ Type stub (.pyi) not updated for new auto_id parameter on create_index and add_docs (sdks/python/sdk/src/moss/__init__.pyi:13-25)

The PR adds an auto_id: bool = False parameter to both MossClient.create_index (moss_client.py:97) and MossClient.add_docs (moss_client.py:118), but the type stub at sdks/python/sdk/src/moss/__init__.pyi:13-18 and sdks/python/sdk/src/moss/__init__.pyi:20-25 was not updated. Since the project enforces mypy with disallow_untyped_defs = true (per pyproject.toml) and CONTRIBUTING.md mandates "If you've changed APIs, update the documentation", this means: (1) any SDK user calling client.create_index(..., auto_id=True) will get a mypy error about an unexpected keyword argument, and (2) IDE autocompletion won't suggest the new parameter.

View 4 additional findings in Devin Review.

Open in Devin Review

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] : Auto-generate document IDs in ingest()

1 participant