Skip to content

Commit 51a4dc4

Browse files
committed
#7696 more polishing
1 parent c85e78e commit 51a4dc4

1 file changed

Lines changed: 77 additions & 44 deletions

File tree

.github/AI_QUICK_START.md

Lines changed: 77 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,8 @@ Before you begin, ensure you have the following:
3636
## 2. What is an AI Agent?
3737

3838
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.
4139

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 for other agents (Claude Code, Aider, etc.) is planned. The core infrastructure (MCP servers, knowledge base) is agent-agnostic, but the configuration files in `.gemini/` are Gemini-specific.
4441

4542
## 3. Setup the AI Environment (Required)
4643

@@ -50,7 +47,7 @@ Gemini model, so a Gemini API key is required regardless of which AI agent you c
5047
### A Note on Cost
5148

5249
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.
5451
You can check your specific limits in the Google AI Studio.
5552

5653
### Step 3.1: Obtain a Gemini API Key
@@ -73,64 +70,100 @@ The API key authenticates your requests to Google's Gemini models.
7370
```
7471
This file is already listed in `.gitignore` to prevent you from accidentally committing your key.
7572
76-
### Step 3.3: Start the AI Servers
73+
### Step 3.3: Initial Knowledge Base Setup
7774
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).
7976
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).
8592
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.
8795

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`.
8997

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
9199

100+
To interact with the AI servers, install the Gemini CLI:
92101
```bash
93102
npm i -g @google/gemini-cli
94103
```
95104

96-
## 5. The AI-Native Workflow: A Partnership
105+
## 5. Understanding the Configuration Files
97106

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:
99108
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
101112
102-
The agent's behavior is primarily controlled by the following files:
113+
### Agent Guidelines (Repository root)
114+
- **`AGENTS_STARTUP.md`**: Step-by-step session initialization instructions
115+
- **`AGENTS.md`**: Per-turn operational mandates (automatically loaded via settings.json)
103116
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
109119
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.
111121
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
113123
114-
### The Automated Workflow in Action
124+
Once the Gemini CLI is installed:
115125
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+
```
117130
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:
135+
- Read AGENTS_STARTUP.md
136+
- Load core Neo.mjs files (Neo.mjs, Base.mjs, CodebaseOverview.md)
137+
- Check the Memory Core status
138+
- Confirm it's ready
139+
140+
3. **The agent autonomously**:
141+
- Queries the knowledge base for "reactivity"
142+
- Reads relevant source files
143+
- 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 - wait for completion
152+
- **ChromaDB errors on Windows**: Verify you're running in WSL (see Prerequisites)
124153
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"`
129158

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
131163
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
166+
```bash
167+
npm bin -g
168+
# Add the output directory to your PATH
169+
```

0 commit comments

Comments
 (0)