๐ LEARN.md - Astra AI Secretary App
Welcome to the **Astra AI Secretary App** learning guide! This document will help you understand the project structure, technologies used, and how to contribute effectively to this GirlScript Summer of Code (GSSoC) project.
๐ LEARN.md - Astra AI Secretary App
Welcome to the Astra AI Secretary App learning guide! This document will help you understand the project structure, technologies used, and how to contribute effectively to this GirlScript Summer of Code (GSSoC) project.
๐ฏ Project Overview
Astra AI is an AI-powered personal secretary Android application designed to assist users with various tasks through voice and text interactions. It utilizes a local LLM (LLaMA 3 via Ollama) to provide intelligent responses and features memory-based context and retrieval-augmented generation (RAG) capabilities.
Key Features
- ๐ค Voice and text input support
- ๐ง Intelligent responses using LLaMA 3
- ๐พ Memory management for context-aware interactions
- ๐ฌ User-friendly chat interface
- โ๏ธ Settings management for user preferences
- ๐ Text-to-Speech and Speech Recognition
- ๐ฏ Wake word detection with background listening
๐ฑ Technology Stack
- Platform: Android
- Language: Kotlin
- Build System: Gradle with Kotlin DSL
- Architecture: Modern Android Architecture Components
๐ Project Structure
Root Level Files
build.gradle.kts- Main project build configuration using Kotlin DSLsettings.gradle.kts- Gradle settings and module configurationgradle.properties- Project-wide Gradle properties and build optimizationsgradlew/gradlew.bat- Gradle wrapper scripts for Unix/Windowslocal.properties- Local development properties (SDK paths, API keys)secrets.properties- Secure configuration file for sensitive datasecrets.properties.template- Template for required secret configurationsLICENSE- Project license informationREADME.md- Main project documentation
Core Directories
๐ฑ /app Directory
The main Android application module containing all source code and resources.
build.gradle.kts- App-specific build configuration and dependenciessrc/main/- Primary source code directoryAndroidManifest.xml- App permissions, components, and configurationkotlin/- All Kotlin source code organized by packagesres/- Android resources (layouts, strings, colors, etc.)
src/test/- Unit test filesbuild/- Generated build artifacts and intermediate files
๐๏ธ Detailed Source Code Architecture
Main Application Structure (src/main/kotlin/com/example/aisecretary/)
๐ฏ Core Application
MainActivity.kt- Main entry point and navigation hostSecretaryApplication.kt- Application class for global initialization
๐ฌ UI Layer (ui/)
chat/- Chat interface componentsChatFragment.kt- Main chat screen UIChatViewModel.kt- Chat logic and state managementMessageAdapter.kt- RecyclerView adapter for messages
settings/- Settings and preferencesSettingsFragment.kt- Settings screen UISettingsViewModel.kt- Settings logic and preferences
memory/- Memory management interfaceMemoryFragment.kt- Memory visualization screenMemoryViewModel.kt- Memory operations logicMemoryAdapter.kt- Adapter for memory items display
๐ Data Layer (data/)
model/- Data models and entitiesMessage.kt- Chat message data structureConversationContext.kt- Context for AI conversations
repository/- Data access abstractionChatRepository.kt- Chat data operationsVoiceRepository.kt- Voice processing operations
local/- Local data storagedatabase/- Room database componentsAppDatabase.kt- Main database configurationdao/MessageDao.kt- Message data access object
preferences/UserPreferences.kt- Shared preferences wrapper
๐ค AI Components (ai/)
llm/- Large Language Model integrationLlamaClient.kt- LLaMA 3 API clientOllamaService.kt- Ollama service integration
voice/- Voice processingSpeechRecognizer.kt- Speech-to-text functionalityTextToSpeech.kt- Text-to-speech functionality
memory/- AI memory systemConversationMemory.kt- Context memory managementMemoryManager.kt- Memory operations and cleanup
rag/- Retrieval Augmented GenerationDocumentStore.kt- Document storage for RAGRetriever.kt- Information retrieval logicVectorStore.kt- Vector embeddings storage
๐ง Dependency Injection (di/)
AppModule.kt- Dagger/Hilt module for dependency injection
๐จ Resources Directory (src/main/res/)
๐ฑ UI Resources
layout/- XML layout files for activities and fragmentsactivity_main.xml- Main activity layoutfragment_chat.xml- Chat screen layoutfragment_settings.xml- Settings screen layout
drawable/- Vector drawables, images, and drawable resourcesmipmap-anydpi-v26/- App icons for different screen densities
๐งญ Navigation
navigation/- Navigation component graphsnav_graph.xml- App navigation flow
๐จ Styling & Content
values/- App-wide values and configurationscolors.xml- Color palette definitionsstrings.xml- Text strings and localizationsthemes.xml- Material Design themes and styles
menu/- Menu definitions for navigation and options
๐งช Testing (src/test/)
kotlin/com/example/aisecretary/- Unit testsLlmClientTest.kt- Tests for LLM integration
๐ ๏ธ Technical Setup
Prerequisites
- Android Studio: Latest stable version (Arctic Fox or newer)
- JDK: Java 17
- Android SDK: API level 21 (minimum) to 34 (target)
- Kotlin: 1.9.0 or newer
- Gradle: 8.0 or newer
Key Dependencies
- AndroidX Core & UI: Material Design, ConstraintLayout, AppCompat
- Architecture Components: Lifecycle, ViewModel, Room Database
- Networking: Retrofit2 with Gson converter
- Async Operations: Kotlin Coroutines
- Navigation: Navigation Component
- Image Loading: Glide
- Testing: JUnit, Mockito, Robolectric, Espresso
Configuration Files
secrets.properties: Store sensitive configuration (API keys, URLs)OLLAMA_BASE_URL: Local Ollama server endpointLLAMA_MODEL_NAME: LLaMA model identifier
local.properties: SDK paths and local development settings
๐ Getting Started for Contributors
1. Environment Setup
# Clone the repository
git clone https://github.com/A-Akhil/Astra-Ai.git
cd Astra-Ai
# Copy secrets template and configure
cp secrets.properties.template secrets.properties
# Edit secrets.properties with your configuration
2. Project Structure Understanding
- Start with
MainActivity.ktto understand app flow - Explore
ChatFragment.ktfor UI components - Check
ChatViewModel.ktfor business logic - Review
LlamaClient.ktfor AI integration
3. Development Workflow
- Pick an issue from the GSSoC issue tracker
- Create a feature branch:
git checkout -b feature/your-feature - Make changes following the established patterns
- Test your changes using unit and integration tests
- Submit a PR with clear description and testing evidence
4. Code Style Guidelines
- Follow Kotlin coding conventions
- Use MVVM architecture for new features
- Implement dependency injection for new components
- Add unit tests for business logic
- Use meaningful variable and function names
๐ฏ Areas for Contribution
๐ข Beginner-Friendly
- UI improvements and bug fixes
- Documentation updates
- Test case additions
- Resource optimizations (strings, colors, layouts)
๐ก Intermediate
- New chat features and customizations
- Voice processing enhancements
- Database schema improvements
- Performance optimizations
๐ด Advanced
- AI model integration improvements
- Memory system enhancements
- RAG implementation features
- Architecture component additions
๐ App Permissions & Configuration
Required Permissions
- INTERNET: For API calls to Ollama server
- RECORD_AUDIO: For voice input functionality
- READ/WRITE_EXTERNAL_STORAGE: For file operations and caching
Application Configuration
- Package:
com.example.aisecretary - Target SDK: 34 (Android 14)
- Minimum SDK: 21 (Android 5.0)
- Application Class:
SecretaryApplicationfor global initialization
๐ง Building & Running
Development Build
# Build debug APK
./gradlew assembleDebug
# Install on connected device
./gradlew installDebug
# Run tests
./gradlew test
Configuration Setup
- Copy
secrets.properties.templatetosecrets.properties - Configure your Ollama server URL and model:
OLLAMA_BASE_URL=http://your-server:11434 LLAMA_MODEL_NAME=llama3:8b
๐ Learning Resources
Android Development
Architecture Patterns
AI Integration
๐ง Troubleshooting
Common Issues
Build Issues:
- Ensure Java 17 is installed and selected
- Check Android SDK installation
- Verify
local.propertieshas correct SDK path - Make sure
secrets.propertiesexists with valid configuration
Runtime Issues:
- Check Ollama server is running and accessible
- Verify network permissions are granted
- Ensure microphone permissions for voice features
- Check device API level compatibility (minimum API 21)
Development Environment:
- Use Android Studio Arctic Fox or newer
- Enable Kotlin plugin
- Install Android SDK Tools and Platform Tools
- Configure proper emulator or physical device
Getting Help
- Check existing GitHub issues first
- Search the project documentation
- Ask in GSSoC Discord community
- Create a detailed issue with logs and steps to reproduce
๐งช Testing Guidelines
Unit Tests
- Located in
src/test/kotlin/ - Run with
./gradlew test - Cover business logic and data operations
- Mock external dependencies
Integration Tests
- Test complete user flows
- Verify AI integration works correctly
- Test voice processing functionality
- Validate database operations
Testing Best Practices
- Write tests before implementing features (TDD)
- Use descriptive test names
- Test both success and failure scenarios
- Mock network calls and external services
๐ Project Status & Roadmap
Current Version: 1.0
- โ Core chat functionality
- โ LLaMA 3 integration via Ollama
- โ Voice input/output
- โ Memory management system
- โ Settings and preferences
- โ Room database integration
Upcoming Features
- ๐ Enhanced RAG capabilities
- ๐ Improved memory visualization
- ๐ Advanced voice commands
- ๐ Customizable AI personalities
- ๐ Offline mode capabilities
GSSoC Contribution Opportunities
- UI/UX Improvements: Enhance the chat interface and memory visualization
- AI Features: Improve memory management and RAG implementation
- Performance: Optimize database operations and memory usage
- Testing: Expand test coverage and add automated testing
- Documentation: Improve code comments and user guides
- Accessibility: Add accessibility features for better inclusion
๐ค Contributing to GSSoC
Code of Conduct
Before contributing, please read and follow our Code of Conduct. We are committed to providing a welcoming, inclusive, and harassment-free experience for everyone in the GSSoC community.
Issue Labels
good first issue: Perfect for newcomershacktoberfest: Part of Hacktoberfest celebrationenhancement: New features and improvementsbug: Bug fixes neededdocumentation: Documentation improvements
Pull Request Guidelines
- Fork the repository
- Create a descriptive branch name
- Follow the code style guidelines
- Add tests for new functionality
- Update documentation if needed
- Reference issues in your PR description
- Ensure compliance with the Code of Conduct
Code Review Process
- All PRs require at least one review
- Ensure CI checks pass
- Address reviewer feedback promptly
- Maintain backwards compatibility
- Follow GSSoC community standards
๐ Support & Communication
- GitHub Issues: For bug reports and feature requests
- Discussions: For questions and community support
- GSSoC Discord: For real-time communication
- Email: gssoc@girlscript.tech for Code of Conduct violations
๐ Recognition
This project is part of GirlScript Summer of Code (GSSoC) - an initiative to encourage open source contributions and provide learning opportunities for students and developers.
Happy Coding! ๐
Last updated: July 2025
Related Documents
Design Document: BharatSeva AI
BharatSeva AI is a multi-agent orchestration system built on AWS using Amazon Bedrock Agents with Claude 3.5 Sonnet as the foundation model. The system deploys 10 AI agents (1 Master Orchestrator + 9 Specialist Agents) to assist India's informal sector workers in navigating government schemes across three domains: PM Vishwakarma (artisan credit), PMFBY (crop insurance), and BOCW (construction worker welfare).
OpenClaw Enterprise Transformation Plan
Transform OpenClaw from a single-user personal AI assistant into a **dual-mode platform** that is simultaneously:
Qwen Image and Edit: Open-sourcing and Local GGUF Generations with Lightning
Daniel Sandner, for article on https://sandner.art/
Qwen3-TTS โ Model Reference
Models: `Qwen/Qwen3-TTS-12Hz-0.6B-CustomVoice` and `Qwen/Qwen3-TTS-12Hz-1.7B-CustomVoice`