A technical look at how we designed Pocket Code's AI assistant: smart autocomplete, contextual chat, and 15 tools integrated with the app's modules.
Pocket Code's artificial intelligence isn't a generic chatbot glued to an editor. It's an integrated system that understands your project, your code, and the modules you're using. In this post, we'll tell you how we built it.
The AI system has three main layers:
Autocomplete works through the Language Server Protocol (LSP). When you type code, the editor sends context (current file, cursor position, open files) to the AI model, which returns completion suggestions.
What makes our autocomplete different:
The AI chat isn't a simple prompt-response. When you ask a question:
This means you can ask "what does this function do?" without having to copy and paste code.
This is the most powerful part. We've registered 15 tools that AI can invoke to interact directly with the app's modules:
| Tool | What it does |
|---|---|
create_file | Creates files in your project |
run_terminal_command | Executes commands in the integrated terminal |
query_database | Queries SQLite databases |
preview_layout | Previews layouts in the designer |
git_status | Checks Git status |
run_tests | Runs unit tests |
install_package | Installs dependencies |
read_file | Reads project files |
search_code | Searches the entire codebase |
refactor_symbol | Safely renames symbols |
When you tell the AI "create a ViewModel for the user list", it doesn't just generate code β it creates the file, places it in the correct folder, and updates the necessary imports.
All execution goes through strict validations:
Pocket Code works with multiple AI providers under a BYOK (bring-your-own-key) or OAuth login model through the official CLIs. Pocket Code is not an AI provider: every request goes directly from the device to the provider you pick, and usage is billed by the provider under their policy.
Users connect their account or API key in Settings > API Keys.
We're working on:
Pocket Code's AI isn't a bolted-on component β it's an integral part of the development experience. Every app module (terminal, database, designer, Git) is connected, and the AI can orchestrate them all.
You can see the complete development status in our status post.