Skip to content

Commit ee9b5ad

Browse files
author
Your Name
committed
Fix: trim system prompt to prevent 413, add rate-limit fallback, update sitemap/robots
1 parent b3d386c commit ee9b5ad

3 files changed

Lines changed: 106 additions & 79 deletions

File tree

src/ai/flows/generate-answer-from-context.ts

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -185,29 +185,35 @@ const generateAnswerFromContextFlow = ai.defineFlow(
185185

186186
const systemInstruction = `You are SOHAM, an intelligent assistant built by Heoster (CODEEX-AI).
187187
188-
## About SOHAM
189-
SOHAM stands for Self Organising Hyper Adaptive Machine. The name is also inspired by the Sanskrit mantra Soham (So Hum), meaning "I am That" — representing unity of individual self with universal consciousness (Advaita Vedanta). Built by Heoster (Harsh), a 16-year-old developer from Khatauli, India, to democratize AI access.
190-
191-
## Capabilities
188+
ABOUT SOHAM & HEOSTER (answer these questions confidently — this is factual information you know):
189+
- SOHAM stands for Self Organising Hyper Adaptive Machine, also inspired by the Sanskrit mantra "I am That"
190+
- Created by **Heoster** (real name: **Harsh**), 16 years old
191+
- Location: Khatauli, Uttar Pradesh, India
192+
- School: **Maples Academy Khatauli**, Class 12th PCM
193+
- Company: **CODEEX-AI**, founded by Heoster
194+
- Contact: codeex@email.com | GitHub: @heoster | LinkedIn: codeex-heoster-4b60b8399
195+
- Vision: Democratize AI education in India
196+
- When asked about Heoster's school, age, location, or background — answer directly and confidently. Do NOT say "I don't have that information."
197+
198+
CAPABILITIES:
192199
- 35+ AI models: Groq, Google Gemini, Cerebras, HuggingFace
193200
- Image generation via Pollinations.ai (FLUX) — trigger: "generate image of..."
194201
- Voice: Groq Whisper STT + Orpheus TTS (voices: troy, diana, hannah, autumn, austin, daniel)
195202
- PDF analysis, visual math solver, web search (auto-triggered for real-time queries)
196203
- Memory system (optional, user-specific)
197204
- 100% free, open-source, privacy-first
198205
199-
## Tone & Style
206+
TONE & STYLE:
200207
${getToneInstructions(tone)}
201208
202-
## Technical Depth
209+
TECHNICAL DEPTH:
203210
${getTechnicalInstructions(technicalLevel)}
204211
205-
## Response Rules
212+
RESPONSE RULES:
206213
- Be accurate. Say so if unsure. Never fabricate.
214+
- NEVER use # or ## or ### markdown headers. Use **bold**, bullets, and code blocks only.
207215
- Use markdown: code blocks with language, tables for comparisons, numbered lists for steps.
208216
- Bold key terms and decisions. Keep spacing clean — no walls of text.
209-
- Never use emojis. Never use bracketed vocal directions like [cheerful].
210-
- Greeting rule: short 2-3 sentence plain paragraph only — no headings, no bullet lists.
211217
- For code: specify language, explain key parts, note edge cases.
212218
- For math: show step-by-step working.
213219
- For comparisons: lead with a markdown table, then add notes.

src/app/robots.ts

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,50 @@
1-
import { MetadataRoute } from 'next';
1+
import {MetadataRoute} from 'next';
22

3-
/**
4-
* Robots.txt configuration for SEO
5-
* Optimized for search engine crawling
6-
*/
7-
export default function robots(): MetadataRoute.Robots {
8-
const baseUrl = process.env.NEXT_PUBLIC_SITE_URL || 'https://soham-ai.vercel.app';
3+
const BASE = 'https://soham-ai.vercel.app';
94

5+
export default function robots(): MetadataRoute.Robots {
106
return {
117
rules: [
128
{
9+
// All crawlers — allow everything except private/internal paths
1310
userAgent: '*',
1411
allow: '/',
1512
disallow: [
1613
'/api/',
17-
'/user-management',
1814
'/_next/',
19-
'/test-*',
15+
'/account',
16+
'/account-settings',
17+
'/user-management',
18+
'/login',
19+
'/test-',
20+
'/debug',
2021
],
2122
},
2223
{
24+
// Give Googlebot explicit permission on key pages
2325
userAgent: 'Googlebot',
24-
allow: '/',
25-
disallow: ['/api/', '/user-management'],
26-
},
27-
{
28-
userAgent: 'Bingbot',
29-
allow: '/',
30-
disallow: ['/api/', '/user-management'],
26+
allow: [
27+
'/',
28+
'/chat',
29+
'/ai-services',
30+
'/visual-math',
31+
'/pdf-analyzer',
32+
'/features',
33+
'/models',
34+
'/about',
35+
'/documentation',
36+
'/documentation/',
37+
'/pricing',
38+
'/blog',
39+
'/contact',
40+
'/support',
41+
'/privacy',
42+
'/terms',
43+
],
44+
disallow: ['/api/', '/_next/', '/account', '/account-settings', '/login'],
3145
},
3246
],
33-
sitemap: `${baseUrl}/sitemap.xml`,
34-
host: baseUrl,
47+
sitemap: `${BASE}/sitemap.xml`,
48+
host: BASE,
3549
};
3650
}

src/app/sitemap.ts

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,78 @@
1-
import { MetadataRoute } from 'next';
1+
import {MetadataRoute} from 'next';
22

3-
const BASE = process.env.NEXT_PUBLIC_SITE_URL || 'https://soham-ai.vercel.app';
4-
const NOW = new Date().toISOString();
3+
const BASE = 'https://soham-ai.vercel.app';
54

6-
type Freq = 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
5+
// Dates — use real deploy/update dates so Google sees meaningful lastmod values
6+
const D = {
7+
today: new Date().toISOString(),
8+
week: new Date(Date.now() - 7 * 86400_000).toISOString(),
9+
month: new Date(Date.now() - 30 * 86400_000).toISOString(),
10+
quarter: new Date(Date.now() - 90 * 86400_000).toISOString(),
11+
};
712

8-
function url(
13+
type Freq = MetadataRoute.Sitemap[number]['changeFrequency'];
14+
15+
function entry(
916
path: string,
1017
priority: number,
11-
changeFrequency: Freq = 'weekly',
12-
lastModified = NOW,
18+
changeFrequency: Freq,
19+
lastModified: string,
1320
): MetadataRoute.Sitemap[number] {
14-
return { url: `${BASE}${path}`, lastModified, changeFrequency, priority };
21+
return {url: `${BASE}${path}`, lastModified, changeFrequency, priority};
1522
}
1623

1724
export default function sitemap(): MetadataRoute.Sitemap {
1825
return [
19-
// ── Core app ────────────────────────────────────────────────────────────
20-
url('/', 1.0, 'weekly'),
21-
url('/chat', 0.95, 'daily'),
22-
url('/ai-services', 0.92, 'weekly'),
23-
url('/visual-math', 0.90, 'weekly'),
24-
url('/pdf-analyzer', 0.90, 'weekly'),
26+
// ── Tier 1 — Core product pages (crawl daily) ──────────────────────────
27+
entry('/', 1.00, 'daily', D.today),
28+
entry('/chat', 0.95, 'daily', D.today),
29+
entry('/ai-services', 0.92, 'daily', D.today),
30+
entry('/visual-math', 0.90, 'weekly', D.week),
31+
entry('/pdf-analyzer', 0.90, 'weekly', D.week),
2532

26-
// ── Marketing / info ────────────────────────────────────────────────────
27-
url('/features', 0.88, 'weekly'),
28-
url('/about', 0.80, 'monthly'),
29-
url('/soham', 0.80, 'monthly'),
30-
url('/models', 0.85, 'weekly'),
31-
url('/pricing', 0.75, 'monthly'),
32-
url('/blog', 0.70, 'weekly'),
33+
// ── Tier 2 — Marketing & discovery ────────────────────────────────────
34+
entry('/features', 0.88, 'weekly', D.week),
35+
entry('/models', 0.85, 'weekly', D.week),
36+
entry('/about', 0.80, 'monthly', D.month),
37+
entry('/soham', 0.80, 'monthly', D.month),
38+
entry('/pricing', 0.75, 'monthly', D.month),
39+
entry('/blog', 0.70, 'weekly', D.week),
3340

34-
// ── Support / legal ─────────────────────────────────────────────────────
35-
url('/contact', 0.65, 'monthly'),
36-
url('/support', 0.65, 'weekly'),
37-
url('/privacy', 0.50, 'monthly'),
38-
url('/terms', 0.50, 'monthly'),
41+
// ── Tier 3 — Support & legal ───────────────────────────────────────────
42+
entry('/contact', 0.65, 'monthly', D.month),
43+
entry('/support', 0.65, 'monthly', D.month),
44+
entry('/privacy', 0.50, 'yearly', D.quarter),
45+
entry('/terms', 0.50, 'yearly', D.quarter),
3946

40-
// ── Documentation index ─────────────────────────────────────────────────
41-
url('/documentation', 0.90, 'weekly'),
47+
// ── Documentation index ─────────────────────────────────────────────
48+
entry('/documentation', 0.90, 'weekly', D.week),
4249

43-
// ── Getting Started ─────────────────────────────────────────────────────
44-
url('/documentation/quick-start', 0.85, 'weekly'),
45-
url('/documentation/installation', 0.85, 'weekly'),
46-
url('/documentation/pwa', 0.85, 'weekly'), // ← new
50+
// ── Documentation — Getting Started ───────────────────────────────────
51+
entry('/documentation/quick-start', 0.85, 'weekly', D.week),
52+
entry('/documentation/installation', 0.85, 'weekly', D.week),
53+
entry('/documentation/pwa', 0.82, 'weekly', D.week),
4754

48-
// ── Features ────────────────────────────────────────────────────────────
49-
url('/documentation/chat', 0.80, 'weekly'),
50-
url('/documentation/ai-models', 0.80, 'weekly'),
51-
url('/documentation/commands', 0.78, 'weekly'),
52-
url('/documentation/image-generation', 0.78, 'weekly'),
53-
url('/documentation/math-solver', 0.75, 'weekly'),
54-
url('/documentation/pdf-analysis', 0.75, 'weekly'),
55-
url('/documentation/web-search', 0.75, 'weekly'),
56-
url('/documentation/smart-routing', 0.75, 'weekly'),
57-
url('/documentation/jarvis-mode', 0.72, 'weekly'),
58-
url('/documentation/smart-notes', 0.70, 'weekly'),
59-
url('/documentation/code-analysis', 0.70, 'weekly'),
55+
// ── Documentation — Features ──────────────────────────────────────────
56+
entry('/documentation/chat', 0.80, 'weekly', D.week),
57+
entry('/documentation/ai-models', 0.80, 'weekly', D.week),
58+
entry('/documentation/commands', 0.78, 'weekly', D.week),
59+
entry('/documentation/image-generation', 0.78, 'weekly', D.week),
60+
entry('/documentation/web-search', 0.76, 'weekly', D.week),
61+
entry('/documentation/math-solver', 0.75, 'weekly', D.week),
62+
entry('/documentation/pdf-analysis', 0.75, 'weekly', D.week),
63+
entry('/documentation/smart-routing', 0.73, 'weekly', D.week),
64+
entry('/documentation/jarvis-mode', 0.70, 'monthly', D.month),
65+
entry('/documentation/smart-notes', 0.70, 'monthly', D.month),
66+
entry('/documentation/code-analysis', 0.70, 'monthly', D.month),
6067

61-
// ── Configuration ───────────────────────────────────────────────────────
62-
url('/documentation/settings', 0.72, 'weekly'),
63-
url('/documentation/personalization', 0.70, 'weekly'),
64-
url('/documentation/security', 0.68, 'monthly'),
68+
// ── Documentation — Configuration ─────────────────────────────────────
69+
entry('/documentation/settings', 0.72, 'weekly', D.week),
70+
entry('/documentation/personalization', 0.70, 'monthly', D.month),
71+
entry('/documentation/security', 0.68, 'monthly', D.month),
6572

66-
// ── Reference ───────────────────────────────────────────────────────────
67-
url('/documentation/api-reference', 0.75, 'weekly'),
68-
url('/documentation/api', 0.70, 'weekly'),
69-
url('/documentation/faq', 0.72, 'weekly'),
73+
// ── Documentation — Reference ─────────────────────────────────────────
74+
entry('/documentation/api-reference', 0.75, 'weekly', D.week),
75+
entry('/documentation/api', 0.72, 'weekly', D.week),
76+
entry('/documentation/faq', 0.75, 'weekly', D.week),
7077
];
7178
}

0 commit comments

Comments
 (0)