Commit 3224ff7
committed
feat: add RAG plugin, chat completion provider, and resolve-time embedding
- Add chat.ts: chat completion provider abstraction (Ollama via @agentic-kit/ollama)
- Add rag-plugin.ts: LlmRagPlugin with ragQuery and embedText root query fields
- Detects @hasChunks smart tags to discover chunk tables
- RAG flow: embed prompt → search chunks → assemble context → chat LLM → return answer
- Adds RagResponse, RagSource, EmbedTextResponse types to schema
- Wire resolve-time embedding in text-search-plugin (resolver wrapper on queries)
- Wire resolve-time embedding in text-mutation-plugin (resolver wrapper on mutations)
- Update llm-module-plugin to resolve chat completer on build
- Add enableRag toggle to GraphileLlmPreset (default false)
- Add chat completion types (ChatFunction, ChatConfig, ChatMessage, etc.)
- Add RagDefaults, ChunkTableInfo types
- Add integration tests: RAG schema enrichment, ragQuery execution, embedText,
chat completion abstraction unit tests, preset toggle tests
- Add articles_chunks seed table for RAG testing1 parent 1be6d54 commit 3224ff7
12 files changed
Lines changed: 1452 additions & 21 deletions
File tree
- graphile/graphile-llm
- src
- __tests__
- plugins
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
48 | 52 | | |
49 | 53 | | |
50 | 54 | | |
| |||
0 commit comments