Skip to main content

Dev Agent - Engineering Assistant AI

The Dev Agent is an AI-powered engineering assistant that helps developers navigate the Olympus Cloud codebase, understand architecture, debug issues, and find documentation.

Overview

AttributeValue
Agent NameDev Agent
Primary UsersNebusAI Engineers, Partner Developers
Model TiersT3-T5 (Gemini 3 Flash → Claude Sonnet 4.5)
Knowledge Basedev-kb
AvailabilityInternal only (IDE + Slack + CLI)
┌─────────────────────────────────────────────────────────────────┐
│ DEV AGENT ARCHITECTURE │
├─────────────────────────────────────────────────────────────────┤
│ │
│ DEVELOPER DEV AGENT │
│ ───────────────────────────────────────────────────────────── │
│ │
│ ┌─────────┐ ┌─────────────────┐ │
│ │ VS Code │──────────────│ │ │
│ │ Extension│ Query │ ACP Router │ │
│ └─────────┘ │ (T3-T5) │ │
│ │ │ │
│ ┌─────────┐ │ ┌──────────┐ │ ┌──────────┐ │
│ │ Slack │──────────────│ │ LangGraph│ │────│ dev-kb │ │
│ │ Bot │ │ │ Agent │ │ │ Vectorize│ │
│ └─────────┘ │ └──────────┘ │ └──────────┘ │
│ │ │ │
│ ┌─────────┐ │ ┌──────────┐ │ ┌──────────┐ │
│ │ CLI │──────────────│ │ Tools │ │────│ Codebase │ │
│ │ (claude)│ │ └──────────┘ │ │ Search │ │
│ └─────────┘ └─────────────────┘ └──────────┘ │
│ │
└─────────────────────────────────────────────────────────────────┘

Capabilities

Code Understanding

CapabilityDescriptionExample Query
Architecture ExplanationExplain system design"How does the payment flow work?"
Code SearchFind relevant code"Where is order validation handled?"
Function ExplanationExplain what code does"What does process_payment do?"
Dependency TracingTrack data flow"What calls the inventory service?"

Debugging Assistance

CapabilityDescriptionExample Query
Error AnalysisExplain errors"What causes this Spanner error?"
Log InterpretationParse log messages"What does this trace mean?"
Stack Trace AnalysisDecode stack traces"Explain this panic trace"
Performance IssuesIdentify bottlenecks"Why is this query slow?"
CapabilityDescriptionExample Query
API ReferenceFind API docs"How do I authenticate?"
Guide SearchFind how-to guides"How to add a new endpoint?"
Architecture DocsFind design docs"Where's the tenancy design?"
Runbook SearchFind operational docs"What's the incident process?"

Code Generation

CapabilityDescriptionExample Query
BoilerplateGenerate scaffolding"Create a new Rust service"
TestsGenerate test cases"Write tests for this function"
DocumentationGenerate docs"Document this module"
MigrationsDatabase changes"Create migration for this schema"

Model Tier Routing

Dev Agent uses intelligent routing based on query complexity:

Query TypeTierModelCostLatency
Simple lookupT3Gemini 3 Flash$0.50/M200ms
Code explanationT4Claude Haiku 4.5$1.00/M400ms
Complex analysisT5Claude Sonnet 4.5$3.00/M800ms
Architecture designT5Claude Sonnet 4.5$3.00/M1200ms

Routing Logic

def route_dev_query(query: str, context: dict) -> ModelTier:
# Simple lookups
if is_api_lookup(query) or is_config_question(query):
return Tier.T3

# Code explanation with context
if has_code_snippet(context) and is_explanation_request(query):
return Tier.T4

# Complex multi-file analysis
if requires_cross_file_analysis(query):
return Tier.T5

# Architecture and design questions
if is_architecture_question(query):
return Tier.T5

# Default to T4 for balanced quality/cost
return Tier.T4

Knowledge Base (dev-kb)

Indexed Content

SourceTypeUpdate Frequency
olympus-docsAPI reference, guidesReal-time
Architecture docsDesign documentsOn commit
ADRsArchitecture decisionsOn commit
RunbooksOperational guidesOn commit
Code commentsIn-code documentationDaily
README filesProject documentationOn commit

Knowledge Domains

