|
Modern Retrieval-Augmented Generation (RAG) systems have moved far beyond the simple Tensor Machine is an experimental high-performance RAG engine written in Rust and designed as a vector-relational execution system: a declarative DSL, an intermediate representation, bytecode compilation, and an isolatable Tensor VM. The project is not positioned as a replacement for every existing RAG framework. Instead, it focuses on scenarios where retrieval must be programmable, measurable, and ready for agentic operation through MCP. The architecture separates planning from execution, uses Apache Arrow and FlatBuffer for compact data representation, and supports several execution paths: CPU/SIMD, WebGPU, and optional VM isolation through IPC.
To integrate the MCP bridge with LM Studio, configure the {
"mcpServers": {
"tensor-rag": {
"command": "node",
"args": ["/path/to/APL-RAG/mcp-bridge.js"]
}
}
}This configuration tells LM Studio to launch the bridge via Node.js, allowing the editor to forward MCP requests to the Tensor Machine backend. |
|
Tensor Machine is organized as three connected layers: transport and control, declarative planning, and tensor execution. In local mode, these layers can run inside a single Rust process, reducing network overhead. For stricter isolation, the VM can be moved into a separate worker process through IPC.
|
|
Retrieval strategies do not have to be hardcoded into production code. They can be described through the DSL, compiled into bytecode, and executed by the VM: Supported retrieval patterns:
Tensor Machine supports several independent relevance signals that can be combined through RSF, RRF, or weighted fusion depending on the selected strategy.
|
|
Arrow Flight over gRPC is used as a data plane for moving MCP requests are routed through Axum. For agent sessions, sticky routing by
|
|
# 1. Start infrastructure
docker compose up -d
# 2. Build the project
cargo build --release -p tensor-rag
# 3. Run the server
cargo run --release -p tensor-ragThe server starts on curl -X POST http://localhost:8080/mcp \
-H "Content-Type: application/json" \
-d '{
"tool": "search",
"args": {
"dsl": "(search :query \"quantum physics\" :final-top-k 5)"
},
"session_id": "session_1",
"sequence_number": 1
}'# Windows
.\run.ps1
# Linux
./run.shcargo test -p tensor-ragcargo bench --bench colbert # ColBERT CPU vs GPU
cargo bench --bench stress # High-concurrency throughput
cargo bench --bench zero_copy # Arrow vs Tensor1D
The full configuration list is available in ; Simple search
(search :query "quantum physics" :final-top-k 5)
; Hybrid search with filters
(search :query "machine learning"
:filters (>= year 2023)
:rerank (hybrid :weights (sem 0.7 bm25 0.3))
:final-top-k 5)
; Multi-hop retrieval
(multi-hop :query "quantum error correction"
:hops 3
:rerank (hybrid :weights (sem 0.6 bm25 0.4))
:final-top-k 5)
; Self-RAG with confidence branching
(self-rag :query "latest AI research"
:threshold 0.8
:low-confidence (search :query "AI research survey" :final-top-k 10)
:high-confidence (search :query "latest AI research" :final-top-k 5)
:final-top-k 5)
; Corrective RAG with fallback
(corrective-rag :query "specific technical detail"
:fallback-query "technical overview"
:rerank (rrf)
:final-top-k 5)
; ColBERT late-interaction rerank
(colbert-retrieval :query "semantic search architecture"
:candidate-top-k 100
:final-top-k 10) |
|
GPLv3 — see LICENSE for details. |