Skip to content

fix: cap source_targets to 10 per edge type (Zep API limit)#263

Open
ojaciepierdole wants to merge 6 commits into666ghj:mainfrom
ojaciepierdole:fix/zep-source-targets-limit
Open

fix: cap source_targets to 10 per edge type (Zep API limit)#263
ojaciepierdole wants to merge 6 commits into666ghj:mainfrom
ojaciepierdole:fix/zep-source-targets-limit

Conversation

@ojaciepierdole
Copy link

Problem

When the LLM generates an ontology with many entity types (e.g. 10), a single edge/relationship type can have more than 10 source_target pairs. The Zep Cloud API rejects this with:

status_code: 400
message='source_targets cannot contain more than 10 items (max)'

This causes graph building to fail silently — the task stays in a "building" state and the frontend polls indefinitely.

Fix

Truncate source_targets to at most 10 items per edge type before calling set_ontology(), consistent with how MAX_ENTITY_TYPES and MAX_EDGE_TYPES are already enforced in ontology_generator.py.

Changes

  • backend/app/services/graph_builder.py: source_targets[:10] (1 line)

Test

  1. Upload a document that generates ≥10 entity types
  2. Graph building now succeeds instead of failing with 400

pjhoberman and others added 6 commits March 18, 2026 19:42
Add internationalization support to the MiroFish frontend with
Chinese (zh-CN) as the default language and English (en) as an
alternative, switchable via a toggle button in the header.

Changes:
- Install vue-i18n and configure with Composition API mode
- Create zh-CN and en locale files with ~262 translation keys
- Add useLocaleToggle composable for shared language toggle logic
- Replace hardcoded Chinese strings with $t() calls across all
  14 Vue components and 7 views
- Add language toggle button to all page headers
- Persist language preference in localStorage
- Configure Vite @ path alias for clean imports

Chinese regex patterns that parse backend LLM responses are
intentionally preserved unchanged (Step4Report.vue, Step2EnvSetup.vue).

Also fixes API base URL to use window.location.hostname instead of
hardcoded localhost, enabling remote access.

Closes 666ghj#117
Closes 666ghj#182

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Home page navbar is transparent (not dark as assumed), so the
white-on-transparent button was invisible. Use explicit light gray
background with dark text for guaranteed visibility on any background.
Also increase button size across all views for better discoverability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pass the user's language preference (from Accept-Language header) through
the backend to all LLM prompt generation, so agent profiles, simulation
configs, and prediction reports are generated in the user's chosen language.

Changes:
- Frontend: attach Accept-Language header to all API requests via
  axios interceptor (reads from localStorage mirofish-locale)
- Backend: new app/utils/i18n.py with locale helpers
- Profile generator: bilingual prompts for individual and group personas
- Report agent: English versions of plan, section, and chat prompts
- Simulation config generator: bilingual time/event/agent config prompts
- Interview prompt: locale-aware prefix
- API routes: capture locale before background threads, pass through
  the entire call chain

Locale flow:
  API endpoint -> captured before thread -> SimulationManager ->
  OasisProfileGenerator / SimulationConfigGenerator / ReportAgent

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Time/event/agent config progress messages and reasoning labels were
hardcoded in Chinese. Now locale-aware.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- ReportLogger: all log messages now bilingual (planning start/complete,
  section start, react thought, report complete)
- generate_report(): all progress callbacks bilingual
- Step4Report.vue: panorama/insight/interview/search display labels
  translated via $t() calls (active memories, historical memories,
  entities, expand/collapse, tabs, etc.)
- Added 28 new step4.* locale keys for tool result UI

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Zep Cloud API returns 400 when an edge type has more than 10
source_target pairs. With 10 entity types, a single relationship
can easily exceed this limit.

This follows the same truncation pattern already used for
MAX_ENTITY_TYPES and MAX_EDGE_TYPES in ontology_generator.py.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants