Skip to content

Commit 4079eb9

Browse files
authored
docs(use-cases): initial scenarios and success metrics (#29)
* feat(rag): step 6B retrieval tool (MCP) with tests - Add mcp-server/tools/search_docs.py with real embedding query - Update mcp-server/server.py to use new search tool - Add tests/rag/test_retrieval_topk.py with top-k retrieval tests - Query → embed → cosine → top-k (k=3–5) functionality - Return passages + metadata (doc_id, chunk_id, score) - Fallback to mock results when RAG components unavailable Awaits CI for merge. * fix(mcp): correct import path for search_docs endpoint - Rename mcp-server/ to mcp_server/ for proper Python package structure - Add __init__.py to make it a proper package - Update all references from mcp-server to mcp_server - Fixes import error: mcp_server.tools.search_docs import search_documents_endpoint * docs(research): add RAG baseline findings log with metrics table - Add living metrics log for tracking chunking, retrieval, and QA metrics - Include baseline configuration: 1000 tokens, 15% overlap, cosine similarity - Add seeded metrics table with TBD placeholders for initial run - Include repro instructions for lab/rag/eval.py with fixed seed * docs(use-cases): add AI-assisted dev and multi-tool support agent docs - Add AI-Assisted Development use case with success metrics and minimal flow - Add Multi-Tool Support Agent use case with MTTD and escalation metrics - Include grounded use-case docs with measurable success criteria - Define tools inventory and minimal flows for each scenario * fix(docs): add version headers to all documentation files - Add Version: v0.6.2 header to docs/releases/v0.6.2.md - Add Version: v0.6.2 header to docs/research/rag-baseline.md - Add Version: v0.6.2 header to docs/use-cases/multi-tool-support-agent.md - Add Version: v0.6.2 header to docs/use-cases/ai-assisted-dev.md Fixes docs-check CI failure for PRs #27-29
1 parent ec9f17e commit 4079eb9

20 files changed

Lines changed: 1747 additions & 9 deletions

.coverage

52 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ AI Development Lab with MCP Server for secure, auditable AI tool interactions.
1212

1313
2. Start the MCP server:
1414
```bash
15-
uvicorn mcp-server.server:app --reload
15+
uvicorn mcp_server.server:app --reload
1616
```
1717

1818
3. Run tests:
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "mcp-promotions"
7+
version = "0.6.2"
8+
description = "MCP Promotions Server - Production runtime for promoted lab tools"
9+
authors = [
10+
{name = "AI Dev Lab", email = "dev@ai-dev-lab.com"}
11+
]
12+
readme = "README.md"
13+
requires-python = ">=3.8"
14+
dependencies = [
15+
"fastapi>=0.104.0",
16+
"uvicorn[standard]>=0.24.0",
17+
"pydantic>=2.0.0",
18+
]
19+
20+
[project.optional-dependencies]
21+
dev = [
22+
"pytest>=7.0.0",
23+
"pytest-asyncio>=0.21.0",
24+
"httpx>=0.25.0",
25+
]
26+
27+
[tool.pytest.ini_options]
28+
testpaths = ["tests"]
29+
python_files = ["test_*.py"]
30+
python_classes = ["Test*"]
31+
python_functions = ["test_*"]
32+
33+
[tool.black]
34+
line-length = 88
35+
target-version = ['py38']
36+
37+
[tool.ruff]
38+
target-version = "py38"
39+
line-length = 88
40+
select = ["E", "F", "I"]
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
"""
2+
MCP Promotions Server - v0.6.2
3+
4+
Minimal runtime server for promoted MCP tools.
5+
This is a production-ready wrapper around lab functionality.
6+
"""
7+
8+
from fastapi import FastAPI, Request
9+
from pydantic import BaseModel
10+
import time
11+
import logging
12+
13+
# Configure logging
14+
logging.basicConfig(level=logging.INFO)
15+
logger = logging.getLogger(__name__)
16+
17+
app = FastAPI(title="MCP Promotions Server (v0.6.2)")
18+
19+
20+
class SearchRequest(BaseModel):
21+
query: str
22+
23+
24+
class SummarizeRequest(BaseModel):
25+
passage: str
26+
27+
28+
@app.get("/health")
29+
def health():
30+
"""Health check endpoint - always allowed."""
31+
return {"ok": True, "version": "0.6.2", "service": "mcp-promotions"}
32+
33+
34+
@app.post("/tools/search_docs")
35+
def search_docs(req: SearchRequest, request: Request):
36+
"""Search documents endpoint - promoted from lab."""
37+
start_time = time.time()
38+
user_id = request.headers.get("X-User-ID")
39+
session_id = request.headers.get("X-Session-ID")
40+
41+
try:
42+
# Mock search results for now - will be replaced with real impl
43+
results = [
44+
{
45+
"title": "Sample Document",
46+
"content": f"Search results for: {req.query}",
47+
"score": 0.95,
48+
"source": "promoted-docs"
49+
}
50+
]
51+
52+
# Log the tool call
53+
logger.info("search_docs called by user %s, session %s",
54+
user_id, session_id)
55+
56+
return {
57+
"query": req.query,
58+
"results": results,
59+
"request_id": f"req_{int(start_time)}",
60+
"service": "mcp-promotions"
61+
}
62+
except Exception as e:
63+
logger.error("Error in search_docs: %s", e)
64+
return {"error": "Internal error", "message": "Search failed"}
65+
66+
67+
@app.post("/tools/summarize")
68+
def summarize(req: SummarizeRequest, request: Request):
69+
"""Summarize text endpoint - promoted from lab."""
70+
start_time = time.time()
71+
user_id = request.headers.get("X-User-ID")
72+
session_id = request.headers.get("X-Session-ID")
73+
74+
try:
75+
# Mock summarization for now - will be replaced with real impl
76+
summary = f"Summary of: {req.passage[:50]}..."
77+
78+
# Log the tool call
79+
logger.info("summarize called by user %s, session %s",
80+
user_id, session_id)
81+
82+
return {
83+
"summary": summary,
84+
"request_id": f"req_{int(start_time)}",
85+
"service": "mcp-promotions"
86+
}
87+
except Exception as e:
88+
logger.error("Error in summarize: %s", e)
89+
return {"error": "Internal error", "message": "Summarization failed"}
90+
91+
92+
@app.get("/promotions/status")
93+
def get_promotion_status():
94+
"""Get current promotion status and available tools."""
95+
return {
96+
"version": "0.6.2",
97+
"promoted_tools": ["search_docs", "summarize"],
98+
"status": "active",
99+
"lab_dependencies": [
100+
"lab.dsp.summarize",
101+
"lab.security.guardian",
102+
"lab.obs.audit"
103+
]
104+
}

0 commit comments

Comments
 (0)