Skip to content

Commit b6a877c

Browse files
authored
Docs: Improve and write clear installations (stitionai#387)
* fix: HMR error * fix: second message from not showing/ remove:console.log * Docs: improve and write clear installations * update * refactoring and changes * enhancements
1 parent b498160 commit b6a877c

14 files changed

+500
-156
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+20-21
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,32 @@ labels: ''
66
assignees: ''
77

88
---
9+
<!-- NOTE: check if a similar issue is already submitted. Please search among the [Issues] -->
910

10-
**Describe the bug**
11+
### Describe the bug
1112
A clear and concise description of what the bug is.
1213

13-
**To Reproduce**
14-
Steps to reproduce the behavior:
15-
1. Go to '...'
16-
2. Click on '....'
17-
3. Scroll down to '....'
18-
4. See error
14+
### How To Reproduce
15+
Steps to reproduce the behavior (example):
16+
1. {steps_1}
17+
2. {steps_2}
18+
3. {steps_3}
1919

20-
**Expected behavior**
20+
### Expected behavior
2121
A clear and concise description of what you expected to happen.
2222

23-
**Screenshots**
24-
If applicable, add screenshots to help explain your problem.
23+
### Screenshots and logs
24+
must share logs from frontend or backend. also If applicable, add screenshots to help explain your problem.
2525

26-
**Desktop (please complete the following information):**
27-
- OS: [e.g. iOS]
28-
- Browser [e.g. chrome, safari]
29-
- Version [e.g. 22]
26+
### Configuration
27+
```
28+
- OS: [e.g. Windows, Linux, MacOS]
29+
- Python version: [e.g. 3.10]
30+
- Node version: [e.g. 18.0.0]
31+
- bun version: [e.g. 0.1.0]
32+
- search engine: [e.g. google]
33+
- Model: [e.g. gpt, cluade]
34+
```
3035

31-
**Smartphone (please complete the following information):**
32-
- Device: [e.g. iPhone6]
33-
- OS: [e.g. iOS8.1]
34-
- Browser [e.g. stock browser, safari]
35-
- Version [e.g. 22]
36-
37-
**Additional context**
36+
#### Additional context
3837
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe.**
10+
## Is your feature request related to a problem? Please describe.
1111
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1212

13-
**Describe the solution you'd like**
13+
## Describe the solution you'd like
1414
A clear and concise description of what you want to happen.
1515

16-
**Describe alternatives you've considered**
16+
## Describe alternatives you've considered
1717
A clear and concise description of any alternative solutions or features you've considered.
1818

19-
**Additional context**
19+
### Additional context
2020
Add any other context or screenshots about the feature request here.

.github/pull_request_template.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
name: Pull request
3+
about: Create a pull request to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
<!-- NOTE: A similar PR may already be submitted! Please search among the [Pull request] before creating one.
11+
12+
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:
13+
14+
For more information, see the `CONTRIBUTING` guide. -->
15+
16+
### Description
17+
18+
<!-- Describe the changes in this PR. -->
19+
20+
for e.g.
21+
* [ ] Bug 1
22+
* [ ] Bug 2
23+
* [ ] Feature 1
24+
* [ ] Feature 2
25+
* [ ] Breaking changes
26+
27+
<!-- You can skip this if you're fixing a typo or adding an app to the Showcase. -->
28+
29+
Explain what existing problem does the pull request solve?
30+
31+
<!-- Example: When "Adding a function to do X", explain why it is necessary to have a way to do X. -->
32+
33+
### Test plan (required)
34+
35+
Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.
36+
37+
38+
### Closing issues (optional)
39+
40+
<!-- Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if such). -->
41+
Fixes #

CONTRIBUTING.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,38 @@
1-
We welcome contributions to enhance Devika's capabilities and improve its performance. To contribute, please follow these steps:
1+
# Welcome Contributors
2+
We welcome contributions to enhance Devika's capabilities and improve its performance. To report bugs, create a [GitHub issue](https://github.com/stitionai/devika/issues).
3+
4+
> Before contributing, read through the existing issues and pull requests to see if someone else is already working on something similar. That way you can avoid duplicating efforts.
5+
6+
To contribute, please follow these steps:
27

