Skip to main content

SES Core: Semantic Engine

Motor RAG offline-first para documentos privados, con Gateway, Portal y aceleración Rust opcional.

Python Estado CI Licencia

English version


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 PyO3 jas_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

ses_core-2.0.3.tar.gz (63.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ses_core-2.0.3-cp39-abi3-win_amd64.whl (198.8 kB view details)

Uploaded CPython 3.9+Windows x86-64

ses_core-2.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.3 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

ses_core-2.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (332.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

ses_core-2.0.3-cp39-abi3-macosx_11_0_arm64.whl (303.8 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

ses_core-2.0.3-cp39-abi3-macosx_10_12_x86_64.whl (308.6 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file ses_core-2.0.3.tar.gz.

File metadata

  • Download URL: ses_core-2.0.3.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

Hashes for ses_core-2.0.3.tar.gz
Algorithm Hash digest
SHA256 2bd7d8293a32d8103c8e2e80bc3572c69676a5cb43fa24a5a632debff63530e6
MD5 aa48345df2afb536c7d48899fc25911a
BLAKE2b-256 167137d9fbbefcda14d6da0a16ec4d7d4c05ca86eb11f4c7fcbd3127b3813bf2

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.3.tar.gz:

Publisher: publish.yml on elbuilder77/Semantic-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ses_core-2.0.3-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: ses_core-2.0.3-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

Hashes for ses_core-2.0.3-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 3b799e9c2f7591007ecc75cc8e8980a467b06499ab9dfdb7e7799ace26e0ce52
MD5 d02246fa2fa3fd3739b3e932fe303e49
BLAKE2b-256 3eb9386f1a632704f0dddad973bcd683a775794afa28d0957d041b3fc8e7115b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.3-cp39-abi3-win_amd64.whl:

Publisher: publish.yml on elbuilder77/Semantic-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ses_core-2.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ses_core-2.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e644efa8b85d653f0a265c93e5e2cc5d1a90a9f3b5376eb2ca00153d9ecb83bd
MD5 62fa65429ea569184896f8a03d5d9038
BLAKE2b-256 b97a15113e561b0a32f1e943000b8222bf00cfeb38efc66d176f04a56e3d5d24

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on elbuilder77/Semantic-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ses_core-2.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ses_core-2.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d2d97e48ef26fd1ff89f56004fa4f53bb22cc054e881da4106c87cf85fe6bd74
MD5 8040d167ceaae53a64590c622737c49f
BLAKE2b-256 ec104d12de0527485ccabad15077cab34f594291a3c46678d6d807ebbfd50872

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on elbuilder77/Semantic-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ses_core-2.0.3-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ses_core-2.0.3-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f22bbfe0c37ad6a77e5e4de606af86ccbd189e753e3210177909d4f99a4c9af5
MD5 54812bca9af1b9ccc687bdca9f9a4024
BLAKE2b-256 526f4e4f59198740403b84c3e5edd9ab4f0ac134c39ec0226f58e0574275c765

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.3-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: publish.yml on elbuilder77/Semantic-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ses_core-2.0.3-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ses_core-2.0.3-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 0bfabd8484966a5c2cd4d53cd94ecbaf369a7f8a4ab584171f7ef1634063fa50
MD5 8edcf4f7de62f9356b968a88bfedee12
BLAKE2b-256 e226bfce7afa30f2ff505a291d2393d81756b57bd27762b3a00c96f67e3a4819

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.3-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: publish.yml on elbuilder77/Semantic-Engine

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.0.3 This release

6 files

2.0.2

6 files

2.0.1

5 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page