┌─────────────────────────────────────────────────────────────────┐
│ DEV-KB KNOWLEDGE DOMAINS │
├─────────────────────────────────────────────────────────────────┤
│ │
│ RUST SERVICES FLUTTER SHELLS │
│ ───────────────────── ───────────────────── │
│ • Auth Service • Staff Shell │
│ • Platform Service • Customer Shell │
│ • Commerce Service • Kiosk Shell │
│ • Data models & migrations • Platform Portal │
│ • Cockpit │
│ GO SERVICES │
│ ───────────────────── INFRASTRUCTURE │
│ • API Gateway ───────────────────── │
│ • Rate limiting • Terraform configs │
│ • Authentication • Cloud Run deployment │
│ • WebSocket handling • Cloudflare Workers │
│ • OlympusEdge │
│ PYTHON SERVICES │
│ ───────────────────── AI/ML │
│ • AI/ML pipelines ───────────────────── │
│ • LangGraph agents • ACP Router │
│ • Embeddings service • Model configs │
│ • Vision AI • RAG pipelines │
│ │
└─────────────────────────────────────────────────────────────────┘

Embedding Configuration

ParameterValue
Model@cf/baai/bge-base-en-v1.5
Chunk Size512 tokens
Chunk Overlap50 tokens
Similarity Threshold0.75
Top-K Results10

Tools

The Dev Agent has access to specialized tools:

Code Search Tools

ToolDescriptionParameters
search_codebaseSemantic code searchquery, language, path_filter
find_definitionFind symbol definitionsymbol, scope
find_referencesFind symbol usagessymbol, include_tests
get_file_contentRead file contentspath, line_start, line_end

Documentation Tools

ToolDescriptionParameters
search_docsSearch documentationquery, doc_type
get_api_specGet OpenAPI specservice, endpoint
get_adrGet architecture decisionadr_number
get_runbookGet operational runbooktopic

Analysis Tools

ToolDescriptionParameters
analyze_errorParse error messageerror_text, context
trace_dependencyTrack call chainfunction, depth
explain_codeExplain code blockcode, language
suggest_fixSuggest bug fixerror, context

Example Interactions

Architecture Question

Developer: "How does multi-tenancy work in the platform service?"

Dev Agent:

Multi-tenancy in the Platform Service is implemented using these key patterns:

  1. Tenant Isolation (platform_service/src/tenancy/mod.rs)
    • Each request includes tenant_id in JWT claims
    • Middleware extracts and validates tenant context
    • All queries are scoped to tenant via row-level security
  2. Data Model (platform_service/src/models/tenant.rs:45)
    • Tenant struct with id, slug, settings, subscription_tier
  3. Cross-Tenant Prevention
    • Spanner interleaved tables enforce parent-child relationships
    • API Gateway validates tenant access before routing
    • No cross-tenant queries possible without explicit override

See: docs/architecture/multi-tenancy.md for full design.

Debugging Help

Developer: "I'm getting 'DEADLINE_EXCEEDED' errors from Spanner. What should I check?"

Dev Agent:

DEADLINE_EXCEEDED from Spanner typically means queries are timing out. Check these areas:

1. **Query Performance** (Most Common)
- Missing indexes on filtered columns
- Full table scans on large tables
- Complex JOINs without proper key ordering

Run: `EXPLAIN ANALYZE` on your query in Spanner console

2. **Transaction Scope** (commerce_service/src/orders/mod.rs:234)
- Transactions holding locks too long
- Read-write transactions when read-only would work