38
1. Fork the Devika repository on GitHub.
49
2. Create a new branch for your feature or bug fix.
510
3. Make your changes and ensure that the code passes all tests.
611
4. Submit a pull request describing your changes and their benefits.
712

13+
14+
### Pull Request Guidelines
15+
When submitting a pull request, please follow these guidelines:
16+
17+
1. **Title**: please include following prefixes:
18+
- `Feature:` for new features
19+
- `Fix:` for bug fixes
20+
- `Docs:` for documentation changes
21+
- `Refactor:` for code refactoring
22+
- `Improve:` for performance improvements
23+
- `Other:` for other changes
24+
25+
for example:
26+
- `Feature: added new feature to the code`
27+
- `Fix: fixed the bug in the code`
28+
29+
2. **Description**: Provide a clear and detailed description of your changes in the pull request. Explain the problem you are solving, the approach you took, and any potential side effects or limitations of your changes.
30+
3. **Documentation**: Update the relevant documentation to reflect your changes. This includes the README file, code comments, and any other relevant documentation.
31+
4. **Dependencies**: If your changes require new dependencies, ensure that they are properly documented and added to the `requirements.txt` or `package.json` files.
32+
5. if the pull request does not meet the above guidelines, it may be closed without merging.
33+
34+
35+
**Note**: Please ensure that you have the latest version of the code before creating a pull request. If you have an existing fork, just sync your fork with the latest version of the Devika repository.
36+
37+
838
Please adhere to the coding conventions, maintain clear documentation, and provide thorough testing for your contributions.

README.md

