Sign inSign up

khapu2906/linkingmem

By khapu2906

•Updated 3 months ago

A high-performancegraph-based RAG

Image
Machine learning & AI
Data science
Databases & storage
0

1.2K

khapu2906/linkingmem repository overview

LinkingMem

⁠LinkingMem — Graph-native RAG Engine

High-performance Rust + Python engine for graph-based RAG, combining vector search, graph traversal, and LLM reasoning in a single system.

Query → Embedding → HNSW → Graph (BFS) → Ranking → LLM

⁠🚀 Quick Start

Engine + text plugin in one container, communicating over a Unix socket. Bundles text embedding/extraction/generation only — no image/CLIP support (use the multi-container HTTP setup below for that).

docker run -p 8000:8000 \
  -v $(pwd)/data:/data \
  --env-file .env \
  khapu2906/linkingmem:latest
⁠Engine only

Bring your own embedding / extraction / generation service (any language, HTTP or Unix socket — see Plugin Interface⁠):

docker run -p 8000:8000 \
  -v $(pwd)/data:/data \
  --env-file .env \
  khapu2906/linkingmem:latest-engine

For text and image queries (visual similarity search, /query/image), run the engine + text plugin + image plugin as three containers via docker compose instead of a single image — see docker-compose.yml⁠ in the source repo.


⁠🐳 Available Images

TagDescription
latestAlias for the newest vX.Y.Z-full release
latest-engineAlias for the newest vX.Y.Z-engine release
v0.3.0-fullRust engine + Python text plugin (all-in-one, Unix socket)
v0.3.0-engineRust engine only (bring your own plugin)

⁠⚙️ Required Environment

Minimum:

OPENAI_API_KEY=your_api_key

Works with any OpenAI-compatible endpoint — OpenAI, Ollama, Gemini (compat mode), Groq, LM Studio, vLLM, etc. — by also setting OPENAI_BASE_URL (defaults to https://api.openai.com/v1).

See full config: 👉 https://github.com/khapu2906/LinkingMem/blob/main/.env.example⁠


⁠✨ Features

  • ⚡ HNSW vector search (mmap, zero-copy)
  • 🧠 Graph traversal (CSR + BFS)
  • 🖼️ Multimodal — text and image nodes share one vector space (caption or CLIP embedding, separate image plugin)
  • 🔗 Multi-hop reasoning
  • 🧩 Plugin system (HTTP / Unix socket, any language)
  • 🧬 Entity resolution (embedding-based)
  • 🚀 Query cache + Prometheus metrics
  • 🔄 LSM-style delta store + WAL (crash recovery)

⁠📡 API Example

curl -X POST http://localhost:8000/query/text \
  -H "Content-Type: application/json" \
  -d '{"query": "Who works at Acme Corp?"}'

Full API reference: 👉 https://github.com/khapu2906/LinkingMem/blob/main/docs/API_REFERENCE.md⁠


⁠🧠 Architecture

  • Rust core → vector search, graph, query engine
  • Python plugins → embeddings, extraction, LLM calls
  • LLM backend → single OpenAI-compatible client — point OPENAI_BASE_URL at any compatible provider, no vendor lock-in

⁠📦 Source Code

👉 https://github.com/khapu2906/LinkingMem⁠


⁠⚡ Performance

The Rust core itself contributes well under 1ms to query latency — graph traversal and vector search are both sub-millisecond even at 100k+ nodes (see full benchmarks⁠).

End-to-end query latency is dominated by your LLM provider's response time, not the engine — typically 350–900ms with a fast, nearby LLM endpoint, but this varies significantly (multi-second) with slower or more distant providers. Run /query/vector or /query/node (no LLM call) to measure pure retrieval latency in your environment.


⁠🛠️ Use Cases

  • Knowledge graph RAG
  • Multi-hop QA systems
  • Memory systems for AI agents
  • Semantic + relational search
  • Cross-modal (text + image) search

Tag summary

Content type

Image

Digest

sha256:476c10b20…

Size

272.8 MB

Last updated

3 months ago

docker pull khapu2906/linkingmem