bloque-ai-rag
RAG pipeline: ChromaDB vector search + LLM gateway multi-provider (DeepSeek, OpenAI, Ollama).
Instalacion
uv add bloque-ai-rag
Uso rapido
from bloque_ai_rag.pipeline import RAGPipeline
# Crear pipeline con ChromaDB + DeepSeek
rag = RAGPipeline(
collection="knowledge_base",
llm_provider="deepseek",
)
async with rag:
# Ingestar documentos
await rag.ingest([
"FastAPI es un framework web moderno para Python.",
"ChromaDB es una base de datos vectorial open source.",
])
# Consultar
response = await rag.respond("Que es FastAPI?")
print(response.answer)
print(response.contexts) # documentos relevantes
Providers soportados
| Provider | API Base | Modelo default |
|---|---|---|
deepseek |
https://api.deepseek.com |
deepseek-chat |
openai |
https://api.openai.com |
gpt-4o-mini |
ollama |
http://localhost:11434 |
llama3.2 |
Componentes
- ChromaClient - Cliente HTTP para ChromaDB REST API (sin deps pesadas)
- OpenAICompatibleClient - Cliente para DeepSeek, OpenAI, y cualquier API compatible
- OllamaClient - Cliente para Ollama local
- RAGPipeline - Orquestador: query -> vector search -> context building -> LLM generation
Multitenant
Con ulfblk-multitenant instalado, las colecciones se prefijan automaticamente con el tenant_id:
rag = RAGPipeline(collection="knowledge_base", llm_provider="deepseek")
# Con tenant "acme" activo -> coleccion "acme__knowledge_base"
Dependencias
ulfblk-core(logging, health checks)httpx>=0.27(HTTP client async)
No requiere el paquete chromadb (~200MB). Usa ChromaDB REST API directamente.
Metadata
Release files for ulfblk-ai-rag 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ulfblk_ai_rag-0.1.0.tar.gz | 11.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ulfblk_ai_rag-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 26.4 kB
Release files / ulfblk_ai_rag-0.1.0.tar.gz
| Download URL | ulfblk_ai_rag-0.1.0.tar.gz |
|---|---|
| Size | 11.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4c46e351ae10357e16ddee05c1855ab21167209896167b6b4c62ee22b4882c7b
|
|
BLAKE2b-256 checksum How to use checksums |
7e1656c1db5036499a6dd135c5e25fa5b894d4abe2cdef83c18ac2479339e4c3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / ulfblk_ai_rag-0.1.0-py3-none-any.whl
| Download URL | ulfblk_ai_rag-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92347ab7329aca3947a15060f6b73fb36b00dfe2e11e8c77db412020bfa044a0
|
|
BLAKE2b-256 checksum How to use checksums |
d21a493ffd0a2c3325ce27e76006f1af6a8027f01d75cfdc6f013e529db5a660
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|