Skip to content

Commit 8f7c5e0

Browse files
committed
Finish the renaming of miinirag to lilrag
1 parent 574e14d commit 8f7c5e0

23 files changed

Lines changed: 165 additions & 165 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Thumbs.db
5050
*.db-wal
5151
*.db-shm
5252
data/
53-
.minirag/
53+
.lilrag/
5454

5555
# Test files
5656
test_document.txt

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# Contributing to Mini-RAG
1+
# Contributing to Lil-RAG
22

3-
Thank you for your interest in contributing to Mini-RAG! This document provides guidelines and information for contributors.
3+
Thank you for your interest in contributing to Lil-RAG! This document provides guidelines and information for contributors.
44

55
## 🤝 How to Contribute
66

@@ -101,7 +101,7 @@ lil-rag/
101101
│ ├── lil-rag/ # CLI application
102102
│ └── lil-rag-server/ # HTTP server
103103
├── pkg/ # Public library code
104-
│ ├── minirag/ # Core RAG functionality
104+
│ ├── lilrag/ # Core RAG functionality
105105
│ └── config/ # Configuration management
106106
├── internal/ # Private application code
107107
│ └── handlers/ # HTTP handlers

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ Example profile configuration (`~/.lilrag/config.json`):
314314
"embedding_model": "nomic-embed-text",
315315
"vector_size": 768
316316
},
317-
"storage_path": "/home/user/.lilrag/data/minirag.db",
317+
"storage_path": "/home/user/.lilrag/data/lilrag.db",
318318
"data_dir": "/home/user/.lilrag/data",
319319
"server": {
320320
"host": "localhost",
@@ -354,15 +354,15 @@ import (
354354
"os"
355355
"path/filepath"
356356

357-
"lil-rag/pkg/minirag"
357+
"lil-rag/pkg/lilrag"
358358
)
359359

360360
func main() {
361361
// Create configuration
362362
homeDir, _ := os.UserHomeDir()
363363
dataDir := filepath.Join(homeDir, ".lilrag", "data")
364364

365-
config := &minirag.Config{
365+
config := &lilrag.Config{
366366
DatabasePath: filepath.Join(dataDir, "test.db"),
367367
DataDir: dataDir,
368368
OllamaURL: "http://localhost:11434",
@@ -371,7 +371,7 @@ func main() {
371371
}
372372

373373
// Initialize LilRag
374-
rag, err := minirag.New(config)
374+
rag, err := lilrag.New(config)
375375
if err != nil {
376376
log.Fatal(err)
377377
}
@@ -461,13 +461,13 @@ lil-rag/
461461
│ ├── lil-rag/ # CLI application
462462
│ └── lil-rag-server/ # HTTP API server
463463
├── pkg/ # Public library packages
464-
│ ├── minirag/ # Core RAG functionality
464+
│ ├── lilrag/ # Core RAG functionality
465465
│ │ ├── storage.go # SQLite + sqlite-vec storage
466466
│ │ ├── embedder.go # Ollama integration
467467
│ │ ├── chunker.go # Text chunking logic
468468
│ │ ├── compression.go # Gzip compression
469469
│ │ ├── pdf.go # PDF parsing
470-
│ │ └── minirag.go # Main library interface
470+
│ │ └── lilrag.go # Main library interface
471471
│ └── config/ # Configuration management
472472
├── internal/ # Private application code
473473
│ └── handlers/ # HTTP request handlers

cmd/lil-rag-server/main.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
"lil-rag/internal/handlers"
1515
"lil-rag/pkg/config"
16-
"lil-rag/pkg/minirag"
16+
"lil-rag/pkg/lilrag"
1717
)
1818

1919
// version is set during build time via ldflags
@@ -71,7 +71,7 @@ func run() error {
7171
profileConfig.Server.Port = *port
7272
}
7373

74-
miniragConfig := &minirag.Config{
74+
lilragConfig := &lilrag.Config{
7575
DatabasePath: profileConfig.StoragePath,
7676
DataDir: profileConfig.DataDir,
7777
OllamaURL: profileConfig.Ollama.Endpoint,
@@ -81,7 +81,7 @@ func run() error {
8181
Overlap: profileConfig.Chunking.Overlap,
8282
}
8383

84-
rag, err := minirag.New(miniragConfig)
84+
rag, err := lilrag.New(lilragConfig)
8585
if err != nil {
8686
return fmt.Errorf("failed to create MiniRag: %w", err)
8787
}

cmd/lil-rag/main.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"time"
1313

1414
"lil-rag/pkg/config"
15-
"lil-rag/pkg/minirag"
15+
"lil-rag/pkg/lilrag"
1616
)
1717

1818
// version is set during build time via ldflags
@@ -77,7 +77,7 @@ func run() error {
7777
profileConfig.Ollama.VectorSize = *vectorSize
7878
}
7979

80-
miniragConfig := &minirag.Config{
80+
lilragConfig := &lilrag.Config{
8181
DatabasePath: profileConfig.StoragePath,
8282
DataDir: profileConfig.DataDir,
8383
OllamaURL: profileConfig.Ollama.Endpoint,
@@ -87,7 +87,7 @@ func run() error {
8787
Overlap: profileConfig.Chunking.Overlap,
8888
}
8989

90-
rag, err := minirag.New(miniragConfig)
90+
rag, err := lilrag.New(lilragConfig)
9191
if err != nil {
9292
return fmt.Errorf("failed to create MiniRag: %w", err)
9393
}
@@ -114,7 +114,7 @@ func run() error {
114114
}
115115
}
116116

117-
func handleIndex(ctx context.Context, rag *minirag.MiniRag, args []string) error {
117+
func handleIndex(ctx context.Context, rag *lilrag.LilRag, args []string) error {
118118
if len(args) == 0 {
119119
return fmt.Errorf("usage: lil-rag index <id> [text|file|-]")
120120
}
@@ -206,7 +206,7 @@ func handleIndex(ctx context.Context, rag *minirag.MiniRag, args []string) error
206206
return nil
207207
}
208208

209-
func handleSearch(ctx context.Context, rag *minirag.MiniRag, args []string) error {
209+
func handleSearch(ctx context.Context, rag *lilrag.LilRag, args []string) error {
210210
if len(args) == 0 {
211211
return fmt.Errorf("usage: lil-rag search <query> [limit]")
212212
}

examples/library/library_usage.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@ import (
66
"log"
77
"strings"
88

9-
"lil-rag/pkg/minirag"
9+
"lil-rag/pkg/lilrag"
1010
)
1111

1212
func main() {
1313
// You can either load from profile config or create manually
14-
config := &minirag.Config{
14+
config := &lilrag.Config{
1515
DatabasePath: "example.db",
1616
DataDir: "./data",
1717
OllamaURL: "http://localhost:11434",
1818
Model: "nomic-embed-text",
1919
VectorSize: 768,
2020
}
2121

22-
rag, err := minirag.New(config)
22+
rag, err := lilrag.New(config)
2323
if err != nil {
2424
log.Fatal(err)
2525
}

examples/profile/profile_usage.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"strings"
88

99
"lil-rag/pkg/config"
10-
"lil-rag/pkg/minirag"
10+
"lil-rag/pkg/lilrag"
1111
)
1212

1313
func main() {
@@ -17,16 +17,16 @@ func main() {
1717
log.Fatal(err)
1818
}
1919

20-
// Convert to MiniRag config
21-
ragConfig := &minirag.Config{
20+
// Convert to LilRag config
21+
ragConfig := &lilrag.Config{
2222
DatabasePath: profileConfig.StoragePath,
2323
DataDir: profileConfig.DataDir,
2424
OllamaURL: profileConfig.Ollama.Endpoint,
2525
Model: profileConfig.Ollama.EmbeddingModel,
2626
VectorSize: profileConfig.Ollama.VectorSize,
2727
}
2828

29-
rag, err := minirag.New(ragConfig)
29+
rag, err := lilrag.New(ragConfig)
3030
if err != nil {
3131
log.Fatal(err)
3232
}

internal/handlers/handlers.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ import (
1212
"strings"
1313
"time"
1414

15-
"lil-rag/pkg/minirag"
15+
"lil-rag/pkg/lilrag"
1616
)
1717

1818
type Handler struct {
19-
rag *minirag.MiniRag
19+
rag *lilrag.LilRag
2020
version string
2121
}
2222

@@ -31,19 +31,19 @@ type SearchRequest struct {
3131
}
3232

3333
type SearchResponse struct {
34-
Results []minirag.SearchResult `json:"results"`
34+
Results []lilrag.SearchResult `json:"results"`
3535
}
3636

3737
type ErrorResponse struct {
3838
Error string `json:"error"`
3939
Message string `json:"message,omitempty"`
4040
}
4141

42-
func New(rag *minirag.MiniRag) *Handler {
42+
func New(rag *lilrag.LilRag) *Handler {
4343
return &Handler{rag: rag, version: "dev"}
4444
}
4545

46-
func NewWithVersion(rag *minirag.MiniRag, version string) *Handler {
46+
func NewWithVersion(rag *lilrag.LilRag, version string) *Handler {
4747
return &Handler{rag: rag, version: version}
4848
}
4949

@@ -71,7 +71,7 @@ func (h *Handler) Index() http.HandlerFunc {
7171

7272
// Generate ID if not provided
7373
if req.ID == "" {
74-
req.ID = minirag.GenerateDocumentID()
74+
req.ID = lilrag.GenerateDocumentID()
7575
}
7676

7777
if req.Text == "" {
@@ -201,8 +201,8 @@ func (h *Handler) Metrics() http.HandlerFunc {
201201
}
202202

203203
// Try to get cache stats from embedder if it's an OllamaEmbedder
204-
if _, ok := interface{}(h.rag).(*minirag.MiniRag); ok {
205-
// Access the embedder (this would need to be exposed in MiniRag)
204+
if _, ok := interface{}(h.rag).(*lilrag.LilRag); ok {
205+
// Access the embedder (this would need to be exposed in LilRag)
206206
metrics["message"] = "Cache statistics available in enhanced embedder"
207207
metrics["embedding_features"] = []string{"caching", "preprocessing", "query_enhancement", "retry_logic"}
208208
}
@@ -225,7 +225,7 @@ func (h *Handler) Static() http.HandlerFunc {
225225
html := `<!DOCTYPE html>
226226
<html>
227227
<head>
228-
<title>MiniRag API</title>
228+
<title>LilRag API</title>
229229
<style>
230230
body { font-family: Arial, sans-serif; max-width: 800px; margin: 50px auto; padding: 20px; }
231231
.endpoint { margin: 20px 0; padding: 15px; border: 1px solid #ddd; border-radius: 5px; }
@@ -236,7 +236,7 @@ func (h *Handler) Static() http.HandlerFunc {
236236
</style>
237237
</head>
238238
<body>
239-
<h1>MiniRag API</h1>
239+
<h1>LilRag API</h1>
240240
<p>A simple RAG (Retrieval Augmented Generation) API using SQLite and Ollama</p>
241241
242242
<div class="endpoint">
@@ -311,7 +311,7 @@ func (h *Handler) handleFileUpload(w http.ResponseWriter, r *http.Request) {
311311
// Get the ID from form data, generate if not provided
312312
id := r.FormValue("id")
313313
if id == "" {
314-
id = minirag.GenerateDocumentID()
314+
id = lilrag.GenerateDocumentID()
315315
}
316316

317317
// Get the uploaded file
@@ -324,7 +324,7 @@ func (h *Handler) handleFileUpload(w http.ResponseWriter, r *http.Request) {
324324

325325
// Create temporary file to save uploaded content
326326
tempDir := os.TempDir()
327-
tempFile, err := os.CreateTemp(tempDir, "minirag_upload_*"+filepath.Ext(header.Filename))
327+
tempFile, err := os.CreateTemp(tempDir, "lilrag_upload_*"+filepath.Ext(header.Filename))
328328
if err != nil {
329329
h.writeError(w, http.StatusInternalServerError, "failed to create temp file", err.Error())
330330
return

internal/handlers/handlers_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ import (
1515
"testing"
1616
"time"
1717

18-
"lil-rag/pkg/minirag"
18+
"lil-rag/pkg/lilrag"
1919
)
2020

2121
func TestNew(t *testing.T) {
22-
// Create a real MiniRag instance for the handler
23-
config := &minirag.Config{
22+
// Create a real LilRag instance for the handler
23+
config := &lilrag.Config{
2424
DatabasePath: "test.db",
2525
VectorSize: 3,
2626
}
27-
ragInstance, err := minirag.New(config)
27+
ragInstance, err := lilrag.New(config)
2828
if err != nil {
29-
t.Fatalf("Failed to create MiniRag: %v", err)
29+
t.Fatalf("Failed to create LilRag: %v", err)
3030
}
3131

3232
handler := New(ragInstance)
@@ -37,7 +37,7 @@ func TestNew(t *testing.T) {
3737
}
3838

3939
if handler.rag != ragInstance {
40-
t.Error("Expected handler to store the provided MiniRag instance")
40+
t.Error("Expected handler to store the provided LilRag instance")
4141
}
4242

4343
if handler.version != "dev" {
@@ -52,26 +52,26 @@ func TestNew(t *testing.T) {
5252
}
5353

5454
func createTestHandler(t *testing.T) *Handler {
55-
config := &minirag.Config{
55+
config := &lilrag.Config{
5656
DatabasePath: filepath.Join(t.TempDir(), "test.db"),
5757
DataDir: filepath.Join(t.TempDir(), "data"),
5858
VectorSize: 3,
5959
MaxTokens: 100,
6060
Overlap: 20,
6161
}
6262

63-
ragInstance, err := minirag.New(config)
63+
ragInstance, err := lilrag.New(config)
6464
if err != nil {
65-
t.Fatalf("Failed to create MiniRag: %v", err)
65+
t.Fatalf("Failed to create LilRag: %v", err)
6666
}
6767

68-
// Try to initialize the MiniRag instance
68+
// Try to initialize the LilRag instance
6969
if err := ragInstance.Initialize(); err != nil {
7070
// If sqlite-vec is not available, skip tests that require real functionality
7171
if strings.Contains(err.Error(), "sqlite-vec extension not available") {
7272
t.Skip("Skipping test: sqlite-vec extension not available")
7373
}
74-
t.Fatalf("Failed to initialize MiniRag: %v", err)
74+
t.Fatalf("Failed to initialize LilRag: %v", err)
7575
}
7676

7777
return New(ragInstance)
@@ -480,8 +480,8 @@ func TestHandler_Static(t *testing.T) {
480480
if !strings.Contains(body, "<!DOCTYPE html>") {
481481
t.Error("Expected HTML document in response")
482482
}
483-
if !strings.Contains(body, "MiniRag API") {
484-
t.Error("Expected 'MiniRag API' in HTML response")
483+
if !strings.Contains(body, "LilRag API") {
484+
t.Error("Expected 'LilRag API' in HTML response")
485485
}
486486
}
487487
})
@@ -766,14 +766,14 @@ func BenchmarkHandler_Health(b *testing.B) {
766766
}
767767
defer os.RemoveAll(tempDir)
768768

769-
config := &minirag.Config{
769+
config := &lilrag.Config{
770770
DatabasePath: filepath.Join(tempDir, "bench.db"),
771771
DataDir: filepath.Join(tempDir, "data"),
772772
VectorSize: 3,
773773
}
774-
ragInstance, err := minirag.New(config)
774+
ragInstance, err := lilrag.New(config)
775775
if err != nil {
776-
b.Fatalf("Failed to create MiniRag: %v", err)
776+
b.Fatalf("Failed to create LilRag: %v", err)
777777
}
778778
handler := New(ragInstance)
779779

pkg/config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ type Chunk struct {
3939
func Default() *Config {
4040
return &Config{
4141
Database: Database{
42-
Path: "minirag.db",
42+
Path: "lilrag.db",
4343
VectorSize: 768,
4444
},
4545
Ollama: Ollama{

0 commit comments

Comments
 (0)