Product: Jokalala AI Development Chat (/ai/chat)
HTML guide: /ai/chat/docs (rich in-app documentation)
Audience: Developers using the Enhanced Agent for secure coding, audits, and gated fixes
Last updated: 2026-08-03
Open the product: Launch AI Chat →
This guide explains how to use the Enhanced Agent end to end: attach project context, turn on tools, run security remediations, accept patches into VS Code or Cursor, and keep the cloud snapshot in sync—without giving the cloud agent write access to your disk.
Related technical docs: PRODUCT.md · TOOLS.md · REMEDIATION_ENGINE.md · IDE_BRIDGE.md · WEB_SEARCH.md · AI_INNOVATIONS_USER_GUIDE.md
Table of contents
- What the Enhanced Agent is
- Access and entry points
- Safety model (read this once)
- Quick start (10 minutes)
- Composer controls
- Project context and indexing
- Using Tools (repo-browsing agent)
- Security audit and remediation
- Accepting patches (IDE bridge)
- Keeping the snapshot fresh
- Web Search and CVE context
- Innovations UX (intent, branches, more)
- Providers, BYOK, and racing
- Shell proposals (opt-in)
- Keyboard shortcuts
- Recommended workflows
- Limits and practical tips
- Troubleshooting
- FAQ
- Glossary
1. What the Enhanced Agent is
The Enhanced Agent is Jokalala’s coding partner in the browser with optional tool calling against an indexed copy of your project. It is designed for:
| Goal | How the agent helps |
|---|---|
| Understand this codebase | Browse an indexed snapshot (list, read, grep, semantic search) |
| Find security issues | Scan attachments / analyzer findings + OWASP-oriented guidance |
| Propose production-ready fixes | Validated unified diffs you must Accept |
| Verify fixes before you apply | In-memory verify_remediation re-scan |
| Apply changes locally | Deep link into VS Code / Cursor with Confirm—not silent remote writes |
It is not a full autonomous local IDE agent (like Cursor Agent with unrestricted shell). The cloud side stays a read-only sandbox. Your machine applies changes only after you approve them.
2. Access and entry points
| Route | Who | Notes |
|---|---|---|
/ai/chat | Signed-in users with ai.agents.use | Primary Enhanced Agent surface |
/ai/dev-assistant | Public freemium | Limited trial; not the full gated Dev Chat |
| VS Code / Cursor extension | Same account API key (jkl_…) | Apply patches, optional delta sync, approved shell |
Deep links
- Development assistant:
/ai/chat?agent=development_assistant - Analytics agent:
/ai/chat?agent=analytics - Open with context from the extension/CLI:
/ai/chat?context=…(attached as chips)
Sign in on the web, then sign in from the extension (or set Jokalala: Set API Key) so Accept deep links can fetch proposals with the same user identity.
3. Safety model (read this once)
┌─────────────────────┐ ┌──────────────────────────┐
│ Browser Dev Chat │ read │ Redis project snapshot │
│ + Tools agent │ ──────► │ + proposals / findings │
└─────────┬───────────┘ └──────────────────────────┘
│ Accept (proposalId)
▼
┌─────────────────────┐ ┌──────────────────────────┐
│ VS Code / Cursor │ Confirm │ Your local workspace │
│ Jokalala extension │ ──────► │ (git-friendly edits) │
└─────────────────────┘ └──────────────────────────┘| Surface | Allowed | Not allowed |
|---|---|---|
| Cloud chat API | Read indexed files, store proposals, in-memory verify | Write your disk, run arbitrary shell on your PC |
| Browser Accept | Open IDE deep link + copy patch to clipboard | Apply without your IDE Confirm |
| Extension | Apply after Confirm; optional on-save sync of your saves | Silent remote execution |
| Shell tools | Off by default; Confirm + allowlist when enabled | Unrestricted shell |
Invariant: The server never writes workspace files. Patches are always gated.
4. Quick start (10 minutes)
- Open
/ai/chatand sign in. - Install / enable the Jokalala Code Analyzer extension in VS Code or Cursor.
- Set
jokalala.apiEndpoint(production HTTPS, or localhttp://localhost:3000/api/agents/dev-assistant) and API key. - In chat, click Project and upload a
.zipof your source (or use GitHub → Index folder when connected). - Turn on the composer Tools chip.
- Ask: “Audit auth for security issues and propose minimal fixes.”
- Watch tool cards (
grep_search,read_file, …). When a patch needs approval, click Accept. - In the IDE: review the diff → Apply on the Confirm dialog.
- Commit with your normal git workflow.
Optional: enable jokalala.ideBridge.deltaSync so local saves refresh the cloud snapshot without re-uploading a zip.
5. Composer controls
| Control | Purpose |
|---|---|
| Tools | Enables the repo-browsing / remediation agent (enableTools). When on, provider racing is skipped. |
| Search | Live web search + Sources citations (when configured). Security intents may auto-search. |
| Project | Attach a .zip; builds a durable Redis snapshot (default 32 full files; overflow up to 64 as signature stubs). |
| GitHub | Index a connected repo folder into the same snapshot. |
| @file | Mention / pick files into attached context for the turn. |
| Scan this | Run analysis on attached code; findings become chips; Tools auto-enable for remediations. |
| Continue | Resume after Stop or after the tool step budget is exhausted. |
| Stop | Abort the current stream / tool loop. |
Chips above the composer show attached context (files, project snapshot, scan findings). Remove chips when you want a clean turn.
6. Project context and indexing
Why indexing matters
On serverless hosting, the agent cannot see your live disk. It only sees:
- Files attached to the current turn, merged with
- Your durable project snapshot (
chat-projectin Redis), plus an optional code vector index for semantic search
How to index
| Method | Best for | Result |
|---|---|---|
| Project zip | Local repos, monorepo slices | Snapshot labeled with zip name |
| GitHub → Index folder | Hosted folders you already connected | Recursive folder index under caps |
| @file / uploads | One-off files | Turn-level context; prefer snapshot for multi-turn |
| Delta sync (extension) | After Accept / local edits | Updates one path in Redis without full re-zip |
Caps and exclusions
- Default max full files: 32 (env:
CHAT_PROJECT_SNAPSHOT_MAX_FILES/NEXT_PUBLIC_CHAT_PROJECT_MAX_FILES). - Hard max entries: 64 — overflow paths become signature stubs (
stub: true); Hydrate from IDE upgrades them. - Large files are truncated (on the order of ~100k characters per file).
- Build artifacts and dependency trees should stay out of the zip (
node_modules,.next,dist, lockfiles, binaries). - If the agent needs a path outside the snapshot, click Hydrate from IDE on the tool card (extension pushes that file via delta).
After reload
Snapshots are user-scoped and durable (typically ~7 days TTL). Reloading chat still hydrates the last indexed project when the turn has no fresh attachments.
7. Using Tools (repo-browsing agent)
Turn Tools on
Click the Tools chip until it shows as on, or rely on Scan this (which turns Tools on for remediations).
You will see live tool cards as the agent works (running → done / needs approval).
Browse tools (read-only)
| Tool | What you’ll see in practice |
|---|---|
list_files | Inventory of paths in the snapshot |
directory_tree | Compact tree for orientation |
read_file | File contents or a line range |
grep_search | Regex / literal hits across the corpus |
semantic_code_search | Embedding-based “find relevant chunks” |
Guidance helpers
get_security_guidance— OWASP-oriented playbooksformat_unified_diff_hint— how to shape patches- Attachment helpers — list / read turn attachments
Write tools (gated)
| Tool | Behavior |
|---|---|
propose_unified_diff | Validates and stores a unified diff → Needs approval |
apply_patch | Requests approval for a stored or inline diff — still no server write |
Approval cards show Accept / Reject. Accept opens the IDE bridge (and copies the patch as clipboard fallback).
Step budget
Default max tool steps: 12 (env CHAT_TOOLS_MAX_STEPS, max 20). When the budget is hit, use Continue to resume with the same context.
8. Security audit and remediation
Structured remediation loop
Scan this / analyzer
→ findings stored (~7 days)
→ amber Scan chips in chat
Ask: “Fix the critical issues”
→ list_findings
→ remediate_finding → proposalId
→ verify_remediation (in memory) → cleared | regressed
→ Accept → IDE Confirm| Tool | Role |
|---|---|
list_findings | Browse stored SAST findings (severity / status) |
remediate_finding | Hybrid / RAG fix → validated unified diff proposal |
verify_remediation | Apply patch in memory + targeted re-analyze |
MVP finding classes (JS/TS)
Injection, XSS, command injection, path traversal, SSRF, secrets, weak crypto, authz gaps—aligned with what the analyzer already emits. Other languages improve over time; free-hand propose_unified_diff remains available when templates don’t cover a case.
“Fix with Chat”
From analyzer remediations in the product family, Fix with Chat opens Dev Chat with finding context so the agent can jump straight into remediate_finding.
Good prompts
- “Audit the attached auth module for OWASP Top 10 issues; propose minimal diffs.”
- “Fix the critical Scan findings and verify each remediation.”
- “Explain finding X, then propose a production-ready patch only for that path.”
Prefer minimal, validated diffs over large rewrites—the agent is steered that way in the system prompt.
9. Accepting patches (IDE bridge)
Happy path (recommended)
- Tool card shows Needs approval.
- Click Accept.
- Browser opens
vscode:///cursor://…/apply-patch?proposalId=…and also copies the full patch to the clipboard. - Extension fetches
/api/llm/proposals/:idwith your API key. - Native diff preview opens for the first file.
- Confirm Apply →
WorkspaceEditupdates your workspace. - Review in Source Control and commit.
Fallback (clipboard)
If the deep link doesn’t open the IDE:
- Accept still copies the patch.
- Command Palette → Jokalala: Apply Patch from Clipboard.
- Choose Apply to workspace (WorkspaceEdit) (or open /
git apply/ insert at cursor).
Requirements
- Extension installed and activated (
onUrifor deep links). - Valid API key for the same user who created the proposal in chat.
- Correct
jokalala.apiEndpoint(HTTPS in production; localhost HTTP allowed for local Next.js). - A folder workspace open in the IDE.
Optional local verify
Settings jokalala.ideBridge.localVerify + jokalala.shellTools.enabled offer an allowlisted verify command (e.g. pnpm test / pnpm lint) after a successful apply. On failure, choose Send to Chat — the extension posts stderr to Redis and opens /ai/chat?verifyFeedback=<id> with the revise prompt prefilled (clipboard fallback if the API fails).
10. Keeping the snapshot fresh
After Accept or local edits, the Redis snapshot can go stale.
| Approach | How |
|---|---|
| Full re-index | Upload a new Project zip or re-run GitHub index |
| Delta sync (opt-in) | Extension setting jokalala.ideBridge.deltaSync → on save, POST /api/llm/index/delta for that path |
| Manual hydrate | Accept Hydrate from IDE on a read_file miss, or POST delta upsert for a path |
Delta sync skips node_modules, .git, .next, dist, binaries, and oversized files. New paths can be added until the file cap is reached.
11. Web Search and CVE context
| Feature | How to use |
|---|---|
| Search chip | Force live web grounding; Sources appear under the reply |
| Auto-search | Security / CVE-style intents may trigger search when enabled |
| CVE RAG | When CVE_ENABLED, security answers can include CVE neighbors |
Search fails open: if keys are missing or the provider errors, the model still answers from training data / attached code. Details: WEB_SEARCH.md.
12. Innovations UX (intent, branches, more)
These ship behind EnhancedChatWrapper (on unless NEXT_PUBLIC_ENABLE_CHAT_INNOVATIONS=false):
| Feature | Default | What you get |
|---|---|---|
| Intent prediction | On | Badges + quick actions as you type |
| Proactive suggestions | On | ⌘J / Ctrl+J panel |
| Conversation branching | On | Explore alternate replies; Redis-persisted |
| Inline code editing | On | Edit assistant multi-line blocks in place |
| Provider racing | Off | Opt-in Auto race (skipped when Tools is on) |
| Voice commands | Off | Opt-in |
Full walkthrough: AI_INNOVATIONS_USER_GUIDE.md.
Also available in the sidebar: folders, tags, global search (⌘K), saved / team prompts, share (public or private email ACL).
13. Providers, BYOK, and racing
- Auto routes across configured providers (OpenAI, DeepSeek, Claude, Gemini, …).
- BYOK in chat settings: browser-supplied keys for the request only—not stored server-side.
- Ollama for local models when configured.
- Racing (
NEXT_PUBLIC_AI_RACING=true): race providers on Auto; disabled while Tools is on so the tool loop stays coherent.
14. Shell proposals (opt-in)
Cloud run_command never executes on the server. When CHAT_SHELL_TOOLS_ENABLED=true and the extension has jokalala.shellTools.enabled:
- Agent proposes a command → Needs approval.
- Accept copies a JSON payload (or use Jokalala: Run Approved Command).
- Extension validates against allowlist / deny patterns → Confirm → terminal.
Keep this off unless you need it. Prefer local verify after patch apply for most workflows.
15. Keyboard shortcuts
| Shortcut | Action |
|---|---|
| ⌘K / Ctrl+K | Global conversation search |
| ⌘J / Ctrl+J | Innovations / suggestions panel |
| ⌘⇧B / Ctrl+Shift+B | Zen mode (when available) |
| ⌘F / Ctrl+F | In-thread message search |
16. Recommended workflows
A. First-time security pass on a small service
- Zip
src/(excludenode_modules). - Project → Tools on.
- “Map the auth and input boundaries, then list likely OWASP issues with file:line.”
- “Propose minimal patches for critical and high only.”
- Accept → IDE Apply → run tests locally → commit.
B. Analyzer → fix loop
- Attach vulnerable file(s) → Scan this.
- “Fix the critical Scan findings and verify remediations.”
- Confirm
verify_remediationreports cleared. - Accept each proposal; enable delta sync if you continue chatting.
C. Explain-then-patch
- “Explain how session tokens are validated in the snapshot.” (browse tools)
- “Propose a diff that enforces constant-time compare on the secret path only.”
- Review the proposal carefully before Accept.
D. Grounded research
- Turn on Search.
- “Summarize current guidance for fixing CWE-89 in Node/pg with citations.”
- Apply guidance to your files with Tools on and a snapshot attached.
17. Limits and practical tips
| Topic | Guidance |
|---|---|
| File cap | Prefer a focused zip (one package / service) over the entire monorepo |
| Stale context | Re-index or enable delta sync after large local edits |
| Tool budget | Use Continue or ask a narrower follow-up |
| Diff quality | Ask for “minimal unified diff”; Reject noisy proposals and refine the prompt |
| Secrets | Never paste production secrets into chat; scan findings for leaked keys |
| Git | Treat Accept like your own edit—review the diff, run tests, commit deliberately |
| Mobile | Chat works on mobile; IDE Accept is a desktop/extension flow |
18. Troubleshooting
| Symptom | Likely cause | What to try |
|---|---|---|
| Tools do nothing useful | No snapshot / empty attachments | Use Project or attach files; confirm Code RAG env is on for your deployment |
| Agent invents paths | Corpus missing that file | Re-index; raise file cap; delta-upsert the path |
| Accept doesn’t open IDE | Extension missing / URI blocked | Install extension; allow protocol handler; use clipboard fallback |
| Proposal 401 / 404 in IDE | Wrong API key or expired proposal (~1h TTL) | Re-sign-in extension; Accept again soon after propose |
| Diff doesn’t apply | Workspace path mismatch / hunk drift | Open the correct folder root; re-generate patch from current snapshot |
| Snapshot feels stale | Local edits not synced | Enable ideBridge.deltaSync or re-upload zip |
| Search has no Sources | Keys / CSE API not configured | See WEB_SEARCH.md; fails open without Sources |
| Racing + Tools | Racing is skipped when Tools is on | Expected—turn Tools off only for non-agent races |
19. FAQ
Does the agent see my whole machine?
No. Only the indexed snapshot, turn attachments, and what you explicitly sync via delta.
Can it delete files?
Cloud: no. Extension apply currently does not support delete hunks in the WorkspaceEdit path.
Is Accept irreversible?
No. Changes land as normal editor/git edits. Revert with undo or git checkout / restore.
Why clipboard and deep link?
Deep link is the fast path; clipboard keeps you unblocked if the OS blocks custom URIs.
Do I need Redis?
Production deployments use Redis for snapshots, proposals, findings, and memory. Without it, features fail open or use short-lived fallbacks—dogfood with a working Redis for reliable multi-turn agency.
Freemium vs /ai/chat?
Full Enhanced Agent workflows (tools + snapshot + gated Accept) are aimed at authenticated /ai/chat. Freemium is a lighter entry path.
20. Glossary
| Term | Meaning |
|---|---|
| Enhanced Agent | Dev Chat with innovations UX + optional tool-calling agency |
| Snapshot | User-scoped Redis copy of indexed project files |
| Code RAG | Chunk + embed retrieval over attachments / snapshot |
| Proposal | Stored validated unified diff (proposalId) awaiting Accept |
| IDE bridge | Deep link + extension path from Accept → Confirm → WorkspaceEdit |
| Delta sync | On-save upload of a single file into the snapshot |
| Verify remediation | In-memory patch + analyzer re-scan before you apply locally |
| Zero-trust (local) | Cloud cannot write or execute on your workstation |
Appendix A — Operator checklist (admins)
CHAT_TOOLS_ENABLED="true"
NEXT_PUBLIC_CHAT_TOOLS="true"
CHAT_TOOLS_MAX_STEPS="12"
CHAT_CODE_RAG_ENABLED="true"
NEXT_PUBLIC_CHAT_CODE_RAG="true"
# CHAT_WRITE_TOOLS_ENABLED="false" # only to disable gated patches
# CHAT_SHELL_TOOLS_ENABLED="true" # optional
# REMEDIATION_ENGINE_ENABLED="false" # opt-out structured remediations
WEB_SEARCH_ENABLED="true" # optional
CVE_ENABLED="true" # optionalExtension (user settings):
jokalala.apiEndpoint- API key via Jokalala: Set API Key
jokalala.ideBridge.deltaSync(opt-in)jokalala.ideBridge.localVerify(opt-in)jokalala.shellTools.enabled(opt-in)
Smoke: pnpm dogfood:ide-bridge (see DOGFOOD.md).
Appendix B — Document map
| Doc | Audience |
|---|---|
| This guide | End users of the Enhanced Agent |
| AI_INNOVATIONS_USER_GUIDE.md | Intent, branching, racing, voice, inline edit |
| TOOLS.md | Tool list + threat model (eng) |
| REMEDIATION_ENGINE.md | Finding → fix → verify engine |
| IDE_BRIDGE.md | URI apply, delta, local verify |
| PRODUCT.md | Auth, APIs, feature defaults |
| DOGFOOD.md | QA checklist |