Skip to content

Feature/local embed bge remme rebuild - #8

Open
riteshverma wants to merge 5 commits into
sync/wise-ai-propagationfrom
feature/local-embed-bge-remme-rebuild
Open

riteshverma wants to merge 5 commits into
sync/wise-ai-propagationfrom
feature/local-embed-bge-remme-rebuild

Conversation

@riteshverma

Copy link
Copy Markdown
Owner

No description provided.

…gnore

- Deleted unused cache files, including mcp_cache.json and various database snapshots.
- Removed large binary files related to FAISS indexing and document metadata.
- Updated .gitignore to include new local cache and runtime files for better tracking and management.
…rrect run status

- routers/runs.py: thread tenant_context + storage_namespace through process_run;
  derive final_result status from plan_graph (mirror process_resume) so cancelled
  or crashed runs no longer report "completed"; offload get_embedding via
  asyncio.to_thread with fail-fast breaker when Ollama is unavailable; add
  runs.index.json path for fast listing.
- core/loop.py, memory/context.py: accept storage_namespace and use it for
  per-tenant session file paths; async-safe session saves via asyncio.Lock +
  asyncio.to_thread.
- integrations/tenancy.py: add storage_namespace_for_tenant helper.
- integrations/registry.py: real tenant-tier adapter hook (instead of a silent
  no-op); explicit integration_id from client still wins.
- core/supabase_auth.py: long-lived PyJWKClient per JWKS URL (TTL wrapper was
  invalidating its own cache every 5 minutes); verify_supabase_jwt offloaded
  via asyncio.to_thread; safer bearer extraction.
- core/supabase_config.py (new): single source for Supabase URL/keys/flags.
- core/embedding.py (new), remme/utils.py: unified Ollama embedding helper that
  raises on failure instead of returning a zero vector.
- tests/integrations/test_runs_router_contract.py: coverage for AST-parsed RAG
  snippets and explicit tenant_context propagation.

Made-with: Cursor
Builds on the Tier 1 commit (tenancy plumbing, JWT handling, unified
embeddings, correct run status).

Tier 2 - performance and reliability
- mcp_servers/multi_mcp.py: asyncio.wait_for around call_tool using
  settings.mcp.tool_timeout_seconds.
- core/event_bus.py: per type:source drop counters, sampled warning
  logs, optional slow-consumer disconnect, drop_stats accessor.
- mcp_servers/server_rag.py: use shared embedding helper with
  per-item fallback and post-fetch normalization.

Tier 3 - scheduler and supabase logging
- core/scheduler.py: pytz-based timezone from settings; save_jobs
  offloaded to a thread; lazy CanonicalRunRequest construction in
  job_wrapper.
- core/supabase_logging.py: shared httpx.AsyncClient; structured
  warning logs; retry with backoff on 5xx.

Tier 4 - integration contracts
- integrations/contracts.py: CanonicalRunRequest.query min_length=1;
  new CanonicalRunResponse envelope.
- integrations/adapters/default.py: reject empty queries and
  validate responses through CanonicalRunResponse.
- integrations/profiles.py: warn + Prometheus counter on profile
  parse errors.

Tier 5 - tests, config, docs
- tests/core/: event bus, scheduler, and persistence unit tests.
- tests/integrations/test_contracts.py: empty-query validation test.
- config/settings.defaults.json, config/settings.json,
  config/settings_loader.py: mcp.tool_timeout_seconds and
  scheduler.timezone, with MCP_TOOL_TIMEOUT_SECONDS and
  SCHEDULER_TIMEZONE env overrides.
- README.md: configuration override-policy section.
- api.py: use get_supabase_config in health_auth.
- docs/EAGV2_S18_FLOW_REHEARSAL.md: S18 flow rehearsal notes.

Made-with: Cursor
- Optional local-embed extra with sentence-transformers; core/embedding.py routes
  by models.embedding_provider (ollama vs sentence_transformers) with BGE v1.5 prompts.
- settings_loader.get_embedding_provider; defaults include embedding_provider.
- models.json: qwen2.5:7b-instruct and bge-base-en-v1.5 metadata.
- RemmeStore.rebuild_embeddings_from_texts and scripts/rebuild_remme_embeddings.py.
- Lockfile updated for local-embed optional dependency.

Made-with: Cursor
Comment thread core/embedding.py

for embed_url, payload in _build_embed_candidates(full_text):
try:
response = requests.post(embed_url, json=payload, timeout=timeout or OLLAMA_TIMEOUT)

This branch has not been deployed

No deployments
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.

2 participants