feat: configurable embedding infrastructure — local (fastembed) + API (OpenAI) (#675)

- Add agent/embeddings.py with Embedder protocol, FastEmbedEmbedder, OpenAIEmbedder
- Factory function get_embedder() reads provider from config.yaml embeddings section
- Lazy initialization — no startup impact, model loaded on first embed call
- cosine_similarity() and cosine_similarity_matrix() utility functions included
- Add fastembed as optional dependency in pyproject.toml
- 30 unit tests, all passing

Closes #675
This commit is contained in:
teyrebaz33
2026-03-08 19:57:51 +03:00
committed by teknium1
parent 60cba55d82
commit cc4ead999a
3 changed files with 433 additions and 0 deletions

View File

@@ -51,6 +51,7 @@ pty = [
"pywinpty>=2.0.0; sys_platform == 'win32'",
]
honcho = ["honcho-ai>=2.0.1"]
embeddings = ["fastembed>=0.3.0"]
mcp = ["mcp>=1.2.0"]
homeassistant = ["aiohttp>=3.9.0"]
yc-bench = ["yc-bench @ git+https://github.com/collinear-ai/yc-bench.git"]
@@ -65,6 +66,7 @@ all = [
"hermes-agent[slack]",
"hermes-agent[pty]",
"hermes-agent[honcho]",
"hermes-agent[embeddings]",
"hermes-agent[mcp]",
"hermes-agent[homeassistant]",
]