Elffuss BraidHub

kikocis/continue public

937b30c7b45d · 5.9 KiBRawPermalink
1---
2title: How to make your agent aware of codebases and documentation
3description: Learn how to give your AI agent access to codebases and documentation for more context-aware assistance
4keywords: [agent, codebase, documentation, MCP, context, RAG, tools]
5---
6
7# How to make your agent aware of codebases and documentation
8
9AI coding agents work best when they understand the context of your project. This guide shows you how to give your agent access to codebases and documentation, making it more helpful and accurate.
10
11## Make your agent aware of your open codebase
12
13When your agent understands your current codebase, it can provide more relevant suggestions and answers.
14
15### Let your agent explore the codebase using tools
16
17Your agent can use built-in tools to navigate and understand your code:
18
191. **File exploration tools**: The agent can read files, search for patterns, and understand project structure
202. **Code search**: Use search to find relevant code snippets
213. **Git integration**: Access commit history and understand code evolution
22
23### Create rules to help the agent understand your codebase
24
25Rules guide your agent's behavior and understanding. Place markdown files in `.continue/rules` in your project to provide context:
26
27```markdown
28# Project Architecture
29
30This is a React application with:
31- Components in `/src/components`
32- API routes in `/src/api`
33- State management using Redux in `/src/store`
34
35## Coding Standards
36- Use TypeScript for all new files
37- Follow the existing naming conventions
38- Write tests for all new features
39```
40
41<Tip>
42 Place rules files at different levels of your project hierarchy to scope when they trigger
43</Tip>
44
45Learn more about [rules configuration](/customize/deep-dives/rules).
46
47## Make your agent aware of other codebases
48
49Sometimes you need your agent to understand code beyond your current project.
50
51### Public codebases
52
53For open-source projects and public repositories, you have several options:
54
55#### Rules with hyperlinks
56
57Create rules that point to external codebases:
58
59```markdown
60# External Dependencies
61
62Our authentication system is based on:
63- [Auth.js documentation](https://authjs.dev/)
64- [Example implementation](https://github.com/nextauthjs/next-auth-example)
65
66When implementing auth features, reference these patterns.
67```
68
69#### GitHub and GitLab CLIs
70
71Enable `gh` or `glab` CLI access for your agent to interact with repositories.
72
73Add rules to guide CLI usage:
74
75```markdown
76# Repository Access
77
78You can use the `gh` CLI to:
79- Search for issues: `gh issue list --repo owner/repo`
80- View pull requests: `gh pr list --repo owner/repo`
81- Clone repositories: `gh repo clone owner/repo`
82```
83
84#### DeepWiki MCP
85
86[DeepWiki MCP](https://hub.continue.dev/deepwiki/deepwiki-mcp) lets your agent explore any public GitHub repository.
87```
88
89Once configured, your agent can explore repositories like:
90- "Explore the React repository structure"
91- "Find how authentication is implemented in NextAuth.js"
92
93### Internal codebases
94
95For private and internal repositories, you need additional setup:
96
97#### Custom MCP servers
98
99Create an MCP server that has access to your internal repositories.
100
101#### Custom code RAG
102
103For faster retrieval and lower costs with very large internal codebases, consider implementing a [custom code RAG](/guides/custom-code-rag) system. This is an advanced approach that requires more setup but can provide performance benefits at scale.
104
105## Make your agent aware of relevant documentation
106
107Documentation provides crucial context for your agent to understand APIs, frameworks, and best practices.
108
109### Public documentation
110
111#### Rules with documentation links
112
113Guide your agent to relevant documentation:
114
115```markdown
116# Documentation Resources
117
118For framework-specific questions, refer to:
119- React: https://react.dev/reference/react
120- Next.js: https://nextjs.org/docs
121- Tailwind CSS: https://tailwindcss.com/docs
122
123Always cite documentation when explaining concepts.
124```
125
126#### Context7 MCP
127
128[Context7 MCP](https://hub.continue.dev/upstash/context7-mcp) enables your agent to search and retrieve information from public documentation:
129
130Your agent can then answer questions like:
131- "How do I use React hooks?"
132- "What's the syntax for Tailwind CSS animations?"
133
134### Internal documentation
135
136For private documentation and wikis:
137
138#### Rules with internal links
139
140Create rules that reference internal resources:
141
142```markdown
143# Internal Documentation
144
145Our team documentation is available at:
146- API Documentation: https://internal.docs/api
147- Architecture Guide: https://internal.docs/architecture
148- Deployment Process: https://internal.docs/deployment
149
150Always follow our internal standards when suggesting code.
151```
152
153#### Custom MCP servers for docs
154
155Create an MCP server that accesses your internal documentation.
156
157## Migrating from deprecated context providers
158
159If you were previously using the `@Codebase` or `@Docs` context providers, here's how to migrate to the new approach:
160
161### Migrating from @Codebase
162
163The `@Codebase` context provider has been deprecated. Instead:
164
1651. **Use built-in tools**: Your agent can now use file exploration and search tools to understand your codebase
1662. **Add rules**: Create `.continue/rules` files to provide context about your project structure
1673. **Use MCP servers**: For external codebases, use DeepWiki MCP or custom MCP servers
168
169### Migrating from @Docs
170
171The `@Docs` context provider has been deprecated. Instead:
172
1731. **Use Context7 MCP**: For public documentation, Context7 MCP provides similar functionality
1742. **Add documentation links in rules**: Create rules that reference documentation URLs
1753. **Use custom MCP servers**: For internal documentation, create an MCP server with access to your docs
176
177The new approach provides better integration with Continue's Agent features and more intelligent context selection.
178
179## Next steps
180
181- Learn more about [MCP servers](/reference/continue-mcp)
182- Explore [rules configuration](/customize/deep-dives/rules)
183- Set up [custom assistants](/guides/understanding-assistants) with specific knowledge domains