|
| 1 | +--- |
| 2 | +layout: '@/layouts/DocsLayout.astro' |
| 3 | +title: "Google Gemini" |
| 4 | +description: "Set up Basic Memory with Google Gemini for persistent development knowledge and enhanced AI sessions" |
| 5 | +--- |
| 6 | + |
| 7 | +import { Card, CardGroup, Info, Warning, Note, Tip, Accordion, AccordionItem, Steps, Step, CodeGroup, CodeTab } from '@/components' |
| 8 | + |
| 9 | +Google Gemini provides native support for Basic Memory through the Model Context Protocol (MCP), enabling persistent context across AI sessions and building comprehensive knowledge bases. |
| 10 | + |
| 11 | +## Setup |
| 12 | + |
| 13 | +### Install Basic Memory cli |
| 14 | + |
| 15 | +```bash |
| 16 | +# Install Basic Memory |
| 17 | +uv tool install basic-memory |
| 18 | + |
| 19 | +# Or with pip |
| 20 | +pip install basic-memory |
| 21 | +``` |
| 22 | + |
| 23 | +### Configure Gemini |
| 24 | + |
| 25 | +Basic Memory works with Gemini through MCP. Install it with: |
| 26 | + |
| 27 | +```bash |
| 28 | +gemini mcp add basic-memory bash -c "uvx basic-memory mcp" |
| 29 | +``` |
| 30 | + |
| 31 | +<Tip> |
| 32 | +If you want to use a specific Basic Memory project, modify the command like so: |
| 33 | +```bash |
| 34 | +gemini mcp add basic-memory bash -c "uvx basic-memory mcp --project your-project-name" |
| 35 | +``` |
| 36 | + |
| 37 | +You can also install it globally for your profile with: |
| 38 | +```bash |
| 39 | +gemini mcp add -s user basic-memory bash -c "uvx basic-memory mcp" |
| 40 | +``` |
| 41 | +</Tip> |
| 42 | + |
| 43 | +### Verify Installation |
| 44 | + |
| 45 | +Check that Basic Memory is configured correctly: |
| 46 | + |
| 47 | +```bash |
| 48 | +gemini mcp list |
| 49 | +``` |
| 50 | + |
| 51 | +You should see `basic-memory` listed with the command `bash -c uvx basic-memory mcp` and a Connected status. |
| 52 | + |
| 53 | +## Quick Start |
| 54 | + |
| 55 | +Once configured, you can immediately start using Basic Memory in your workflow: |
| 56 | + |
| 57 | +``` |
| 58 | +You: "Create a note about our authentication strategy for the API" |
| 59 | +Gemini: I'll document the authentication strategy we discussed... |
| 60 | +[Creates structured note with technical details and rationale] |
| 61 | +
|
| 62 | +You: "Switch to my personal project" |
| 63 | +Gemini: [Changes context to personal project knowledge base] |
| 64 | +``` |
| 65 | + |
| 66 | +## MCP Integration Benefits |
| 67 | + |
| 68 | +Gemini's native MCP support provides: |
| 69 | + |
| 70 | +- **Automatic tool access** - No manual setup required |
| 71 | +- **Project-aware context** - Maintains separate knowledge bases per project |
| 72 | +- **Real-time sync** - Changes are immediately available |
| 73 | +- **Persistent memory** - Context survives between sessions |
| 74 | +- **Structured knowledge** - Uses Basic Memory's semantic format |
| 75 | + |
| 76 | +### Available Tools |
| 77 | + |
| 78 | +Through MCP, Gemini can access all Basic Memory functionality: |
| 79 | + |
| 80 | +- **write_note** - Create and update documentation |
| 81 | +- **read_note** - Access existing knowledge and context |
| 82 | +- **search_notes** - Find relevant information across projects |
| 83 | +- **edit_note** - Update documentation incrementally |
| 84 | +- **recent_activity** - Check what you've been working on |
| 85 | +- **project management** - Switch between different knowledge bases |
| 86 | +- **build_context** - Load conversation context from memory:// URLs |
| 87 | + |
| 88 | +## Integration with Development |
| 89 | + |
| 90 | +### Project Context |
| 91 | + |
| 92 | +Basic Memory maintains separate knowledge bases for different projects: |
| 93 | + |
| 94 | +``` |
| 95 | +You: "Switch to my work project" |
| 96 | +Gemini: [Loads work project context and knowledge] |
| 97 | +
|
| 98 | +You: "Based on our API design notes, what's the next step?" |
| 99 | +Gemini: [References existing documentation to provide contextual guidance] |
| 100 | +``` |
| 101 | + |
| 102 | +## Troubleshooting |
| 103 | + |
| 104 | +### Common Issues |
| 105 | + |
| 106 | +<Accordion> |
| 107 | + <AccordionItem title="Gemini can't access Basic Memory"> |
| 108 | + **Solutions:** |
| 109 | + - Verify Basic Memory is installed: `basic-memory --version` |
| 110 | + - Check MCP server configuration: `gemini mcp list` |
| 111 | + - Reinstall if needed: `gemini mcp remove basic-memory` then `gemini mcp add basic-memory bash -c "uvx basic-memory mcp"` |
| 112 | + </AccordionItem> |
| 113 | + |
| 114 | + <AccordionItem title="Context not loading from memory:// URLs"> |
| 115 | + **Solutions:** |
| 116 | + - Confirm files exist in current project |
| 117 | + - Check memory:// URL syntax (e.g., `memory://folder/note`) |
| 118 | + - Verify sync is working: `basic-memory status` |
| 119 | + </AccordionItem> |
| 120 | + |
| 121 | + <AccordionItem title="Notes not updating"> |
| 122 | + **Solutions:** |
| 123 | + - Check file permissions in knowledge base directory |
| 124 | + - Check ~/.basic-memory for logs containing error messages |
| 125 | + - Report error messages to the Basic Memory team |
| 126 | + </AccordionItem> |
| 127 | +</Accordion> |
| 128 | + |
| 129 | +### Performance Tips |
| 130 | + |
| 131 | +- **Multiple projects**: Use separate Basic Memory projects for different use cases |
| 132 | +- **Organized structure**: Keep consistent folder organization across projects |
| 133 | +- **Regular cleanup**: Archive old projects to maintain performance |
| 134 | + |
| 135 | +## Alternative Usage |
| 136 | + |
| 137 | +If MCP isn't working, you can still use Basic Memory: |
| 138 | + |
| 139 | +<CardGroup cols={2}> |
| 140 | + <Card title="CLI Integration"> |
| 141 | + Use Basic Memory CLI tools from your terminal |
| 142 | + </Card> |
| 143 | + <Card title="File Editing"> |
| 144 | + Edit Basic Memory notes directly and sync manually |
| 145 | + </Card> |
| 146 | + <Card title="Manual Context"> |
| 147 | + Copy content from Basic Memory into conversations |
| 148 | + </Card> |
| 149 | + <Card title="Parallel Usage"> |
| 150 | + Use Claude Desktop or other MCP clients alongside Gemini. With Basic Memory they can see the same notes and share context. |
| 151 | + </Card> |
| 152 | +</CardGroup> |
| 153 | + |
| 154 | +## Next Steps |
| 155 | + |
| 156 | +<CardGroup cols={2}> |
| 157 | + <Card title="Project Documentation" href="/how-to/project-documentation"> |
| 158 | + Learn how to document your projects |
| 159 | + </Card> |
| 160 | + <Card title="Research & Learning" href="/how-to/research-learning"> |
| 161 | + Build knowledge from your sessions |
| 162 | + </Card> |
| 163 | + <Card title="CLI Reference" href="/guides/cli-reference"> |
| 164 | + Master Basic Memory command line tools |
| 165 | + </Card> |
| 166 | + <Card title="Knowledge Format" href="/guides/knowledge-format"> |
| 167 | + Structure effective documentation |
| 168 | + </Card> |
| 169 | +</CardGroup> |
0 commit comments