"use client"; import { useState, useEffect } from "react"; import { apiCall } from "@/lib/api"; import { Key, Activity, Search, Cpu, Hexagon, ChevronRight, ChevronDown, ArrowRight } from "lucide-react"; // ── Steps ────────────────────────────────────────────────────────────────────── const STEPS = [ { id: "keys", Icon: Key, title: "Get your API Key", section: "API Keys", description: "Go to API Keys in the sidebar. Generate your first key — attach it as the Authorization header on every request.", code: `curl -H "Authorization: Bearer YOUR_KEY" \\ https://spy9191-chronos-api-backend.hf.space/health`, }, { id: "ingest", Icon: Activity, title: "Ingest your first event", section: "Ingest Events", description: "Send raw text. Smriti extracts Subject-Verb-Object tuples and stores them with timestamps automatically.", code: `POST /ingest { "source_id": "my-app", "events": [{"text": "Acme Corp signed a $50k contract"}] }`, }, { id: "query", Icon: Search, title: "Query your memory", section: "Query Memory", description: "Ask natural-language questions. Smriti runs hybrid temporal + semantic search and returns ranked results.", code: `POST /query { "query": "What happened with Acme Corp?" }`, }, { id: "agent", Icon: Cpu, title: "Run an Agent", section: "Agent Chat", description: "A LangGraph agent with your entire memory as context. Ask complex questions or trigger tools — it reasons across time.", code: `POST /agent/run { "prompt": "Summarise all Q2 deals and flag any risks" }`, }, { id: "connect", Icon: Hexagon, title: "Connect a tool", section: "Connect Tool", description: "Register SaaS tools (Stripe, Notion, CRM). The Agent calls them mid-conversation and stores results as new events.", code: `POST /connectors/register { "name": "Stripe", "base_url": "https://api.stripe.com", "endpoints": [...] }`, }, ]; const ACTIONS = [ { id: "ingest", Icon: Activity, label: "Ingest an Event", sub: "Send text → Smriti stores it as structured memory" }, { id: "query", Icon: Search, label: "Query Memory", sub: "Ask a question → get ranked results across all events" }, { id: "agent", Icon: Cpu, label: "Run Agent", sub: "Let the AI reason across your full memory context" }, ]; function QuickStart() { const [open, setOpen] = useState(false); const [openStep, setOpenStep] = useState(null); const [done, setDone] = useState>(new Set()); const toggleDone = (id: string, e: React.MouseEvent | React.KeyboardEvent) => { e.stopPropagation(); setDone((prev) => { const next = new Set(prev); next.has(id) ? next.delete(id) : next.add(id); return next; }); }; const pct = Math.round((done.size / STEPS.length) * 100); return (
{open && (
{STEPS.map((step) => { const isOpen = openStep === step.id; const isDone = done.has(step.id); const { Icon } = step; return (
{isOpen && (

{step.description}

{step.code}
)}
); })}
)}
); } export function Overview({ apiKey, onNavigate }: { apiKey: string; onNavigate?: (page: string) => void }) { const [health, setHealth] = useState(null); const [error, setError] = useState(""); useEffect(() => { async function fetchHealth() { try { const data = await apiCall("GET", "/health", apiKey); setHealth(data); } catch (e: any) { setError(e.message); } } fetchHealth(); }, [apiKey]); return (
{/* Header */}

Overview

Smriti by Kaal the Absolute.

{/* No API key */} {!apiKey && (
No API key set — enter yours to connect Smriti
)} {/* Stats — 2-col on mobile, 4-col on desktop */} {error ? (
⚠ {error}
) : (
{health ? (health.stores?.postgres_events || 0).toLocaleString() : }
Events
{health ? (health.stores?.pgvector_embeddings || 0).toLocaleString() : }
Embeddings
{health ? "Online" : "…"}
Status
120B
AI Engine
)} {/* Quick Start */} {/* Quick Actions — 1-col on mobile, 3-col on desktop */}

Jump to

{ACTIONS.map(({ id, Icon, label, sub }) => ( ))}
); }