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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

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

Uploaded CPython 3.9+Windows x86-64

ses_core-2.0.1-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.1-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.1-cp39-abi3-macosx_11_0_arm64.whl (303.8 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

ses_core-2.0.1-cp39-abi3-macosx_10_12_x86_64.whl (308.7 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

  • Download URL: ses_core-2.0.1-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.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 815450589f4bd4d1b9ddb307e16f4af16269d6d02420c4419962c1e15581e0e4
MD5 00e7bb72d38b8cfbe0b85148f989c500
BLAKE2b-256 b26c093b961f315e3af19437e77023398dac9f6fee0841d41b53add6f515a525

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.1-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.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for ses_core-2.0.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 162a60b9c03a41bd7b250f8e269a2e694e05571658a085d01ea8165162ae8778
MD5 defa559c6224feeaea2a6597deedd4e0
BLAKE2b-256 be4154d4d39cf89a8ecf65ffc55bb9fc15e3929493d6899e109a18491681744d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.1-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.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for ses_core-2.0.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f91cba9b5f714b2dcc0358c4eb7b0d3b98d2cdd69a53c25cbd6ba91e221f7748
MD5 1c0c9a82b2ae67f980732859337427aa
BLAKE2b-256 6cf38dcd2b7dbb681af5c37e382778237bf88113c6d5c0b2a5817d78c228819d

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.1-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.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ses_core-2.0.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 860e5937c35254c661d0c758d7b79524da445739c75f13fa990e4a2c5a9eace7
MD5 cf3344b6e44c86861781812f16133a94
BLAKE2b-256 303f72e7fb1ec1fca67150eca23b9f988e498a5dc3b671c2390303b12ba5269e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.1-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.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for ses_core-2.0.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 53931a17d7179b1ab24179d65243a8dca87a94665b39ce80527636a0fc4dc84b
MD5 5410bee57617856aeb4724d020bff52b
BLAKE2b-256 05e02bd98f33fb5961a887028d8f81c1928e5392305361695af07628e7db20fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ses_core-2.0.1-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

2.0.3

6 files

2.0.2

6 files

This release

2.0.1 This release

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