+34-130
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,11 @@
1414
- [About](#about)
1515
- [Key Features](#key-features)
1616
- [System Architecture](#system-architecture)
17-
- [Quick Start](#quick-start)
18-
- [Installation](#installation)
1917
- [Getting Started](#getting-started)
18+
- [Requirements](#Requirements)
19+
- [Installation](#installation)
20+
- [How to use](#how-to-use)
2021
- [Configuration](#configuration)
21-
- [Under The Hood](#under-the-hood)
22-
- [AI Planning and Reasoning](#ai-planning-and-reasoning)
23-
- [Keyword Extraction](#keyword-extraction)
24-
- [Browser Interaction](#browser-interaction)
25-
- [Code Writing](#code-writing)
2622
- [Community Discord Server](#community-discord-server)
2723
- [Contributing](#contributing)
2824
- [License](#license)
@@ -54,54 +50,20 @@ https://github.com/stitionai/devika/assets/26198477/cfed6945-d53b-4189-9fbe-6696
5450

5551
## System Architecture
5652

57-
Devika's system architecture consists of the following key components:
53+
Read [**README.md**](docs/architecture) for the detailed documentation.
5854

59-
1. **User Interface**: A web-based chat interface for interacting with Devika, viewing project files, and monitoring the agent's state.
60-
2. **Agent Core**: The central component that orchestrates the AI planning, reasoning, and execution process. It communicates with various sub-agents and modules to accomplish tasks.
61-
3. **Large Language Models**: Devika leverages state-of-the-art language models like **Claude**, **GPT-4**, and **Local LLMs via Ollama** for natural language understanding, generation, and reasoning.
62-
4. **Planning and Reasoning Engine**: Responsible for breaking down high-level objectives into actionable steps and making decisions based on the current context.
63-
5. **Research Module**: Utilizes keyword extraction and web browsing capabilities to gather relevant information for the task at hand.
64-
6. **Code Writing Module**: Generates code based on the plan, research findings, and user requirements. Supports multiple programming languages.
65-
7. **Browser Interaction Module**: Enables Devika to navigate websites, extract information, and interact with web elements as needed.
66-
8. **Knowledge Base**: Stores and retrieves project-specific information, code snippets, and learned knowledge for efficient access.
67-
9. **Database**: Persists project data, agent states, and configuration settings.
6855

69-
Read [**ARCHITECTURE.md**](https://github.com/stitionai/devika/blob/main/ARCHITECTURE.md) for the detailed documentation.
70-
71-
## Quick Start
72-
73-
The easiest way to run the project locally:
74-
75-
1. Install `uv` - Python Package manager (https://github.com/astral-sh/uv)
76-
2. Install `bun` - JavaScript runtime (https://bun.sh/docs/installation)
77-
3. Install and setup `Ollama` (https://ollama.com/) (if you don't want to use the local models then you can skip this step)
78-
79-
For ollama you need to install the [models](https://ollama.com/models)<br>
80-
For API models, configure the API keys via setting page in UI. <br><br>
81-
82-
Then execute the following set of command:
56+
## Getting Started
8357

58+
### Requirements
8459
```
85-
ollama serve
86-
git clone https://github.com/stitionai/devika.git
87-
cd devika/
88-
uv venv
89-
source .venv/bin/activate
90-
uv pip install -r requirements.txt
91-
playwright install --with-deps
92-
cd ui/
93-
bun install
94-
bun run dev
95-
cd ..
96-
python3 devika.py
60+
- Linux, MacOS, or Windows
61+
- Python >= 3.9 and < 3.12
62+
- NodeJs >= 18
63+
- bun
9764
```
9865

99-
Docker images will be released soon. :raised_hands:
100-
101-
## Installation
102-
Devika requires the following things as dependencies:
103-
- Ollama (follow the instructions here to install it: [https://ollama.com/](https://ollama.com/))
104-
- Bun (follow the instructions here to install it: [https://bun.sh/](https://bun.sh/))
66+
### Installation
10567

10668
To install Devika, follow these steps:
10769

@@ -113,36 +75,39 @@ To install Devika, follow these steps:
11375
```bash
11476
cd devika
11577
```
116-
3. Create a virtual environment and install the required dependencies:
78+
3. Create a virtual environment and install the required dependencies (you can use any virtual environment manager):
11779
```bash
11880
uv venv
11981
uv pip install -r requirements.txt
12082
```
121-
4. Install the required dependencies:
83+
4. Install the playwright for browsering capabilities:
12284
```bash
123-
pip install -r requirements.txt
12485
playwright install --with-deps # installs browsers in playwright (and their deps) if required
12586
```
126-
5. Set up the necessary API keys and [Configuration](#configuration)
127-
6. Start the Devika server:
87+
5. (optional step) for setting up the ollama, you can follow the [ollama setup guide](docs/Installation/ollama.md)
88+
5. Start the Devika server:
12889
```bash
12990
python devika.py
13091
```
131-
7. Compile and run the UI server:
92+
6. if everything is working fine, you see the following output:
93+
```bash
94+
root: INFO : Devika is up and running!
95+
```
96+
6. Now, for frontend, open a new terminal and navigate to the `ui` directory:
13297
```bash
13398
cd ui/
13499
bun install
135100
bun run dev
136101
```
137-
8. Access the Devika web interface by opening a browser and navigating to `http://127.0.0.1:3000`.
102+
8. Access the Devika web interface by opening a browser and navigating to `http://127.0.0.1:3000`
138103

139-
## Getting Started
104+
### how to use
140105

141106
To start using Devika, follow these steps:
142107

143108
1. Open the Devika web interface in your browser.
144-
2. Create a new project by clicking on the "New Project" button and providing a name for your project.
145-
3. Select the desired programming language and model configuration for your project.
109+
2. for creating a project, click on 'select project' and then click on 'new project'.
110+
3. Select the search engine and model configuration for your project.
146111
4. In the chat interface, provide a high-level objective or task description for Devika to work on.
147112
5. Devika will process your request, break it down into steps, and start working on the task.
148113
6. Monitor Devika's progress, view generated code, and provide additional guidance or feedback as needed.
@@ -155,15 +120,6 @@ Devika requires certain configuration settings and API keys to function properly
155120

156121
when you first time run Devika, it will create a `config.toml` file for you in the root directory. You can configure the following settings in the settings page via UI:
157122

158-
- STORAGE
159-
- `SQLITE_DB`: The path to the SQLite database file for storing Devika's data.
160-
- `SCREENSHOTS_DIR`: The directory where screenshots captured by Devika will be stored.
161-
- `PDFS_DIR`: The directory where PDF files processed by Devika will be stored.
162-
- `PROJECTS_DIR`: The directory where Devika's projects will be stored.
163-
- `LOGS_DIR`: The directory where Devika's logs will be stored.
164-
- `REPOS_DIR`: The directory where Git repositories cloned by Devika will be stored.
165-
- `WEB_SEARCH`: This determines the default web search method for browsing the web. Accepted values are: google, bing, or ddgs.
166-
167123
- API KEYS
168124
- `BING`: Your Bing Search API key for web searching capabilities.
169125
- `GOOGLE_SEARCH`: Your Google Search API key for web searching capabilities.
@@ -174,77 +130,25 @@ when you first time run Devika, it will create a `config.toml` file for you in t
174130
- `MISTRAL`: Your Mistral API key for accessing Mistral models.
175131
- `GROQ`: Your Groq API key for accessing Groq models.
176132
- `NETLIFY`: Your Netlify API key for deploying and managing web projects.
177-
178-
Make sure to keep your API keys secure and do not share them publicly.
179-
180-
### Configuring web search method
181-
182-
Devika currently supports Bing, Google, and DuckDuckGo for web searches. You can configure the web search method via UI.
183-
184-
## Under The Hood
185-
186-
Let's dive deeper into some of the key components and techniques used in Devika:
187-
188-
### AI Planning and Reasoning
189133

190-
Devika employs advanced AI planning and reasoning algorithms to break down high-level objectives into actionable steps. The planning process involves the following stages:
134+
- API_ENDPOINTS
135+
- `BING`: The Bing API endpoint for web searching.
136+
- `GOOGLE`: The Google API endpoint for web searching.
137+
- `OLLAMA`: The Ollama API endpoint for accessing Local LLMs.
191138

192-
1. **Objective Understanding**: Devika analyzes the given objective or task description to understand the user's intent and requirements.
193-
2. **Context Gathering**: Relevant context is collected from the conversation history, project files, and knowledge base to inform the planning process.
194-
3. **Step Generation**: Based on the objective and context, Devika generates a sequence of high-level steps to accomplish the task.
195-
4. **Refinement and Validation**: The generated steps are refined and validated to ensure their feasibility and alignment with the objective.
196-
5. **Execution**: Devika executes each step in the plan, utilizing various sub-agents and modules as needed.
197139

198-
The reasoning engine constantly evaluates the progress and makes adjustments to the plan based on new information or feedback received during execution.
140+
Make sure to keep your API keys secure and do not share them publicly. For setting up the Bing and Google search API keys, follow the instructions in the [search engine setup](docs/Installation/search_engine.md)
199141

200-
### Keyword Extraction
201142

202-
To enable focused research and information gathering, Devika employs keyword extraction techniques. The process involves the following steps:
203-
204-
1. **Preprocessing**: The input text (objective, conversation history, or project files) is preprocessed by removing stop words, tokenizing, and normalizing the text.
205-
2. **Keyword Identification**: Devika uses the BERT (Bidirectional Encoder Representations from Transformers) model to identify important keywords and phrases from the preprocessed text. BERT's pre-training on a large corpus allows it to capture semantic relationships and understand the significance of words in the given context.
206-
3. **Keyword Ranking**: The identified keywords are ranked based on their relevance and importance to the task at hand. Techniques like TF-IDF (Term Frequency-Inverse Document Frequency) and TextRank are used to assign scores to each keyword.
207-
4. **Keyword Selection**: The top-ranked keywords are selected as the most relevant and informative for the current context. These keywords are used to guide the research and information gathering process.
208-
209-
By extracting contextually relevant keywords, Devika can focus its research efforts and retrieve pertinent information to assist in the task completion.
210-
211-
### Browser Interaction
212-
213-
Devika incorporates browser interaction capabilities to navigate websites, extract information, and interact with web elements. The browser interaction module leverages the Playwright library to automate web interactions. The process involves the following steps:
214-
215-
1. **Navigation**: Devika uses Playwright to navigate to specific URLs or perform searches based on the keywords or requirements provided.
216-
2. **Element Interaction**: Playwright allows Devika to interact with web elements such as clicking buttons, filling forms, and extracting text from specific elements.
217-
3. **Page Parsing**: Devika parses the HTML structure of the web pages visited to extract relevant information. It uses techniques like CSS selectors and XPath to locate and extract specific data points.
218-
4. **JavaScript Execution**: Playwright enables Devika to execute JavaScript code within the browser context, allowing for dynamic interactions and data retrieval.
219-
5. **Screenshot Capture**: Devika can capture screenshots of the web pages visited, which can be useful for visual reference or debugging purposes.
220-
221-
The browser interaction module empowers Devika to gather information from the web, interact with online resources, and incorporate real-time data into its decision-making and code generation processes.
222-
223-
### Code Writing
224-
225-
Devika's code writing module generates code based on the plan, research findings, and user requirements. The process involves the following steps:
226-
227-
1. **Language Selection**: Devika identifies the programming language specified by the user or infers it based on the project context.
228-
2. **Code Structure Generation**: Based on the plan and language-specific patterns, Devika generates the high-level structure of the code, including classes, functions, and modules.
229-
3. **Code Population**: Devika fills in the code structure with specific logic, algorithms, and data manipulation statements. It leverages the research findings, code snippets from the knowledge base, and its own understanding of programming concepts to generate meaningful code.
230-
4. **Code Formatting**: The generated code is formatted according to the language-specific conventions and best practices to ensure readability and maintainability.
231-
5. **Code Review and Refinement**: Devika reviews the generated code for syntax errors, logical inconsistencies, and potential improvements. It iteratively refines the code based on its own analysis and any feedback provided by the user.
232-
233-
Devika's code writing capabilities enable it to generate functional and efficient code in various programming languages, taking into account the specific requirements and context of each project.
234-
235-
# Community Discord Server
236-
237-
We have a Discord server for the Devika community, where you can connect with other users, share your experiences, ask questions, and collaborate on the project. To join the server, please follow these guidelines:
143+
## Contributing
238144

239-
- Be respectful: Treat all members of the community with kindness and respect. Harassment, hate speech, and other forms of inappropriate behavior will not be tolerated.
240-
- Contribute positively: Share your ideas, insights, and feedback to help improve Devika. Offer assistance to other community members when possible.
241-
- Maintain privacy: Respect the privacy of others and do not share personal information without their consent.
145+
We welcome contributions to enhance Devika's capabilities and improve its performance. To contribute, please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file for steps.
242146

243-
To join the Devika community Discord server, [click here](https://discord.gg/CYRp43878y).
147+
## Help and Support
244148

245-
## Contributing
149+
If you have any questions, feedback, or suggestions, please feel free to reach out to us. you can raise an issue in the [issue tracker](https://github.com/stitionai/devika/issues) or join the [discussions](https://github.com/stitionai/devika/discussions) for general discussions.
246150

247-
We welcome contributions to enhance Devika's capabilities and improve its performance. To contribute, please see the [`CONTRIBUTING.md`](CONTRIBUTING.md) file for steps.
151+
We also have a Discord server for the Devika community, where you can connect with other users, share your experiences, ask questions, and collaborate on the project. To join the Devika community Discord server, [click here](https://discord.gg/CYRp43878y).
248152

249153
## License
250154

docs/Installation/images/bing-1.png

73.8 KB
Loading

docs/Installation/images/bing.png

58.3 KB
Loading

docs/Installation/images/google-2.png

101 KB
Loading

docs/Installation/images/google.png

226 KB
Loading

0 commit comments

Comments
 (0)