Files
8.-samopisnyy-poiskovyy-age…/README.md
T
kuzakhmetovartur dbd910be14
CI / build (3.1) (push) Has been cancelled
CI / build (3.11) (push) Has been cancelled
CI / build (3.8) (push) Has been cancelled
CI / build (3.9) (push) Has been cancelled
feat: solution for '8. Самописный поисковый агент на основе deep agents from scratch'
2026-07-01 13:56:19 +03:00

51 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Deep Search Agent
A minimal implementation of a deep search agent built from scratch using the LangChain framework and OpenAI API.
The agent decides whether to answer a query directly or perform a web search using SerpAPI.
## Prerequisites
- Node.js 18+ (ESM support)
- An OpenAI API key
- A SerpAPI key (free tier available)
## Setup
```bash
# Clone the repository
git clone https://github.com/your-username/deep-search-agent.git
cd deep-search-agent
# Install dependencies
npm install
# Create a .env file with your API keys
cp .env.example .env
# Edit .env and replace the placeholders with your actual keys
```
## Usage
Run the agent with a query:
```bash
npm start -- "What is the capital of France?"
```
The agent will output either a direct answer or the results of a web search.
## How It Works
1. **Planner** Uses an LLM to decide if the query requires a web search or can be answered directly.
2. **Executor** If a search is needed, the agent calls the SerpAPI tool and returns the results.
3. **Memory** Stores conversation context (optional for future extensions).
## Extending
- Add more tools (e.g., Wikipedia, Calculator) and update the planner prompt accordingly.
- Replace the planner with a more sophisticated planner (e.g., chain of thought).
- Persist memory to a database for longterm context.
## License
MIT License