EinoRag is a Retrieval-Augmented Generation (RAG) API SDK built on top of ByteDance's Eino framework. It helps developers easily integrate vector retrieval and generative AI capabilities. The project is written in Go 1.22+, supports Google Gemini Embedding, and features flexible configuration and easy extensibility.
/Eino-rag # Core RAG functionality (vector upload, retrieval, etc.)
/internal
├─ config # Configuration loading and management (viper, yaml parsing, etc.)
├─ embadding # Embedding/vectorization logic
└─ rag # RAG business logic implementation
/pkg
├─ wokerpool # General-purpose goroutine pool
└─ logger # Logging component
main.go # Example entry point demonstrating upload and retrieval
README.md # Project documentation
-
Clone the project and enter the directory
git clone https://github.com/leebrouse/EinoRag.git cd EinoRag -
Prepare the environment
- Install Go 1.22 or above
- Set your Gemini API Key
export GOOGLE_API_KEY="<your_API_KEY>"
- Edit
internal/config/global.yamlto configure the embedding modelgemini: embedder: gemini-embedding-001
-
Run the example
go run main.go
The example in main.go uploads a PDF document and performs content retrieval via the vector database.
-
Run integration tests
go test ./test -run TestGeminiEmbedder_Real -v
- Supports PDF document vectorization and retrieval
- Encapsulates Gemini Embedding API
- Flexible configuration management (environment variables and YAML)
- Built-in goroutine pool and logging modules for easy extension
The diagram above illustrates the core architecture of EinoRag, including data upload, vectorization, storage, and retrieval processes, helping developers quickly understand the overall implementation.
- Configuration priority: If viper fails to read environment variables, explicitly configure in global.yaml
- Authentication failure: Ensure GOOGLE_API_KEY is correctly exported and has the required permissions
For detailed API or development documentation, please refer to the source code and comments in each subdirectory.
