Skip to main content
Version: 1.1.0

Auto-attributes (Phase 1)

Overview

Structured metadata for documents deposited by automatic services (Tower v2, n8n, future agents), separate from manual user attributes. Powers Smart Lists (Listes Automatiques) in IP Magic Box and platform ops tooling.

Canonical repo guide: neo-backend/docs/auto-attributes.md.

How it works

  • Ingest: POST /documents with Bearer token; optional Bcyip-Agent / Bcyip-Version / Bcyip-Platform headers. Agent tokens must have apitokens.agent set (ops/Retool). Technical codes bcyip:agent and bcyip:agent-version are server-injected.
  • Manual deposit unchanged: IP Magic Box upload + anchor stays on legacy POST /files/upload + POST /documents.
  • Folders: companies.folders[].type = manual | auto; auto folders filter by targetAttributeCodes or targetAutoAttributes.
  • Platform ops: /platform/* routes use X-Platform-Admin-Token (PLATFORM_ADMIN_TOKEN env).

Key files

  • src/domains/document/document.service.ts — ingest validation, idempotence, folder resolver
  • src/domains/document/templates/documents.ts — Tower hall filter (bcyip:agent any value)
  • src/domains/platform/agents/ — agent CRUD + allowed codes
  • src/domains/platform/auto-attribute-codes/ — global catalogue + LOV
  • src/core/auth/auth.service.tsapiTokenAgent from apitokens.agent

Technical decisions

  • Separate arrays: autoAttributes[] vs attributes[] — manual workflows untouched.
  • No seed scripts: catalogue and agents bootstrapped via platform API.
  • Optional fileId: two-step n8n flow (legacy upload → neo document).

Known issues

  • Tower tokens need apitokens.agent: 'iptower' before agent ingest in prod.
  • IP Magic Box tokens do not need apitokens.agent for manual deposit.

Next steps

  • GET /platform/auto-attribute-codes/:code/observed-values for ops label editor
  • Phase 2: folder write rules, migration tooling