Skip to content

Commit f0e87c4

Browse files
Merge pull request #11 from DMontgomery40/cleanup
Cleanup
2 parents 8ff927e + 19f892a commit f0e87c4

37 files changed

Lines changed: 1163 additions & 1380 deletions

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
# ===== API Keys =====
55
OPENAI_API_KEY=sk-your-openai-key
6+
OPENROUTER_API_KEY=your-openrouter-key # Optional (only if chat.openrouter.enabled=true)
67
VOYAGE_API_KEY=your-voyage-key
78
COHERE_API_KEY=your-cohere-key
89
JINA_API_KEY=your-jina-key

README.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<p align="center">
2-
<img src="mkdocs/docs/assets/images/tribrid-logo.png" alt="TriBridRAG" width="200" />
2+
<img src="web/public/favicon.svg" alt="TriBridRAG" width="200" />
33
</p>
44

55
<h1 align="center">TriBridRAG</h1>
@@ -18,6 +18,36 @@
1818

1919
---
2020

21+
## Screenshots
22+
23+
<details>
24+
<summary>
25+
<strong>RAG Chat + Eval Dataset Manager</strong> — grounded answers with sources, plus regression evaluation (click to expand)
26+
<br />
27+
<img src="assets/chat-and-dataset.png" alt="TriBridRAG UI showing RAG chat next to the evaluation dataset manager" width="900" />
28+
</summary>
29+
<br />
30+
<p align="center">
31+
<a href="assets/chat-and-dataset.png">
32+
<img src="assets/chat-and-dataset.png" alt="TriBridRAG UI showing RAG chat next to the evaluation dataset manager" width="1000" />
33+
</a>
34+
</p>
35+
</details>
36+
37+
<details>
38+
<summary>
39+
<strong>Indexing Settings + Grafana Dashboards</strong> — tune chunking/embedding and watch indexing metrics live (click to expand)
40+
<br />
41+
<img src="assets/indexing-settings-with-grafana-on-side.png" alt="TriBridRAG indexing settings UI alongside Grafana dashboards" width="900" />
42+
</summary>
43+
<br />
44+
<p align="center">
45+
<a href="assets/indexing-settings-with-grafana-on-side.png">
46+
<img src="assets/indexing-settings-with-grafana-on-side.png" alt="TriBridRAG indexing settings UI alongside Grafana dashboards" width="1000" />
47+
</a>
48+
</p>
49+
</details>
50+
2151
## The Problem
2252

2353
Single-method RAG systems fail in predictable ways:

assets/chat-and-dataset.png

321 KB
Loading
207 KB
Loading

scripts/check_banned.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,18 @@
106106
"OPENAI_API_KEY",
107107
"OPENROUTER_API_KEY",
108108
"COHERE_API_KEY",
109+
"ANTHROPIC_API_KEY",
110+
"GOOGLE_API_KEY",
111+
"VOYAGE_API_KEY",
112+
"JINA_API_KEY",
113+
# Integrations (UI-only presence checks; values are never returned)
114+
"LANGTRACE_API_KEY",
115+
"LANGCHAIN_API_KEY",
116+
"LANGSMITH_API_KEY",
117+
"NETLIFY_API_KEY",
118+
"GRAFANA_API_KEY",
119+
"SLACK_WEBHOOK_URL",
120+
"DISCORD_WEBHOOK_URL",
109121
# Postgres infra
110122
"POSTGRES_DSN",
111123
"POSTGRES_HOST",

scripts/generate_types.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ def main() -> None:
318318
EvalRunMeta,
319319
EvalRunsResponse,
320320
EvalAnalyzeComparisonResponse,
321+
EvalAnalyzeComparisonRequest,
321322
EvalComparisonResult,
322323
# Domain models - Reranker training eval
323324
CorpusEvalProfile,
@@ -330,6 +331,11 @@ def main() -> None:
330331
RerankerTrainMetricsResponse,
331332
RerankerTrainDiffRequest,
332333
RerankerTrainDiffResponse,
334+
# Domain models - Prompts (Eval → System Prompts)
335+
PromptsResponse,
336+
PromptMetadata,
337+
PromptUpdateRequest,
338+
PromptUpdateResponse,
333339
)
334340
except ImportError as e:
335341
print(f"ERROR: Could not import models: {e}")
@@ -407,6 +413,7 @@ def main() -> None:
407413
EvalRunMeta,
408414
EvalRunsResponse,
409415
EvalAnalyzeComparisonResponse,
416+
EvalAnalyzeComparisonRequest,
410417
EvalComparisonResult,
411418
CorpusEvalProfile,
412419
RerankerTrainStartRequest,
@@ -418,6 +425,10 @@ def main() -> None:
418425
RerankerTrainMetricsResponse,
419426
RerankerTrainDiffRequest,
420427
RerankerTrainDiffResponse,
428+
PromptsResponse,
429+
PromptMetadata,
430+
PromptUpdateRequest,
431+
PromptUpdateResponse,
421432
]
422433

