展示 HN:GibRAM,一个用于检索的内存中临时 GraphRAG 运行时。
Show HN: GibRAM an in-memory ephemeral GraphRAG runtime for retrieval

原始链接: https://github.com/gibram-io/gibram

## GibRAM:RAG 的内存知识图谱 GibRAM 是一款内存知识图谱服务器,旨在增强检索增强生成 (RAG) 工作流程。它将实体、关系和文档块*以及*它们的向量嵌入直接存储在 RAM 中,从而实现更快速、更具关联性的上下文检索。 与传统的向量数据库不同,GibRAM 允许“图感知检索”——通过遍历实体之间的关系来发现仅靠语义相似性难以发现的相关信息。数据是短暂的,具有可配置的生命周期,使其非常适合短期分析和探索。 一个 Python SDK 简化了文档索引和查询,提供了一种“GraphRAG”风格的工作流程。用户可以轻松自定义组件,例如分块器、提取器和嵌入器。GibRAM 可以通过脚本、Docker 或 Docker Compose 轻松部署,默认在 6161 端口上运行。它是一个 MIT 许可的项目。

## GibRAM:一个内存中的图RAG运行时 一个名为GibRAM的新开源项目旨在简化基于图的检索增强生成(GraphRAG),用于对监管文件进行短期的分析。其创建者发现传统的RAG流程难以连接文档中的相关信息,而现有的GraphRAG设置由于分离的图存储和向量索引而过于复杂。 GibRAM通过将*所有内容*——实体、关系、文本和嵌入——保存在单个进程的内存中来解决这个问题。它被设计为短暂的;数据不会被保存,而是依赖于在会话结束时快速重新计算。这使其非常适合探索性任务,如摘要和对话查询,优先考虑速度而非持久性。 开发者承认这是一个带有技术债务的“氛围编码”实验项目,而不是生产数据库。他们正在寻求来自从事RAG、搜索或图检索工作的人们的反馈,以改进以内存为主要约束的GraphRAG概念。 项目GitHub地址:[https://github.com/gibram-io/gibram](https://github.com/gibram-io/gibram)
相关文章

原文

Graph in-Buffer Retrieval & Associative Memory

  • Graph in-Buffer: Graph structure (entities + relationships) stored in RAM
  • Retrieval: Query mechanism for retrieving relevant context in RAG workflows
  • Associative Memory: Traverse between associated nodes via relationships, all accessed from memory

GibRAM is an in-memory knowledge graph server designed for retrieval augmented generation (RAG) workflows. It combines a lightweight graph store with vector search so that related pieces of information remain connected in memory. This makes it easier to retrieve related regulations, articles or other text when a query mentions specific subjects.

  • In memory and Ephemeral: Data lives in RAM with a configurable time to live. It is meant for short lived analysis and exploration rather than persistent storage.
  • Graph and Vectors Together: Stores named entities, relationships and document chunks alongside their embeddings in the same structure.
  • Graph aware Retrieval: Supports traversal over entities and relations as well as semantic search, helping you pull in context that would be missed by vector similarity alone.
  • Python SDK: Provides a GraphRAG style workflow for indexing documents and running queries with minimal code. Components such as chunker, extractor and embedder can be swapped out.
# Install via script
curl -fsSL https://gibram.io/install.sh | sh

# Run server
gibram-server --insecure

Server runs on port 6161 by default.

# Run server
docker run -p 6161:6161 gibramio/gibram:latest

# With custom config
docker-compose up -d

Basic Usage:

from gibram import GibRAMIndexer

# Initialize indexer
indexer = GibRAMIndexer(
    session_id="my-project",
    host="localhost",
    port=6161,
    llm_api_key="sk-..."  # or set OPENAI_API_KEY env
)

# Index documents
stats = indexer.index_documents([
    "Python is a programming language created by Guido van Rossum.",
    "JavaScript was created by Brendan Eich at Netscape in 1995."
])

print(f"Entities: {stats.entities_extracted}")
print(f"Relationships: {stats.relationships_extracted}")

# Query
results = indexer.query("Who created JavaScript?", top_k=3)
for entity in results.entities:
    print(f"{entity.title}: {entity.score}")

Custom Components:

from gibram import GibRAMIndexer
from gibram.chunkers import TokenChunker
from gibram.extractors import OpenAIExtractor
from gibram.embedders import OpenAIEmbedder

indexer = GibRAMIndexer(
    session_id="custom-project",
    chunker=TokenChunker(chunk_size=512, chunk_overlap=50),
    extractor=OpenAIExtractor(model="gpt-4o", api_key="..."),
    embedder=OpenAIEmbedder(model="text-embedding-3-small", api_key="...")
)

MIT

联系我们 contact @ memedata.com