SES Core: Semantic Engine
Motor RAG offline-first para documentos privados, con Gateway, Portal y aceleración Rust opcional.
Qué es SES
SES convierte documentos locales en un índice semántico consultable. El núcleo Python extrae, segmenta, genera embeddings y consulta Qdrant; Redis aporta caché y control distribuido; Ollama genera respuestas locales; el Gateway FastAPI expone los contratos HTTP y el Portal Next.js ofrece la superficie administrativa.
Offline-first significa que los documentos y consultas pueden permanecer en la infraestructura del operador. No significa cero dependencias de red durante la instalación: paquetes, imágenes y modelos deben aprovisionarse antes de operar sin conexión.
Estado verificado
Este repositorio está en beta técnica. El código y la validación ejecutable son la fuente de verdad.
| Superficie | Estado comprobado | Límite actual |
|---|---|---|
| Núcleo Python | Pytest valida núcleo, SQLite y fallos de red controlados | E2E exitoso con Qdrant/Redis/Ollama reales pendiente |
| Gateway | Auth, telemetría SQLite, CORS y rate limiting endurecidos | Validación PostgreSQL y paridad Docker completa pendientes |
| Portal | Next.js 16; lint, build y ocho rutas administrativas validadas | E2E contra servicios reales pendiente |
| Rust | Wheel CPython 3.12, pruebas, Clippy y API NumPy | Es opcional y se activa en lotes de más de 50 candidatos |
| CI | Portal, Python, Rust, wheel, Pytest y smoke sintético en GitHub Actions | No sustituye pruebas end-to-end |
| Publicación | Wheel y sdist Python se construyen y pasan Twine | PyPI Trusted Publisher aún debe configurarse |
| Mount Mode | Reindexado primero ingiere y conserva limpiezas pendientes en el manifiesto | No existe una transacción distribuida con Qdrant |
Arquitectura
Documentos de solo lectura
|
v
Watcher / Scanner ---> Parser y chunking ---> Embeddings locales
|
v
Portal Next.js ---> Gateway FastAPI ---> Qdrant / Redis / Ollama
|
+-- reportes PDF
+-- llaves y analítica
+-- reranking Rust opcional
Directorios principales:
ses/: librería RAG, proveedores, reportes y watcher.gateway/: API FastAPI, dashboard estático y SQLite local.portal/: cliente administrativo Next.js.core_rs/: extensión PyO3jas_vector_core.sdk/: SDKs oficiales para TypeScript (@ses-ai/client) y Go (ses-go).tests/: pruebas Python y microbenchmark sintético.
🚀 Despliegue Empresarial Llave en Mano (Docker 1-Click)
Para desplegar la plataforma completa de Semantic Engine (Gateway FastAPI + Portal Next.js + Qdrant + Redis + Ollama) en producción:
# 1. Generar configuración criptográfica de producción (.env.prod)
python scripts/deploy_production.py
# 2. Levantar el stack completo en segundo plano
docker compose -f docker-compose.prod.yml --env-file .env.prod up -d --build
Servicios disponibles:
- Portal Administrativo: http://127.0.0.1:3000
- Enterprise Gateway: http://127.0.0.1:8000 (Documentación OpenAPI en
/docs) - Base Vectorial Qdrant:
:6333(Red interna aislada) - Caché Redis:
:6379(Red interna aislada con autenticación obligatoria) - Servidor LLM Ollama:
:11434(Red interna aislada)
📦 SDKs Oficiales de Integración
TypeScript / JavaScript (@ses-ai/client)
Consulte la documentación completa en sdk/typescript/README.md.
import { SemanticEngineClient } from "@ses-ai/client";
const client = new SemanticEngineClient({
baseUrl: "http://localhost:8000",
apiKey: process.env.SES_API_KEY!,
});
const result = await client.search({
namespace: "legal",
query: "cláusula de rescisión",
generateAnswer: true,
});
console.log("Respuesta RAG:", result.answer);
Go (ses-go)
Consulte la documentación completa en sdk/go/README.md.
import ses "github.com/elbuilder77/Semantic-Engine/sdk/go"
client, _ := ses.NewClient(ses.ClientConfig{
BaseURL: "http://localhost:8000",
APIKey: "tu_llave_api",
})
resp, _ := client.Search(ctx, ses.SearchRequest{
Namespace: "legal",
Query: "cláusula de rescisión",
})
Instalación desde el código fuente
git clone https://github.com/elbuilder77/Semantic-Engine.git
cd Semantic-Engine
py -3.12 -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install --upgrade pip
python -m pip install -e ".[dev,server]"
Extensión Rust opcional
python -m pip install "maturin>=1,<2"
python -m maturin build --release --manifest-path core_rs/Cargo.toml --interpreter python --out core_rs/target/wheels
$wheel = Get-ChildItem core_rs/target/wheels/*.whl | Select-Object -First 1
python -m pip install --force-reinstall $wheel.FullName
Servicios locales de desarrollo
El Compose canónico levanta dependencias satélite para desarrollo:
Copy-Item .env.compose.example .env.compose
# Edite QDRANT_API_KEY y REDIS_PASSWORD en .env.compose
docker compose --env-file .env.compose up -d
docker compose --env-file .env.compose ps
Gateway:
python gateway/run.py
Portal:
npm ci --prefix portal
npm --prefix portal run dev -- --hostname 127.0.0.1 --port 3000
Mount Mode
El watcher trata las carpetas observadas como fuentes de solo lectura. Realiza
un escaneo inicial, filtra PDF/DOCX/XLSX/CSV/TXT/MD, calcula SHA-256, guarda
source_path y evita reinserciones cuando el contenido no cambió.
Los eventos se agrupan mediante debounce.
Consulte docs/MOUNT_MODE.md.
Validación
Gates locales equivalentes a CI:
pytest -q -p no:cacheprovider
npm --prefix portal run lint
npm --prefix portal run test
npm --prefix portal run build
cargo fmt --manifest-path core_rs/Cargo.toml -- --check
cargo test --manifest-path core_rs/Cargo.toml
cargo clippy --manifest-path core_rs/Cargo.toml --all-targets -- -D warnings
Licencia
SES Core se distribuye bajo GPLv3.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ses_core-2.0.2.tar.gz.
File metadata
- Download URL: ses_core-2.0.2.tar.gz
- Upload date:
- Size: 63.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a04863f0ba6cafcc008898102032e1dae61ee7c192276d3b9918d02ac18e95ae
|
|
| MD5 |
8dcd4494c7badcc245fc54a43d9e49a4
|
|
| BLAKE2b-256 |
1eec07cc885e88cc9da1bf61470f22134a5955ee9b68a487fe6a0fbbd61102ba
|
Provenance
The following attestation bundles were made for ses_core-2.0.2.tar.gz:
Publisher:
publish.yml on elbuilder77/Semantic-Engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ses_core-2.0.2.tar.gz -
Subject digest:
a04863f0ba6cafcc008898102032e1dae61ee7c192276d3b9918d02ac18e95ae - Sigstore transparency entry: 2705039517
- Sigstore integration time:
-
Permalink:
elbuilder77/Semantic-Engine@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Branch / Tag:
refs/tags/v2.0.2 - Owner: https://github.com/elbuilder77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Trigger Event:
release
-
Statement type:
File details
Details for the file ses_core-2.0.2-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: ses_core-2.0.2-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 198.8 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bce531fd41f67e734c4144d689b5fbcd8eedaaf420018cb2fca704cbb448d67d
|
|
| MD5 |
c81d142cdc7a9724957f7e96f17084fc
|
|
| BLAKE2b-256 |
7d27619f71440ae88b5d8ec18db6c09a928a074ed480a4681da8a796d492875d
|
Provenance
The following attestation bundles were made for ses_core-2.0.2-cp39-abi3-win_amd64.whl:
Publisher:
publish.yml on elbuilder77/Semantic-Engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ses_core-2.0.2-cp39-abi3-win_amd64.whl -
Subject digest:
bce531fd41f67e734c4144d689b5fbcd8eedaaf420018cb2fca704cbb448d67d - Sigstore transparency entry: 2705039569
- Sigstore integration time:
-
Permalink:
elbuilder77/Semantic-Engine@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Branch / Tag:
refs/tags/v2.0.2 - Owner: https://github.com/elbuilder77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Trigger Event:
release
-
Statement type:
File details
Details for the file ses_core-2.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: ses_core-2.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 346.3 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa1615e317aafc20b604a69403930bb952f6cc217300fc41a6539516ad4713e9
|
|
| MD5 |
e0111dd917ead0ee859589e0673c4670
|
|
| BLAKE2b-256 |
cc2bf401233d56b81738db08fa09b00b3de25a142e358fdbed11045770eca506
|
Provenance
The following attestation bundles were made for ses_core-2.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish.yml on elbuilder77/Semantic-Engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ses_core-2.0.2-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
aa1615e317aafc20b604a69403930bb952f6cc217300fc41a6539516ad4713e9 - Sigstore transparency entry: 2705039613
- Sigstore integration time:
-
Permalink:
elbuilder77/Semantic-Engine@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Branch / Tag:
refs/tags/v2.0.2 - Owner: https://github.com/elbuilder77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Trigger Event:
release
-
Statement type:
File details
Details for the file ses_core-2.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: ses_core-2.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 332.5 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c186201be9692e5c204b97cecf9adf97eea5a5a9017b44ba6fe84d72c653f5da
|
|
| MD5 |
de58b8d48cf9e76b8bb25b71ef2489fc
|
|
| BLAKE2b-256 |
848644391e61380769e7a0c6e4628e1a17be11645460132dd766b4e97d846ebb
|
Provenance
The following attestation bundles were made for ses_core-2.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish.yml on elbuilder77/Semantic-Engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ses_core-2.0.2-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
c186201be9692e5c204b97cecf9adf97eea5a5a9017b44ba6fe84d72c653f5da - Sigstore transparency entry: 2705039692
- Sigstore integration time:
-
Permalink:
elbuilder77/Semantic-Engine@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Branch / Tag:
refs/tags/v2.0.2 - Owner: https://github.com/elbuilder77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Trigger Event:
release
-
Statement type:
File details
Details for the file ses_core-2.0.2-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: ses_core-2.0.2-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 303.8 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
714d0384c4701524784967211c6a693bb3046c14c35b95b3a4e9b10e1860df80
|
|
| MD5 |
16079609d7f0ece96112155c5a769005
|
|
| BLAKE2b-256 |
42e5b4d2e061909ab5bde668330ae605f2089bf6c53cabe9f29e624f1d1c2eeb
|
Provenance
The following attestation bundles were made for ses_core-2.0.2-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
publish.yml on elbuilder77/Semantic-Engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ses_core-2.0.2-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
714d0384c4701524784967211c6a693bb3046c14c35b95b3a4e9b10e1860df80 - Sigstore transparency entry: 2705039726
- Sigstore integration time:
-
Permalink:
elbuilder77/Semantic-Engine@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Branch / Tag:
refs/tags/v2.0.2 - Owner: https://github.com/elbuilder77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Trigger Event:
release
-
Statement type:
File details
Details for the file ses_core-2.0.2-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: ses_core-2.0.2-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 308.7 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd4982080d28be44bbd4f381d0c8189940af63bc73a9ecc7b4f8685c7ba70bff
|
|
| MD5 |
144566773886bc6c52a11b8a648c2d1e
|
|
| BLAKE2b-256 |
09b61ebfcb207379fc5fb970392c73cc4eedfdccc1aa2f2c82c67d330ecafeae
|
Provenance
The following attestation bundles were made for ses_core-2.0.2-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish.yml on elbuilder77/Semantic-Engine
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ses_core-2.0.2-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
fd4982080d28be44bbd4f381d0c8189940af63bc73a9ecc7b4f8685c7ba70bff - Sigstore transparency entry: 2705039655
- Sigstore integration time:
-
Permalink:
elbuilder77/Semantic-Engine@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Branch / Tag:
refs/tags/v2.0.2 - Owner: https://github.com/elbuilder77
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@507b2e7cef35b5d5bcde0c94a422442602a0f18a -
Trigger Event:
release
-
Statement type: