Skip to content

feat: batch import + embed fallback - #488

Merged
ajianaz merged 6 commits into
developfrom
feat/batch-import-fallback
Jun 28, 2026
Merged

ajianaz merged 6 commits into
developfrom
feat/batch-import-fallback

Conversation

@ajianaz

@ajianaz ajianaz commented Jun 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

Batch Import --batch-dir

  • Import all .md/".txt"/.jsonl from a directory in one command
  • Two strategies: Document (auto-chunk embed, no LLM) / MemoryExtract (LLM fact extraction)
  • Flags: --batch-dir, --recursive, --as-doc, --as-memory, --max-size, --extract, --dry-run

Embed Fallback

  • FallbackEmbedder: tries primary embedder, falls back to cloud API on failure
  • MockEmbedder: returns zero vectors for dry-run/testing
  • Config via [embed_fallback] in uteke.json or env vars
  • Dimension validation at startup

Files Changed

  • uteke-core/src/embed/fallback.rs — NEW (FallbackEmbedder + MockEmbedder + 7 tests)
  • uteke-core/src/lib.rs — FallbackSettings + wiring
  • uteke-cli/src/config.rs — EmbedFallbackConfig
  • uteke-cli/src/cli.rs — 7 new Import flags
  • uteke-cli/src/commands/maintenance.rs — batch import + 10 unit tests
  • CHANGELOG.md — v0.6.0 entry

Tests

  • 291 passed (281 core + 7 fallback + 10 CLI batch import), 0 failed
  • CI: clippy clean, cora review passed

Deferred to v0.6.1

  • Rate limiter (semaphore + 429 backoff)
  • Parallel extraction via thread pool (--extract-parallel N)

ajianaz added 5 commits June 28, 2026 12:26
- FallbackEmbedder: local ONNX primary with optional cloud fallback
- EmbedFallbackConfig in CLI config + env var resolution
- FallbackSettings in core + set_fallback_settings() method
- Wire fallback wrapping in ensure_embedder() with dim validation
- Batch import: discover_files, determine_strategy, run_import_batch
- import_single_document via doc_upsert_with_parent
- Sequential memory extraction loop with error bail-out
- Dry-run mode, JSON output, progress summary

Tasks #1-7 of v0.6.0 milestone (#17)
- Add --batch-dir, --as-doc, --as-memory, --extract-parallel (1-10),
  --dry-run, --max-size, --recursive flags to Import command
- Wire batch mode dispatch in commands/mod.rs
- Make ImportStrategy pub(crate) for cross-module access
- conflicts_with/requires clap constraints for UX safety

Task #10 of v0.6.0
Tests: discover_files (md/txt/jsonl, recursive, max_size, not-dir),
determine_strategy (default, force, extract flag), slug_from_path,
title_from_slug.

Task #12 of v0.6.0
Task #13 — final commit for v0.6.0 batch import & embed fallback feature.
…pped_facts

Cora review: ambiguous 'skipped' field mixed file-level and fact-level
skip counts. Now tracks them separately for clearer batch import reporting.

All 287 tests pass.
@github-actions

Copy link
Copy Markdown

🔍 Cora AI Code Review

✅ No issues found. Code looks good!


Review powered by cora-cli · BYOK · MIT

…_str_replace

- Allow clippy::too_many_arguments on run_import_batch (11 args, intentional)
- Allow dead_code on BatchFileResult (used by JSON output, not constructed yet)
- Collapse consecutive str::replace into single call

CI should pass: fmt + clippy clean, 10/10 tests pass.
@ajianaz
ajianaz merged commit 389dd9d into develop Jun 28, 2026
8 checks passed
@ajianaz
ajianaz deleted the feat/batch-import-fallback branch June 28, 2026 06:34
ajianaz added a commit that referenced this pull request Aug 13, 2026
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.

1 participant