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.

Metadata

Release files for ses-core 2.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ses-core 2.0.3
File Size Uploaded Provenance
ses_core-2.0.3.tar.gz 63.1 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for ses-core 2.0.3
File
ses_core-2.0.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
ses_core-2.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details
ses_core-2.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details
ses_core-2.0.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details
ses_core-2.0.3-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details

Total release size: 1.6 MB

Release files / ses_core-2.0.3.tar.gz

Download URL ses_core-2.0.3.tar.gz
Size 63.1 kB
Tags Source
SHA-256 checksum
How to use checksums
2bd7d8293a32d8103c8e2e80bc3572c69676a5cb43fa24a5a632debff63530e6
BLAKE2b-256 checksum
How to use checksums
167137d9fbbefcda14d6da0a16ec4d7d4c05ca86eb11f4c7fcbd3127b3813bf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / ses_core-2.0.3-cp39-abi3-win_amd64.whl

Download URL ses_core-2.0.3-cp39-abi3-win_amd64.whl
Size 198.8 kB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3b799e9c2f7591007ecc75cc8e8980a467b06499ab9dfdb7e7799ace26e0ce52
BLAKE2b-256 checksum
How to use checksums
3eb9386f1a632704f0dddad973bcd683a775794afa28d0957d041b3fc8e7115b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / ses_core-2.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL ses_core-2.0.3-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 346.3 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
e644efa8b85d653f0a265c93e5e2cc5d1a90a9f3b5376eb2ca00153d9ecb83bd
BLAKE2b-256 checksum
How to use checksums
b97a15113e561b0a32f1e943000b8222bf00cfeb38efc66d176f04a56e3d5d24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / ses_core-2.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL ses_core-2.0.3-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 332.5 kB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
d2d97e48ef26fd1ff89f56004fa4f53bb22cc054e881da4106c87cf85fe6bd74
BLAKE2b-256 checksum
How to use checksums
ec104d12de0527485ccabad15077cab34f594291a3c46678d6d807ebbfd50872
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / ses_core-2.0.3-cp39-abi3-macosx_11_0_arm64.whl

Download URL ses_core-2.0.3-cp39-abi3-macosx_11_0_arm64.whl
Size 303.8 kB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f22bbfe0c37ad6a77e5e4de606af86ccbd189e753e3210177909d4f99a4c9af5
BLAKE2b-256 checksum
How to use checksums
526f4e4f59198740403b84c3e5edd9ab4f0ac134c39ec0226f58e0574275c765
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Release files / ses_core-2.0.3-cp39-abi3-macosx_10_12_x86_64.whl

Download URL ses_core-2.0.3-cp39-abi3-macosx_10_12_x86_64.whl
Size 308.6 kB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0bfabd8484966a5c2cd4d53cd94ecbaf369a7f8a4ab584171f7ef1634063fa50
BLAKE2b-256 checksum
How to use checksums
e226bfce7afa30f2ff505a291d2393d81756b57bd27762b3a00c96f67e3a4819
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

Security for ses-core 2.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for ses_core-2.0.3.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 4, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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