-
Notifications
You must be signed in to change notification settings - Fork 5
Vibe coded general agent #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v2.3.0 | ||
| rev: v5.0.0 | ||
| hooks: | ||
| - id: check-yaml | ||
| - id: end-of-file-fixer | ||
| - id: trailing-whitespace | ||
| - repo: https://github.com/psf/black | ||
| rev: 22.10.0 | ||
| rev: 25.1.0 | ||
| hooks: | ||
| - id: black | ||
| - repo: https://github.com/pycqa/flake8 | ||
| rev: 7.2.0 | ||
| rev: 7.3.0 | ||
| hooks: | ||
| - id: flake8 | ||
| - repo: https://github.com/pycqa/isort | ||
| rev: 5.12.0 | ||
| rev: 6.0.1 | ||
| hooks: | ||
| - id: isort | ||
| args: [--profile=black] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| Askademic is a CLI tool that helps users find information in research papers from arXiv. It's built on PydanticAI and provides: | ||
| - Summarization of latest papers in categories | ||
| - Question answering by searching relevant papers | ||
| - Specific paper retrieval by title/link/arXiv ID | ||
|
|
||
| ## Development Commands | ||
|
|
||
| ### Installation & Setup | ||
| ```bash | ||
| pip install . # Install the package | ||
| pip install -e . # Install in development mode | ||
| ``` | ||
|
|
||
| ### Testing | ||
| ```bash | ||
| pytest # Run all tests | ||
| pytest tests/test_article.py # Run specific test file | ||
| python evals/evals.py # Run evaluation tests | ||
| ``` | ||
|
|
||
| ### Running the Application | ||
| ```bash | ||
| askademic # Start the CLI application | ||
| ``` | ||
|
|
||
| ### Code Quality | ||
| ```bash | ||
| flake8 # Lint code (max line length: 99) | ||
| pre-commit run --all-files # Run pre-commit hooks | ||
| ``` | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Core Components | ||
|
|
||
| 1. **main.py**: Entry point with CLI interface using prompt_toolkit and rich console | ||
| 2. **orchestrator.py**: Main coordination agent that routes requests to specialized agents | ||
| 3. **allower.py**: Determines if user queries are scientific (routes to orchestrator or returns puns) | ||
| 4. **Specialized Agents**: | ||
| - **summary.py**: SummaryAgent for latest paper summaries | ||
| - **question.py**: QuestionAgent for Q&A with arXiv search | ||
| - **article.py**: ArticleAgent for specific paper retrieval and analysis | ||
| 5. **memory.py**: Manages conversation context and token limits | ||
| 6. **utils.py**: Model selection and arXiv API utilities | ||
| 7. **tools.py**: Utility functions for arXiv interactions | ||
|
|
||
| ### Agent Architecture | ||
| - Built on PydanticAI with structured Pydantic model outputs | ||
| - Uses orchestrator pattern - main orchestrator routes to specialized agents | ||
| - Each agent has specific tools and capabilities | ||
| - Memory management tracks conversation history with token limits | ||
|
|
||
| ### Model Support | ||
| - **Gemini 2.0 Flash** (default, preferred for cost and context window) | ||
| - **Claude 3.5 Haiku** (experimental, rate limited) | ||
| - **Claude via AWS Bedrock** (experimental) | ||
| - **Nova Pro via AWS Bedrock** (experimental) | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Environment Variables | ||
| Required in `.env` file (copy from `.env-template`): | ||
| - `LLM_FAMILY`: "gemini", "claude", "claude-aws-bedrock", or "nova-pro-aws-bedrock" | ||
| - `GEMINI_API_KEY`: For Gemini models | ||
| - `ANTHROPIC_API_KEY`: For Claude models | ||
| - `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_REGION`: For AWS Bedrock | ||
|
|
||
| ### Key Settings | ||
| - Max request tokens: 100,000 (configured in memory.py) | ||
| - Usage limits: 20 requests per agent run | ||
| - Default temperature: 0 for consistency | ||
| - Retry strategy: 20 retries with early termination | ||
|
|
||
| ## Development Guidelines | ||
|
|
||
| ### File Structure | ||
| - `src/askademic/`: Main package | ||
| - `prompts/`: System prompts in separate files | ||
| - `tests/`: Unit tests for each component | ||
| - `evals/`: Evaluation scripts | ||
| - `logs/`: Daily log files (auto-generated) | ||
|
|
||
| ### Testing Strategy | ||
| - Unit tests for each agent and utility | ||
| - Manual evaluation suite in `evals/` directory | ||
| - CI/CD with GitHub Actions testing Python 3.11-3.13 | ||
|
|
||
| ### Agent Development | ||
| - Each agent follows PydanticAI patterns with structured outputs | ||
| - Tools decorated with `@agent.tool` for function calling | ||
| - Async/await throughout for API calls | ||
| - Comprehensive logging to daily log files | ||
|
|
||
| ### Memory Management | ||
| - Conversation history maintained with token counting | ||
| - Automatic cleanup when limits exceeded | ||
| - Context window management for different models | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perché ti ha duplicato creando un readme diverso?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questa è una roba interna di Claude code, lo genera così se lo rilegge ed ha del contesto sul progetto
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eh ma che invadente che è, gli dobbiamo pure tenere i file