5f4f1f7508
Añade campos params y output al frontmatter YAML de las 506 funciones del registry. Cada parámetro tiene descripción semántica (qué representa, unidades, rango típico) y cada función describe qué produce su output. Permite a agentes razonar sobre cadenas de composición (ej: prices → log_return → sharpe_ratio) sin leer código.
1.7 KiB
1.7 KiB
name, kind, lang, domain, version, purity, signature, description, tags, uses_functions, uses_types, returns, returns_optional, error_type, imports, params, output, tested, tests, test_file_path, file_path
| name | kind | lang | domain | version | purity | signature | description | tags | uses_functions | uses_types | returns | returns_optional | error_type | imports | params | output | tested | tests | test_file_path | file_path | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| embedding_store_sqlvec | function | py | infra | 1.0.0 | impure | def embedding_store_sqlvec(db_path: str, table: str, ids: list, embeddings: list, dim: int = 384) -> int | Inserta embeddings en tabla sqlite-vec. Crea la tabla virtual si no existe. Insercion en batches. |
|
false | error_go_core |
|
|
int: cantidad de vectores insertados | false | python/functions/embedding/sqlvec.py |
Ejemplo
model = embedding_load_model(".local/models/e5-small")
docs = ["La IA transforma la industria", "Python es versatil"]
embs = embedding_encode(model, docs, mode="document")
n = embedding_store_sqlvec("vectors.db", "doc_embeddings", [0, 1], embs)
# n = 2
Notas
Usa sqlite-vec (extension pura C para SQLite). Los vectores se almacenan como blobs float32. Compatible con cualquier SQLite — se puede usar el mismo archivo para metadata con tablas normales. Insercion en batches de 500 para evitar limits de SQLite. Para 50k vectores dim=384: ~75 MB en disco, busqueda ~19ms/query.