MCPcopy Index your code
hub / github.com/RTradeLtd/Lens

github.com/RTradeLtd/Lens @v2.2.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.2.0 ↗ · + Follow
272 symbols 583 edges 34 files 59 documented · 22%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🔍 Lens

一个分布式互联网中的搜索引擎

Lens既是服务于分布式互联网的搜索引擎,又是一个数据收集工具。它公开了一个简单小巧的API接口用于智能地查找IPFS上的内容。

GoDoc Build Status codecov Go Report Card Latest Release

多语言

jaywcjlove/sb

特性与用例

Lens最初是与Temporal配合使用的,用户可以在使用Temporal时选择是否将他们上传的数据被Lens索引,并在贡献数据的同时获得RTC奖励。然后,用户可以使用一个简单易用的API来搜索数据内容。

Temporal web中使用Lens进行搜索将会非常有益,并且可以获得RTC通证奖励。当然,我们也赋予了Lens独立部署和使用的服务,用户可以单独使用Lens进行内容录入和搜索服务,但这种方式并不能获取RTC通证奖励。

API编程接口

Lens基于gRPC暴露了一个简单的API接口。 定义如下: RTradeLtd/grpc.

Lens API的核心RPCs如下:

service LensV2 {
  rpc Index(IndexReq)   returns (IndexResp)  {}
  rpc Search(SearchReq) returns (SearchResp) {}
  rpc Remove(RemoveReq) returns (RemoveResp) {}
}

可以在RTradeLtd/grpc中找到。

编码支持

只支持IPFSCIDs 作为搜索输入值, 并且搜索结果仅支持图片,文本,和pdf文件。我们正尝试通过数据类型智能嗅探技术来解析更多内容类型。

下面表格中是我们所支持检索的文件格式:

Mime Type Support Level Tested Types
text/* Beta text/plain, text/html
image/* Beta image/jpeg
application/pdf Beta application/pdf

部署

基于Docker命令行的部署方式如下 rtradetech/lens

$> docker pull rtradetech/lens:latest

Adocker-compose configuration 配置信息如下:

$> wget -O lens.yml https://raw.githubusercontent.com/RTradeLtd/Lens/master/lens.yml
$> LENS=latest BASE=/my/dir docker-compose -f lens.yml up

参与开发

这个项目依赖于:

使用 go get 获取代码库:

$> go get github.com/RTradeLtd/Lens

通过我们所提供的 make dep可以一键安装所需依赖。

Extension points exported contracts — how you extend this code

TensorflowAnalyzer (Interface)
TensorflowAnalyzer represents a wrapper around a Tensorflow-based analyzer go:generate go run github.com/maxbrunsfeld/co [3 …
analyzer/images/tensorflow.go
Searcher (Interface)
Searcher exposes Engine's primary functions go:generate go run github.com/maxbrunsfeld/counterfeiter/v6 -o ../mocks/engi [2 …
engine/engine.go

Core symbols most depended-on inside this repo

recordInvocation
called by 21
mocks/manager.mock.go
Close
called by 21
engine/engine.go
Run
called by 16
engine/engine.go
Index
called by 7
engine/engine.go
Search
called by 6
engine/engine.go
recordInvocation
called by 5
mocks/engine.mock.go
IsIndexed
called by 5
engine/engine.go
IsStopped
called by 5
engine/queue/queue.go

Shape

Method 199
Function 40
Struct 30
Interface 2
TypeAlias 1

Languages

Go100%

Modules by API surface

mocks/manager.mock.go128 symbols
mocks/engine.mock.go30 symbols
engine/engine.go17 symbols
analyzer/images/tensorflow.go13 symbols
engine/queue/queue.go10 symbols
mocks/images.mock.go9 symbols
v2.go8 symbols
analyzer/ocr/ocr.go7 symbols
v2_test.go6 symbols
engine/query.go5 symbols
v2_util.go4 symbols
source/planetary/extract.go4 symbols

For agents

$ claude mcp add Lens \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact