Elffuss BraidHub

kikocis/continue public

ac220e7e5ff5 · 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
88Once configured, your agent can explore repositories like:
89- "Explore the React repository structure"
90- "Find how authentication is implemented in NextAuth.js"
91
92### Internal codebases
93
94For private and internal repositories, you need additional setup:
95
96#### Custom MCP servers
97
98Create an MCP server that has access to your internal repositories.
99
100#### Custom code RAG
101
102For 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.
103
104## Make your agent aware of relevant documentation
105
106Documentation provides crucial context for your agent to understand APIs, frameworks, and best practices.
107
108### Public documentation
109
110#### Rules with documentation links
111
112Guide your agent to relevant documentation:
113
114```markdown
115# Documentation Resources
116
117For framework-specific questions, refer to:
118- React: https://react.dev/reference/react
119- Next.js: https://nextjs.org/docs
120- Tailwind CSS: https://tailwindcss.com/docs
121
122Always cite documentation when explaining concepts.
123```
124
125#### Context7 MCP
126
127[Context7 MCP](https://hub.continue.dev/upstash/context7-mcp) enables your agent to search and retrieve information from public documentation:
128
129Your agent can then answer questions like:
130- "How do I use React hooks?"
131- "What's the syntax for Tailwind CSS animations?"
132
133### Internal documentation
134
135For private documentation and wikis:
136
137#### Rules with internal links
138
139Create rules that reference internal resources:
140
141```markdown
142# Internal Documentation
143
144Our team documentation is available at:
145- API Documentation: https://internal.docs/api
146- Architecture Guide: https://internal.docs/architecture
147- Deployment Process: https://internal.docs/deployment
148
149Always follow our internal standards when suggesting code.
150```
151
152#### Custom MCP servers for docs
153
154Create an MCP server that accesses your internal documentation.
155
156## Migrating from deprecated context providers
157
158If you were previously using the `@Codebase` or `@Docs` context providers, here's how to migrate to the new approach:
159
160### Migrating from @Codebase
161
162The `@Codebase` context provider has been deprecated. Instead:
163
1641. **Use built-in tools**: Your agent can now use file exploration and search tools to understand your codebase
1652. **Add rules**: Create `.continue/rules` files to provide context about your project structure
1663. **Use MCP servers**: For external codebases, use DeepWiki MCP or custom MCP servers
167
168### Migrating from @Docs
169
170The `@Docs` context provider has been deprecated. Instead:
171
1721. **Use Context7 MCP**: For public documentation, Context7 MCP provides similar functionality
1732. **Add documentation links in rules**: Create rules that reference documentation URLs
1743. **Use custom MCP servers**: For internal documentation, create an MCP server with access to your docs
175
176The new approach provides better integration with Continue's Agent features and more intelligent context selection.
177
178## Next steps
179
180- Learn more about [MCP servers](/reference/continue-mcp)
181- Explore [rules configuration](/customize/deep-dives/rules)
182- Set up [custom assistants](/guides/understanding-assistants) with specific knowledge domains