feat: auto-generate document IDs in MossClient and CLI#181
feat: auto-generate document IDs in MossClient and CLI#181Abhijitam01 wants to merge 5 commits intousemoss:mainfrom
Conversation
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>
There was a problem hiding this comment.
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.
Summary
auto_id: bool = Falseparameter toMossClient.create_index()andMossClient.add_docs()— whenTrue, replaces all document IDs with fresh UUID4 values using an immutable pattern (newDocumentInfoobjects, originals untouched)auto_idsupport toload_documents()in moss-cli, making theidfield optional in JSON/CSV/JSONL source files when--auto-idis passed--auto-idCLI flag tomoss index createandmoss doc addcommandsCloses #172
Test plan
TestApplyAutoIds+TestAutoIdIntegration) — all passingTestLoadDocumentsAutoId) — all passing--auto-idflag works end-to-end via CLI