You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/AI_QUICK_START.md
+77-44Lines changed: 77 additions & 44 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,11 +36,8 @@ Before you begin, ensure you have the following:
36
36
## 2. What is an AI Agent?
37
37
38
38
For this workflow, an "AI agent" is a terminal-based AI assistant capable of executing local shell commands.
39
-
This is different from web-based chat interfaces (like ChatGPT or the Gemini web UI) because it allows the AI
40
-
to directly interact with your codebase, run scripts, and access the local knowledge base.
41
39
42
-
You can use any CLI-based AI agent that you are comfortable with. The following sections will show you how to set up
43
-
the knowledge base, and then provide an optional guide for configuring the Gemini CLI as one possible agent.
40
+
**Current Support:** This guide focuses on the Gemini CLI setup. Support forother agents (Claude Code, Aider, etc.) is planned. The core infrastructure (MCP servers, knowledge base) is agent-agnostic, but the configuration filesin`.gemini/` are Gemini-specific.
44
41
45
42
## 3. Setup the AI Environment (Required)
46
43
@@ -50,7 +47,7 @@ Gemini model, so a Gemini API key is required regardless of which AI agent you c
50
47
### A Note on Cost
51
48
52
49
This entire process uses the free tier of the Google Gemini API. The free tier is generous and more than sufficient for
53
-
this development workflow, typically allowing up to **60 queries per minute**for the embedding model used here.
50
+
this development workflow, typically allowing up to 60 queries per minute for the embedding model used here.
54
51
You can check your specific limits in the Google AI Studio.
55
52
56
53
### Step 3.1: Obtain a Gemini API Key
@@ -73,64 +70,100 @@ The API key authenticates your requests to Google's Gemini models.
73
70
```
74
71
This file is already listed in `.gitignore` to prevent you from accidentally committing your key.
75
72
76
-
### Step 3.3: Start the AI Servers
73
+
### Step 3.3: Initial Knowledge Base Setup
77
74
78
-
The AI tooling now leverages Model Context Protocol (MCP) servers that automatically manage the ChromaDB instances for both the knowledge base and agent memories. You no longer need to manually build the knowledge base or initialize the memory collection.
75
+
The first time you use the AI tooling, the knowledge base needs to be embedded. The MCP servers will handle this automatically when launched by your AI agent (e.g., Gemini CLI).
79
76
80
-
1. **Start the AI Servers**: In a new terminal window, run the following command. This will start all necessary MCP servers.
81
-
```bash
82
-
npm run ai:server-all
83
-
```
84
-
Keep this process running in the background. The servers will automatically create and embed the knowledge base, and manage the memory core.
77
+
**Optional - For Debugging Only**: If you want to manually verify the knowledge base embedding or troubleshoot ChromaDB issues, you can run:
78
+
```bash
79
+
npm run ai:server-all
80
+
```
81
+
This will start the servers directly so you can see their logs. However, this is **not required** for normal usage - your AI agent will start them automatically.
82
+
83
+
**Subsequent Sessions:**
84
+
- The MCP servers are automatically started by the Gemini CLI when you run `gemini`
85
+
- The knowledge base is cached - full embedding only runs on first launch
86
+
- File changes are detected and incrementally updated
87
+
- **You do not need to manually start servers** unless debugging
88
+
89
+
### Step 3.4: Verify the Setup
90
+
91
+
After starting the servers, the knowledge base will be embedded automatically. This process takes 2-5 minutes on the first run (depending on your hardware).
85
92
86
-
**Note**: If you wish to run the ChromaDB instances in separate terminals to view their logs or errors, you can still use `npm run ai:server` (for the knowledge base) and `npm run ai:server-memory` (for the memory core) individually. However, this is optional, as `npm run ai:server-all` handles everything.
93
+
**How to verify it's ready:**
94
+
The agent will perform a healthcheck on the `neo.mjs-knowledge-base` server during its initialization. If the healthcheck is successful, you can assume the embedding is complete.
87
95
88
-
## 4. Configuring an Agent (Optional Example: Gemini CLI)
96
+
**Troubleshooting:** If you see errors about missing API keys, verify your `.env` file contains a valid `GEMINI_API_KEY`.
89
97
90
-
Once the AI servers are running, you can interact with them using any terminal-based AI agent. This is an optional step showing how to install the Gemini CLI.
98
+
## 4. Installing the Gemini CLI Agent
91
99
100
+
To interact with the AI servers, install the Gemini CLI:
92
101
```bash
93
102
npm i -g @google/gemini-cli
94
103
```
95
104
96
-
## 5. The AI-Native Workflow: A Partnership
105
+
## 5. Understanding the Configuration Files
97
106
98
-
The goal of this system is to create a powerful partnership between you and the AI agent. To facilitate this, we use a system of configuration and guide files that automate the agent's setup and define its behavior.
107
+
The agent's behavior is controlled by several configuration files:
99
108
100
-
### Agent Configuration and Behavior
109
+
### Core Configuration (`.gemini/` directory)
110
+
- **`settings.json`**: Defines context files and MCP servers for the session
111
+
- **`GEMINI.md`**: Provides initialization checkpoint for the agent
101
112
102
-
The agent's behavior is primarily controlled by the following files:
- **`AGENTS.md`**: Per-turn operational mandates (automatically loaded via settings.json)
103
116
104
-
- **`.gemini/settings.json`**: This file is the entry point for the agent's configuration. It tells the agent which files to load into its context at the beginning of a session, and also defines the Model Context Protocol (MCP) servers to be used for the session.
105
-
- **`.gemini/GEMINI.md`**: This file provides the initial instructions for the agent, including the mandatory pre-response check to ensure it has completed the session initialization.
106
-
- **`AGENTS_STARTUP.md`**: This guide contains the detailed, step-by-step instructions for the agent's session initialization. It ensures the agent has a foundational understanding of the Neo.mjs architecture before it begins any task.
107
-
- **`AGENTS.md`**: This is the rulebook for the **AI**. It contains the critical "per-turn" instructions, protocols, and constraints the agent must follow to be an effective contributor. This includes the "Ticket-First" gate and the Memory Core protocol.
108
-
- **`WORKING_WITH_AGENTS.md`**: This is the playbook for **you**, the human developer. It provides essential strategies for guiding the agent, handling common issues, and maximizing its performance.
117
+
### Developer Guide (Repository root)
118
+
- **`WORKING_WITH_AGENTS.md`**: Your playbook for working effectively with AI agents
109
119
110
-
**Note on Agent Specificity**: The `.gemini/settings.json` and `.gemini/GEMINI.md` files are specific to the Gemini CLI. Other AI agents may use different configuration files or methods to achieve similar results.
120
+
**Important:** Before starting your first session, read [WORKING_WITH_AGENTS.md]() to understand how to guide the agent effectively.
111
121
112
-
Your first step before starting a session should be to familiarize yourself with the `WORKING_WITH_AGENTS.md` guide.
122
+
## 6. Your First Agent Session
113
123
114
-
### The Automated Workflow in Action
124
+
Once the Gemini CLI is installed:
115
125
116
-
Here’s how the intended workflow looks with the automated setup:
126
+
1. **Start the agent** from the repository root:
127
+
```bash
128
+
gemini
129
+
```
117
130
118
-
1. **Start your AI Agent**: From the repo root, launch your AI agent of choice (e.g., Gemini CLI).
119
-
```bash
120
-
gemini
121
-
```
122
-
2. **Give a High-Level Prompt**: The agent will automatically perform its initialization based on the configuration files. Once it's ready, you can give it a goal.
123
-
>**Your Prompt:**"Explain the Neo.mjs two-tier reactivity model and provide a simple code example."
131
+
2. **Give a high-level prompt**, for example:
132
+
> "Explain the Neo.mjs two-tier reactivity model with a code example."
133
+
134
+
After you provide the first prompt, the agent will perform its initialization sequence:
- Synthesizes an accurate answer from the codebase
144
+
145
+
This is the key difference: you delegate *research* to the agent, making it a true partner that can autonomously navigate and understand your codebase.
146
+
147
+
## 7. Common Troubleshooting
148
+
149
+
### MCP Server Issues
150
+
- **"Connection refused" errors**: Ensure `npm run ai:server-all` is running
151
+
- **Empty query results**: The knowledge base may still be embedding - waitfor completion
152
+
- **ChromaDB errors on Windows**: Verify you're running in WSL (see Prerequisites)
124
153
125
-
3. **The AI Takes Over**: An agent following the `AGENTS.md` protocol will then:
126
-
***Formulate a query**: It will determine that "reactivity" is the key concept.
127
-
***Execute the tool**: It will use the `neo.mjs-knowledge-base` MCP server's `query_documents` tool to query the knowledge base for "reactivity".
128
-
* **Synthesize the answer**: After getting the paths to the most relevant guides and source files, it will read them and use that fresh, accurate context to generate a comprehensive explanation.
154
+
### API Key Issues
155
+
- **Authentication errors**: Regenerate your key at Google AI Studio
156
+
- **Rate limit errors**: You've exceeded the free tier quota - wait or upgrade
157
+
- **"Invalid API key" errors**: Check `.env` file has correct format: `GEMINI_API_KEY="your-key-here"`
129
158
130
-
This is the crucial difference: you are delegating the *research* task to the AI, making it a true partner that can autonomously navigate and understand your codebase.
159
+
### Agent Behavior Issues
160
+
- **Agent doesn't initialize**: Check that `.gemini/GEMINI.md` and `AGENTS_STARTUP.md` exist
161
+
- **Agent doesn't save memories**: Memory Core may not be running. Ask the agent to perform a healthcheck on the `neo.mjs-memory-core` MCP server. If it's unhealthy, you can ask the agent to start the database or use other memory-core tools.
162
+
- **Agent makes incorrect assumptions**: It may be hallucinating - remind it to query the knowledge base
131
163
132
-
## 6. Common Troubleshooting
133
-
- **API Key Errors**: If queries fail with authentication issues, try regenerating the key in Google AI Studio or
134
-
check your usage quotas.
135
-
- **`gemini` Command Not Found**: If you installed the Gemini CLI but the command isn't found, ensure your system's
136
-
PATH includes the global npm binaries directory. You can find this directory by running `npm bin -g`.
164
+
### Installation Issues
165
+
- **`gemini` command not found**: Add npm global binaries to PATH
0 commit comments