Fix: Use read-only transactions for queries:
```rust
let ro_txn = client.read_only_transaction().await?;
  1. Connection Pool

    • Pool exhaustion under load
    • Check: SPANNER_MAX_SESSIONS env var (default: 100)
  2. Network/Region

    • Cross-region latency
    • Check Cloud Run region matches Spanner region

For detailed troubleshooting: docs/operations/runbooks/database.md


### Code Generation

**Developer:** "Generate a new API endpoint for fetching user preferences"

**Dev Agent:**

Here's the endpoint following our patterns:

1. Add route (api_gateway/src/routes/users.rs)

func (r *UserRoutes) RegisterRoutes(router *gin.RouterGroup) {
users := router.Group("/users")
{
users.GET("/:id/preferences", r.GetPreferences)
}
}

func (r *UserRoutes) GetPreferences(c *gin.Context) {
userID := c.Param("id")
tenantID := middleware.GetTenantID(c)

prefs, err := r.userService.GetPreferences(c, tenantID, userID)
if err != nil {
response.Error(c, err)
return
}

response.Success(c, prefs)
}

2. Add service method (platform_service/src/users/preferences.rs)

pub async fn get_preferences(
&self,
tenant_id: Uuid,
user_id: Uuid,
) -> Result<UserPreferences, ServiceError> {
let prefs = sqlx::query_as!(
UserPreferences,
r#"SELECT * FROM user_preferences
WHERE tenant_id = $1 AND user_id = $2"#,
tenant_id,
user_id
)
.fetch_optional(&self.pool)
.await?
.ok_or(ServiceError::NotFound)?;

Ok(prefs)
}

3. Add test (platform_service/tests/users/preferences_test.rs)

#[tokio::test]
async fn test_get_preferences() {
let ctx = TestContext::new().await;
let prefs = ctx.service.get_preferences(
ctx.tenant_id,
ctx.user_id
).await.unwrap();

assert_eq!(prefs.user_id, ctx.user_id);
}

Follow the PR checklist in docs/development/pr-checklist.md


### API Reference Lookup

**Developer:** "What's the request format for creating an order?"

**Dev Agent:**

POST /api/v1/orders

Request Body:

{
"location_id": "uuid",
"order_type": "DINE_IN | TAKEOUT | DELIVERY",
"table_id": "uuid (optional, for DINE_IN)",
"customer_id": "uuid (optional)",
"items": [
{
"menu_item_id": "uuid",
"quantity": 1,
"modifiers": [
{
"modifier_id": "uuid",
"quantity": 1
}
],
"special_instructions": "string"
}
],
"notes": "string (optional)"
}

Response (201 Created):

{
"id": "uuid",
"order_number": "A-0042",
"status": "PENDING",
"items": [...],
"subtotal": 24.99,
"tax": 2.25,
"total": 27.24,
"created_at": "2026-01-23T12:00:00Z"
}

Authentication: Bearer token with orders:write scope

Full spec: docs/api/commerce/orders.yaml


---

## Access Methods

### VS Code Extension (Olympus Lens)

1. Install "Olympus Lens" from VS Code marketplace
2. Authenticate with NebusAI SSO
3. Use keyboard shortcut: `Cmd+Shift+D` (Mac) / `Ctrl+Shift+D` (Windows)
4. Or right-click → "Ask Dev Agent"

### Slack Integration

1. Direct message `@dev-agent` in Slack
2. Or mention in any channel: `@dev-agent how do I...`
3. Threads maintained for context

### CLI (Claude Code)

```bash
# In any Olympus repo directory
claude "How does the payment service handle refunds?"

# With file context
claude "Explain this code" --file src/payments/refund.rs

Configuration

Environment Variables

VariableDescriptionDefault
DEV_AGENT_MODEL_TIERDefault model tierT4
DEV_AGENT_MAX_TOKENSMax response tokens4096
DEV_AGENT_TEMPERATUREResponse creativity0.2
DEV_AGENT_KB_THRESHOLDRAG similarity threshold0.75

User Preferences

# ~/.olympus/dev-agent.yaml
preferences:
default_language: rust
include_tests: true
verbose_explanations: false
preferred_examples: code_first

Best Practices

Effective Queries

tip

Be specific in your queries and include file paths, service names, or error messages. The Dev Agent performs best when it can narrow its search to a specific domain rather than searching the entire codebase.

Good:

  • "How does order validation work in commerce service?"
  • "What's the pattern for adding a new gRPC endpoint?"
  • "Explain the LangGraph agent for voice ordering"

Less Effective:

  • "Help me with code" (too vague)
  • "Fix my bug" (no context)
  • "Write everything for me" (scope too large)

Providing Context

  1. Include error messages - Full stack trace helps
  2. Mention file paths - "In src/orders/validation.rs..."
  3. Describe what you tried - "I attempted X but got Y"
  4. Specify language/service - "In the Go gateway..."

When to Escalate

warning

The Dev Agent is not a substitute for human judgment on security-sensitive decisions, breaking API changes, production incidents, or architecture changes. Always escalate these to the appropriate human engineer.

Use human engineers when:

  • Security-sensitive decisions
  • Breaking API changes
  • Production incidents
  • Architecture changes

Monitoring & Metrics

Usage Metrics

MetricDescription
dev_agent_queries_totalTotal queries
dev_agent_latency_p9999th percentile latency
dev_agent_tier_usageQueries by model tier
dev_agent_satisfactionUser feedback scores

Quality Metrics

MetricTarget
Accuracy>90% helpful responses
Latency (p50)<500ms
Latency (p99)<2000ms
KB Hit Rate>80% queries find relevant docs