423434
print(f"Processing {len(all_models)} models...")

scripts/print_codex_model.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env python3
2+
"""
3+
Print the configured Codex CLI model from ~/.codex/config.toml.
4+
5+
This is intentionally simple and machine-readable (prints just the model string).
6+
"""
7+
8+
from __future__ import annotations
9+
10+
from pathlib import Path
11+
12+
13+
def main() -> None:
14+
config_path = Path("~/.codex/config.toml").expanduser()
15+
if not config_path.exists():
16+
print("")
17+
return
18+
19+
try:
20+
import tomllib # py>=3.11
21+
except Exception:
22+
print("")
23+
return
24+
25+
try:
26+
data = tomllib.loads(config_path.read_text(encoding="utf-8"))
27+
except Exception:
28+
print("")
29+
return
30+
31+
model = data.get("model", "")
32+
if model is None:
33+
model = ""
34+
print(model)
35+
36+
37+
if __name__ == "__main__":
38+
main()
39+

server/api/config.py

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,26 @@
2424

2525
router = APIRouter(tags=["config"])
2626

27+
_SECRETS_CHECK_ALLOWLIST = {
28+
# Provider secrets
29+
"OPENAI_API_KEY",
30+
"OPENROUTER_API_KEY",
31+
"ANTHROPIC_API_KEY",
32+
"GOOGLE_API_KEY",
33+
"COHERE_API_KEY",
34+
"VOYAGE_API_KEY",
35+
"JINA_API_KEY",
36+
# Integrations (UI surfaces these; backend does not expose values)
37+
"LANGTRACE_API_KEY",
38+
"LANGCHAIN_API_KEY",
39+
"LANGSMITH_API_KEY",
40+
"NETLIFY_API_KEY",
41+
"GRAFANA_API_KEY",
42+
"SLACK_WEBHOOK_URL",
43+
"DISCORD_WEBHOOK_URL",
44+
}
45+
46+
2747
@router.get("/config", response_model=TriBridConfig)
2848
async def get_config(scope: CorpusScope = Depends()) -> TriBridConfig:
2949
repo_id = scope.resolved_repo_id
@@ -106,7 +126,35 @@ async def reset_config(scope: CorpusScope = Depends()) -> TriBridConfig:
106126
async def check_secrets(keys: str = Query(..., description="Comma-separated env var names")) -> dict[str, bool]:
107127
"""Return which secret env vars are configured (never returns values)."""
108128
names = [k.strip() for k in (keys or "").split(",") if k.strip()]
109-
return {name: bool(os.getenv(name)) for name in names}
129+
if not names:
130+
return {}
131+
132+
invalid = [name for name in names if name not in _SECRETS_CHECK_ALLOWLIST]
133+
if invalid:
134+
raise HTTPException(
135+
status_code=400,
136+
detail=f"Unsupported secret key(s): {', '.join(sorted(set(invalid)))}",
137+
)
138+
139+
# Use explicit getenv calls (no dynamic env lookups) to keep env usage auditable/"LAW"-compliant.
140+
status = {
141+
"OPENAI_API_KEY": bool(os.getenv("OPENAI_API_KEY")),
142+
"OPENROUTER_API_KEY": bool(os.getenv("OPENROUTER_API_KEY")),
143+
"ANTHROPIC_API_KEY": bool(os.getenv("ANTHROPIC_API_KEY")),
144+
"GOOGLE_API_KEY": bool(os.getenv("GOOGLE_API_KEY")),
145+
"COHERE_API_KEY": bool(os.getenv("COHERE_API_KEY")),
146+
"VOYAGE_API_KEY": bool(os.getenv("VOYAGE_API_KEY")),
147+
"JINA_API_KEY": bool(os.getenv("JINA_API_KEY")),
148+
"LANGTRACE_API_KEY": bool(os.getenv("LANGTRACE_API_KEY")),
149+
"LANGCHAIN_API_KEY": bool(os.getenv("LANGCHAIN_API_KEY")),
150+
"LANGSMITH_API_KEY": bool(os.getenv("LANGSMITH_API_KEY")),
151+
"NETLIFY_API_KEY": bool(os.getenv("NETLIFY_API_KEY")),
152+
"GRAFANA_API_KEY": bool(os.getenv("GRAFANA_API_KEY")),
153+
"SLACK_WEBHOOK_URL": bool(os.getenv("SLACK_WEBHOOK_URL")),
154+
"DISCORD_WEBHOOK_URL": bool(os.getenv("DISCORD_WEBHOOK_URL")),
155+
}
156+
157+
return {name: status[name] for name in names}
110158

111159

112160
@router.get("/mcp/status", response_model=MCPStatusResponse)

0 commit comments

Comments
 (0)