-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Fix/embedding 384 #804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Fix/embedding 384 #804
Conversation
0.1.0 release of Archon! Improvements across the board to crawling speed and reliability, RAG strategies, docs, task management, and documentation.
Release workflow update for Archon 0.1.0 release.
Adjusting permissions in release note workflow for Archon 0.1.0 release
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
Embedding models of size 384 are supported in the sql files, but `embedding_384` was missing from the python file `document_storage_service.py`.
WalkthroughAdded explicit handling for 384-dimensional embeddings in storage services; both document and code storage now map embedding_dim == 384 to the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
python/src/server/services/storage/code_storage_service.py (1)
1310-1325: Consider adding tests for 384-dimensional embedding support.Issue #803 specifically requested unit/integration tests covering embedding dimension selection (including the 384 case) and a regression test verifying successful batch insert for 384-d vectors. Adding these tests would prevent regressions and provide confidence that the fix works as intended.
Tests could cover:
- Correct column selection for embedding_dim = 384
- Successful batch insert of 384-d vectors into
embedding_384column- Error handling when embedding dimension is unsupported
- Consistency between code_storage_service and document_storage_service
Based on learnings
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
python/src/server/services/storage/code_storage_service.py(1 hunks)
🧰 Additional context used
📓 Path-based instructions (3)
python/src/**/*.py
📄 CodeRabbit inference engine (AGENTS.md)
python/src/**/*.py: On service startup, missing configuration, DB connection failures, auth/authorization failures, critical dependency outages, or invalid/corrupting data: fail fast and bubble errors
For batch processing, background tasks, WebSocket events, optional features, and external API calls: continue processing but log errors (with retries/backoff for APIs)
Never accept or persist corrupted data; skip failed items entirely (e.g., zero embeddings, null FKs, malformed JSON)
Error messages must include operation context, IDs/URLs, use specific exception types, preserve full stack traces (logging with exc_info=True), and avoid returning None/null—raise exceptions instead; for batches report success counts and detailed failures
Backend code targets Python 3.12 and adheres to a 120 character line length
Use Ruff for linting (errors, warnings, unused imports) in backend code
Use Mypy for static type checking in backend code
python/src/**/*.py: Fail fast and loud on startup/config/auth/database/critical dependency failures and validation errors in backend services
Preserve full stack traces with logging.exc_info=True in Python logging
Use specific exception types and avoid catching generic Exception
Use Pydantic to raise on data validation errors; never silently accept bad data
Python 3.12 code should conform to a 120-character line length
Never return None to indicate failure in backend Python; raise exceptions with details instead
Files:
python/src/server/services/storage/code_storage_service.py
python/src/server/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
Never accept corrupted data in backend flows; skip failed items entirely instead of storing bad data (e.g., zero embeddings, null FKs, malformed JSON)
Files:
python/src/server/services/storage/code_storage_service.py
python/src/server/services/**/*.py
📄 CodeRabbit inference engine (CLAUDE.md)
python/src/server/services/**/*.py: For batch/background/optional operations, continue processing but log detailed per-item failures; report success counts and failure lists
Implement business logic in service modules, keeping database concerns separate
Place service logic under python/src/server/services/
Files:
python/src/server/services/storage/code_storage_service.py
🔇 Additional comments (2)
python/src/server/services/storage/code_storage_service.py (2)
1310-1311: LGTM! Embedding dimension handling now supports 384-d vectors.The addition correctly maps 384-dimensional embeddings to the
embedding_384database column, preventing the dimension mismatch errors described in issue #803.
1310-1325: Embedding_384 schema verified and handled consistently
Confirmed theembedding_384column exists in all migration scripts (includingarchon_code_examples) and is mapped identically in both storage services.
Pull Request
Summary
fixes #803
Changes Made
document_storage_service.pyandcode_storage_service.pyType of Change
Affected Services
Testing
Test Evidence
I no longer get any warnings in the logs about the embedding model size not being supported.
Furthermore, it now correctly uploads my files.
Checklist
Breaking Changes
Additional Notes
Summary by CodeRabbit
New Features
Bug Fixes