Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces an AI agent service with Model Context Protocol (MCP) integration for the Nais platform. The agent provides GraphQL schema exploration tools and chat capabilities with retrieval-augmented generation (RAG) support.
Changes:
- New
pkg/mcppackage implementing MCP tools for GraphQL schema exploration and query execution - New
internal/agentpackage providing AI chat orchestration with tool calling, RAG document search, and conversation management - RAG index generator tool that processes documentation into DuckDB embeddings for semantic search
- Database schema for storing agent conversations and messages
- Configuration for Vertex AI integration and agent features
Reviewed changes
Copilot reviewed 54 out of 57 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| pkg/mcp/tools/*.go | MCP tool definitions, registry, and execution handlers for schema exploration and GraphQL operations |
| pkg/mcp/server.go | MCP server implementation with stdio/HTTP/SSE transports |
| pkg/mcp/executor.go | Direct tool executor without MCP protocol overhead for hosted agents |
| internal/agent/*.go | Agent orchestrator, conversation management, MCP integration, and HTTP handlers |
| internal/agent/chat/*.go | Chat client interfaces and streaming implementations |
| internal/agent/rag/*.go | RAG document search with DuckDB and embedding support |
| internal/cmd/gen_rag_index/*.go | Tool to generate DuckDB index from MkDocs search index |
| internal/database/migrations/0057_agent_conversations.sql | Database schema for agent conversations and messages |
| internal/cmd/api/api.go | Integration of agent service into main API server |
| go.mod | New dependencies for DuckDB, Vertex AI, and MCP |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| EmbeddingModel: cfg.VertexAI.EmbeddingModel, | ||
| }, log.WithField("client", "duckdb-rag")) | ||
| if err != nil { | ||
| chatClient.Close() |
There was a problem hiding this comment.
This expression has no effect.
Suggested change
| chatClient.Close() | |
| if cerr := chatClient.Close(); cerr != nil { | |
| log.WithError(cerr).Warn("closing chat client") | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.